diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..049f0f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +WebApp/node_modules \ No newline at end of file diff --git a/AppServer/.env b/AppServer/.env new file mode 100755 index 0000000..4215f1d --- /dev/null +++ b/AppServer/.env @@ -0,0 +1,34 @@ +# Docker compose config file +# PostgreSQL settings +DB_USER=admin +DB_PASSWORD=1234 +DB_HOST=pagerino_db +DB_NAME=pager_data + +# App server specific settings +# === Chirpstack API +CHIRP_API_KEY=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJjaGlycHN0YWNrIiwiaXNzIjoiY2hpcnBzdGFjayIsInN1YiI6IjI3YzI5Y2M2LTdjMTUtNDI5Yy1iMjBmLTczNzliZWYzYTI1ZCIsInR5cCI6ImtleSJ9.RsMPIGgPaGluBllRz0Ma_EthxUj3xM9pTPy_uUEAbvk + +# === MQTT broker settings +MQTT_ADDRESS=ssl://mosquitto:8883 +MQTT_CLIENT_ID=app-server +MQTT_QOS=0 +# This App's ID in Chirpstack +# + matches all IDs +# # matches all IDs and all(!) subtopics +APP_ID=d6ccd2ad-0cf7-46ab-8618-7a5a14b8676d + +# Enviroment variables that will be available for every application + +# General version of the system +VERSION=0.1 + +# Optional prefix for logging +LOG_PREFIX=[Pagerino] + +# Main app container name +SERVER_NAME=pagerino-app +SERVER_API_PORT=50222 + +# General preferred connection timeout +TIMEOUT=3s \ No newline at end of file diff --git a/AppServer/Dockerfile b/AppServer/Dockerfile new file mode 100755 index 0000000..46d15e3 --- /dev/null +++ b/AppServer/Dockerfile @@ -0,0 +1,31 @@ +# [0] Go build environment +FROM golang:1.24.5-alpine3.21 AS builder +WORKDIR /app-server/src + +## Dependencies +# Get +COPY ./src/go.mod ./src/go.sum ./ +# Download +RUN go mod download + +## Executable +# Get +COPY ./src . +# Build +RUN go build -o ../build/app_server + +# [1] Final image -> new FS +FROM alpine:latest +WORKDIR /root/ + +# RUN apk add --no-cache ca-certificates +# RUN apk add --no-cache bash + +## Final build +# Get +COPY --from=builder /app-server/build ./build +COPY ./certs ./certs +COPY ./*.env ./build/ + +# Run the app +CMD ["./build/app_server"] diff --git a/AppServer/Makefile b/AppServer/Makefile new file mode 100644 index 0000000..b3eb089 --- /dev/null +++ b/AppServer/Makefile @@ -0,0 +1,40 @@ +# Makefile for compiling all proto files into Go + +PROTO_IN := src/app_comm/proto +PROTO_OUT := src/app_comm/api + +# Find all .proto files recursively +PROTO_FILES := $(shell find $(PROTO_IN) -name "*.proto") +GO_FILES := $(shell find ./src/** -name "*.go") + +# Default target +all: proto + +# Go build +go: $(GO_FILES) + @echo "Building Go application..." + go build -o ../build/app_server -C src + @echo "Done." + +# Compile all proto files +proto: $(PROTO_FILES) + @echo "Generating Go code from proto files..." + @for f in $(PROTO_FILES); do \ + base=$${f##*/}; \ + name=$${base%%.*}; \ + echo "Generating $$f -> $(PROTO_OUT)/$$name"; \ + mkdir -p $(PROTO_OUT)/$$name; \ + protoc -I=$(PROTO_IN) \ + --go_out=$(PROTO_OUT)/$$name --go_opt=paths=source_relative \ + --go-grpc_out=$(PROTO_OUT)/$$name --go-grpc_opt=paths=source_relative \ + $$f || exit 1; \ + done + @echo "Done." + +# Clean builds +clean: + @echo "Deleting built files..." + rm -rf $(PROTO_OUT)/* build/* + @echo "Done." + +.PHONY: all clean diff --git a/AppServer/README.md b/AppServer/README.md new file mode 100755 index 0000000..e53acea --- /dev/null +++ b/AppServer/README.md @@ -0,0 +1,61 @@ +# Pagerino: **Application server** + +### Description + +Dockerized server communicating with Chirpstack (v4) and processing incoming data. + +### Features + +Current working and in-progress capabilities include: + - receiving uplinks + - sending downlinks + - logging messages and telemetery + - managing users, devices, messages and other objects + - accepting api requests + +### Configuration + +Can be found in server.env: +**CHIRP_API_KEY** - used to get more detailed information about the network +of devices from Chirpstack + +**MQTT_ADDRESS** - address for MQTT broker that manages uplinks & downlinks, +do not change unless you reconfigure the chirpstack as well + +**MQTT_CLIENT_ID** - ID to use when communicating with broker, can be anything + +**MQTT_QOS** - quality of service level, leave at zero unless your network supports it + +**APP_ID** - ID of accessing application registred in Chirpstack + +**API_PORT** - port at which API is provided, this and its wrappers are the +only way to officially communicate with the server + +The app requires some other shared variables from shared.env. +If not present, provide the following: +**LOG_PREFIX** +**SERVER_NAME** +**TIMEOUT** - used for establishing connections + +### Prerequisites + +The server communicates through ssl with MQTT and needs the following files +generated from Chirpstack in the certs directory: +- ca.pem +- client.key +- client.pem + +It uses Chirpstack's gRPC API, so it needs the compiled proto files into go in +the src/app_comm/api directory. + +### Usage + +The server requires to be on the same docker network as MQTT broker and Chirpstack +to properly function. + +To start have Chirpstack v4 running in detached state and execute: +```docker compose up``` + + +*Created by Olek \@ Gorak Industries* + diff --git a/AppServer/certs/ca.pem b/AppServer/certs/ca.pem new file mode 100644 index 0000000..19457dd --- /dev/null +++ b/AppServer/certs/ca.pem @@ -0,0 +1,30 @@ +-----BEGIN CERTIFICATE----- +MIIFETCCAvmgAwIBAgIUBcNVhGn2QaXZrzEfo7NEcktfjQowDQYJKoZIhvcNAQEL +BQAwGDEWMBQGA1UEAwwNQ2hpcnBTdGFjay1DQTAeFw0yNTA5MDYyMjUwMzlaFw0y +ODA5MDUyMjUwMzlaMBgxFjAUBgNVBAMMDUNoaXJwU3RhY2stQ0EwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQDKru8yd0ZYdoxDgL0Ls2IiL5+oYmyoEIAq +GKaQltKOUMBMLOaDXum+/aEnCVoch5yzX7As/rIAH1p6rrGy5HJs7xww1ls5yjon +IcVjlpWMnH3PecilVQuZOXEeny2h6zIVaK0aThVB3/+pEVY3nprk9i29KEz+8biU +ykDce30EvemV4g6hF7AfrGiSv/EFLNTyX9YBPZ9LgbC1EHd4W07vYIz67JNcuw42 +xyYSMnp0hsxBiXv7KXlu2h5MjzNOXR8fI9WEkg5BkmVX6h+Uruvaw26uw5prXbYp +FtakDjnnQ+wS7Q3Jl7e0hF4pejvfgZoqJZXErUpRGIPBGD2Gxm+S5J2RahaUOvKY +AQg32okeoOtwv0YoP4Tei3HPyQkKjgGCWjMog3yUCG7z59zXilcl6GvESZEEh0Q/ +M0VKOzh85MnWSJ2otppjCYzzklyUwm5zvWiUS3xQr6e3EapsthS5ccuAzNa++LMU +Vs6TO7U8BshbgNFUqpc7exBdPPdGVzKbzidwJeanshLy0+zc2ZUH+nIdlmQRSlM1 +cyUk0Z5N0X6so3NouHSag7lhqYBGmESX+P4dOqhwgFw4EfmuSLdduXVehU2Cca/1 +6e7YQi+Zy9lHLCN1kmHU0Eu8xoaDH0D3jnKccrWqsV/fiiainAUnTxHkzV8K8guq +3iTrcBsI2QIDAQABo1MwUTAdBgNVHQ4EFgQUFYNQfsgbp5HNBPVNlZ12GSM3FAIw +HwYDVR0jBBgwFoAUFYNQfsgbp5HNBPVNlZ12GSM3FAIwDwYDVR0TAQH/BAUwAwEB +/zANBgkqhkiG9w0BAQsFAAOCAgEAMgeVJHzXHdS47agDhqkz4gPQl4ynohXaZIUw +3tMDLayjj2MuQ/LDuk2by4FTwWCTGGYhbv0WMaPueatdZVygmokh4jXhux+6Yen7 +fBeqV5hkzhl9BPPaMp9Et2FZRYLMkaNXYcEc697NZUQSWkR2VbJ3P+wMk9N61T6n +q0tUdtWW/2EB5w0TtN+Qz2EcANUD1dqdTQkZUUR7yCWbOvUeUvyqx2GBYA9QWxtT +Vg+t4TlXpbSd/28jxpJwjFCrG+kcoyDnnmCqlfKQX3uj0mnuXg0sgKzwf6OroPgR +7wUjL3/RtlQhxxhen2tAoYThVQ6WMfxioSZPUKzkfapib5/pbb2t/srxb7D35ho+ +Iw1qZCIZ1vpRQ7sKeOXqmDmq6wiIHKP3D0ODsppond2BKagb3umJ7LKV3k6hnOTo +vCsnotXXT2apO4S2YcfQ4yTCW6E05Qo8S7hSzXB8RQpq5gGUSB78DB7tAkhf9RIQ +Ek9O+fBDv2LqyPxLUZM7eyaXQ8RzhpQqO+MYESAQgwxu5etPJTjLMxB8eIxrWY0H +CTnTHmKmpbL9YrU4903YvpTh2NDB/0VmlQe9S1PU0FqPws5fCZtaAK4P9Gsfv59j +CiMy2OPUDMrItR/pl3zSAof2lHN1Tp/Lg9yIY5udgwCDzXo7ajxnbL1W+qLC9pq4 +v/HHA+g= +-----END CERTIFICATE----- diff --git a/AppServer/certs/client.key b/AppServer/certs/client.key new file mode 100644 index 0000000..4043a11 --- /dev/null +++ b/AppServer/certs/client.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDR4rPIgeFuktPQ +KRh2DLhUI4IvA+RYOvIjlQRAOawXiQYe/RMwdCsEul36Nsdj+6RQtsANIXgYqdRJ +t8x+pdzmMeczs9dSJcJMZPt3XnMMeW5lV+MeuehzqcVn1xqNYfP8nL7EUGgpXH5t +68bE8xqM8/e/uIwX046WGD2dqbH+WBseJeyo2Zo9mS9jECVv20h1Dzxl3A6tvHB+ +vBxHgZX9X22V0sW5p2oP29CmjG0ETKRznXKCh0udMOiTfkGL4HQ5MTAlXNKaHcO5 +pLow8qGEhG06/s8A+2TahAveGf1dbdzrj2XlaX+FgcYBgeMOLXloFghg77B1C0NI +Fb5dYk1nAgMBAAECggEAJidRakYd/lVHluQZk8AdNAJedIB/HoDcqpY4txokzAR3 +LePwfJLpjQr58XXKykSg6qFGCT0H0Wfx9NKqJG2vWdNBhbcQEdlWWD/VLK5pOJ/M +bzTKTzgZZwk6HvXN2Fyxlz7BOPuq67XqL744HG5a6buh0mLQaLZnCabvcH08I5F5 +VRYq60cEzjVuRzCYwBQuoQi7I4ovIvcKVVQTQ6nPsFlk9CgmBUUK3xzV+ZJSGnZ+ +SzgCXL3XmCdzd2Y/Yhsu4uLNd/LdCuUbgU+audyML+JA5MoiTKHw9fiv9yBeMngA +vdQSM/tMhYDv2liCEMSql7BeQ95/ofv/S7HudF4Z4QKBgQDszjAU//i97efvPRk1 +36taBwCmsnrhK3gHchUdmorU/I1+/2vUh59lf2MHdTpraHWzI1wutCDMOL2PGM5K +CDy2pX8CDM0PBCQUFk+ZeAiGZPyRzOX5OkttqJQId7VzKTzwC9f/9j04rKzY05ps +ga40HpceF5QIfyqmMRgYNTNk4QKBgQDi5ep5m10VDou1/3Xbd8yu+zSVPl6H6ti8 +t3bWdI4/xQF6mowR7Hu6mTlMDBXr44hzjJDdw5Zgfg2GZJJGWM/o5U3jCvwQmtbV +loXwAl246aZ2DvUQ5S9KxoEEZzZ+j44EvX1bmOiOeLR+OsHRTySt5RfFziDMv6jo +/irCp5izRwKBgAGXAMujTFA6IKyChIDQF55rHZ4A5MJOQGgMZAfm2bfEWk7X+Cld +H7zWtht+tf2yndeuDRhjLTUxzFQBnqDwnTe8tLWW0GmhZXydCbvGCoicdPWlooWh +1o/N6fCEnTtAs6AI9FJLnO2ceyyZfxfrZvgCnJEfJ2dHM0oaWkcPVGEBAoGAIa7i +BRWEVvjm0qjO1TrOnvdZ0gIFRIYfkLxnnuSErYDQfGPvAUYrBAN1Fw4APxlzCzxF +0TYU39Q2q8nIUTsj+j34NwlNbCWgWOrUjVG8mhPNi18jEFQFlkMrqfysgVNMUPXU +Y0Gq3GOc39RXK3xlRI9q3QmBowOczqHUtTruF0cCgYEA1XncVWT6ioOhpiv9YXH6 ++GtBeVO8BCyDMiH8cJWYjU1LaljWNmzZDHfWH+cCpb4tNd9RmIhQO27FKVl9BVX7 +xKbi6BXkj8m8H2V7AqCQu/NSKwsYXpAmRLC7vfUqbqlkNPFQSB0gHpIAIrLo2Fjx +hEQcS/cfNEHjKBGNPvFmiTE= +-----END PRIVATE KEY----- diff --git a/AppServer/certs/client.pem b/AppServer/certs/client.pem new file mode 100644 index 0000000..f1a48e1 --- /dev/null +++ b/AppServer/certs/client.pem @@ -0,0 +1,25 @@ +-----BEGIN CERTIFICATE----- +MIIEKjCCAhKgAwIBAgIUX/8vMc8novU3n+VgW4ToUseWZaUwDQYJKoZIhvcNAQEL +BQAwGDEWMBQGA1UEAwwNQ2hpcnBTdGFjay1DQTAeFw0yNTA5MDYyMjUwMzlaFw0y +NjA5MDYyMjUwMzlaMBUxEzARBgNVBAMMCmNoaXJwc3RhY2swggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQDR4rPIgeFuktPQKRh2DLhUI4IvA+RYOvIjlQRA +OawXiQYe/RMwdCsEul36Nsdj+6RQtsANIXgYqdRJt8x+pdzmMeczs9dSJcJMZPt3 +XnMMeW5lV+MeuehzqcVn1xqNYfP8nL7EUGgpXH5t68bE8xqM8/e/uIwX046WGD2d +qbH+WBseJeyo2Zo9mS9jECVv20h1Dzxl3A6tvHB+vBxHgZX9X22V0sW5p2oP29Cm +jG0ETKRznXKCh0udMOiTfkGL4HQ5MTAlXNKaHcO5pLow8qGEhG06/s8A+2TahAve +Gf1dbdzrj2XlaX+FgcYBgeMOLXloFghg77B1C0NIFb5dYk1nAgMBAAGjbzBtMAkG +A1UdEwQCMAAwCwYDVR0PBAQDAgWgMBMGA1UdJQQMMAoGCCsGAQUFBwMCMB0GA1Ud +DgQWBBS5GafUu7Y6QBp76DKG+aGP2XpBMzAfBgNVHSMEGDAWgBQVg1B+yBunkc0E +9U2VnXYZIzcUAjANBgkqhkiG9w0BAQsFAAOCAgEABykbcO04AfW9hiSSmp+aI6iF +1867xhTeIPgAHhDAfMgSCc2B0NFccKn+XVK8LkcEP1B8OM1g6m6JdO1eAeKZgwWY +SMxbmT0uTe3+A7GfAHZw6XXQwB7MoMNzfvM98ishi+zWEbzL2nH3y+zgxMdTH4Ar +t94dcjiEbASHVI1MzIWZQohkS/Nof5sSPwDU90DlsoviUY1HswBq7SR3KK+SDSn6 +h46S0R3S3Hn0u+5mxHnkAuSJ0tjEfK0DUSf5hdWOiKQusi1et2VgVyKhc0/+et8K +m/KhzYctfAdEjFkH4j5rqanlX2D6OeAYv26B6l2QgiDF4n3ezTKEcfjUFX4C/LDg +mxX14LoDm9wWkIp2C+WaaXaSN+bew9u8UhJqVgs7cw5yCk7l8i0XsfpvNce8Wv3V +JCBk9hVpgpPRYNDOmcvdAUIxTqCQSqm29qMEGb+XXJFQl+ZujaEQ1T1oJMZlJ4mV +mRn6oF5lA0dU2Pu8l7R9l0F2wnwBrc+JWKFiVi81tAPrKG/COalQ4zyno3zUiTl0 +3BJo/Ey+IS1aeWdWK0kvG+fsVytvDJCKG7VrErRg9qiZ18avPz3wGl8uGX8n0Nel +TA32TeBE22oa1qAfyhSrtfEMpOsQxQ+yYIaFcwLQWuU2Zlz1zejXjz9iS1VTIZNy +nWHD6N8iJHz/kQjCZuA= +-----END CERTIFICATE----- diff --git a/AppServer/docker-compose.yml b/AppServer/docker-compose.yml new file mode 100644 index 0000000..7d177d1 --- /dev/null +++ b/AppServer/docker-compose.yml @@ -0,0 +1,39 @@ +version: '3.0' + +services: + app_server: + build: . + depends_on: + - pagerino_db + networks: + - app_net + - pagerino_net + restart: on-failure:3 + + pagerino_db: + image: postgres:15 + restart: unless-stopped + environment: + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASSWORD} + POSTGRES_DB: ${DB_NAME} + networks: + - app_net + volumes: + - dbdata:/var/lib/postgresql/data + - ./init.sql:/docker-entrypoint-initdb.d/init.sql + - ./postgresql.conf:/etc/postgresql/postgresql.conf + command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"] + # ports: + # - "5432:5432" + + +volumes: + dbdata: + +networks: + app_net: + driver: bridge + pagerino_net: + external: true + diff --git a/AppServer/init.sql b/AppServer/init.sql new file mode 100755 index 0000000..5f2d7fd --- /dev/null +++ b/AppServer/init.sql @@ -0,0 +1,122 @@ +--CREATE EXTENSION IF NOT EXISTS postgis; +CREATE EXTENSION IF NOT EXISTS hstore; + +CREATE DATABASE pager_data; +CREATE USER admin WITH ENCRYPTED PASSWORD '1234'; +GRANT ALL PRIVILEGES ON DATABASE pager_data TO admin; + +-- === Devices === +CREATE TABLE Devices ( + id SERIAL PRIMARY KEY, + created_at TIMESTAMPTZ DEFAULT NOW(), + + euid VARCHAR(16) NOT NULL UNIQUE, -- LoRaWAN Extended Unique ID (hex, 8 bytes) + name VARCHAR(64) NOT NULL, -- ! Not Unique + + fw_version VARCHAR(24) NOT NULL, + + charge NUMERIC(5,2) CHECK (charge >= 0 AND charge <= 100), -- battery in % + last_online TIMESTAMPTZ, -- ! NULL + + -- Location fields: + latitude DOUBLE PRECISION CHECK (latitude >= -90 AND latitude <= 90), + longitude DOUBLE PRECISION CHECK (longitude >= -180 AND longitude <= 180), + altitude DOUBLE PRECISION +); + +CREATE TABLE Messages ( + id SERIAL PRIMARY KEY, + created_at TIMESTAMPTZ DEFAULT NOW(), + + sender_id INT NOT NULL REFERENCES Devices(id) ON DELETE SET NULL, + receiver_id INT REFERENCES Devices(id) ON DELETE SET NULL, -- ! NULL + payload VARCHAR(256) +); + +CREATE TABLE Statuses ( + id SERIAL PRIMARY KEY, + created_at TIMESTAMPTZ DEFAULT NOW(), + + device_id INT NOT NULL REFERENCES Devices(id) ON DELETE CASCADE, + payload VARCHAR(256) +); + +-- === Roles === +CREATE TABLE Roles ( + id SERIAL PRIMARY KEY, + created_at TIMESTAMPTZ DEFAULT NOW(), + + name VARCHAR(64) NOT NULL UNIQUE, + description VARCHAR(128) NOT NULL DEFAULT 'Role description' +); + +INSERT INTO Roles (name, description) VALUES ('Admin', 'Should do everything.'); -- Admin role + +CREATE TABLE Permissions ( + id SERIAL PRIMARY KEY, + created_at TIMESTAMPTZ DEFAULT NOW(), + + name VARCHAR(64) NOT NULL UNIQUE, + description VARCHAR(128) NOT NULL DEFAULT 'Permission description' +); + +INSERT INTO Permissions (name, description) VALUES ('Everything', 'Can do everything.'); -- Admin permission + +-- Join table for Roles & Permissions +CREATE TABLE RolesPermissions ( + role_id INT NOT NULL REFERENCES Roles(id), + permission_id INT NOT NULL REFERENCES Permissions(id) +); + +INSERT INTO RolesPermissions (role_id, permission_id) VALUES (1, 1); -- Tie together role & permission + +-- === Users === +CREATE TABLE Users ( + id SERIAL PRIMARY KEY, + created_at TIMESTAMPTZ DEFAULT NOW(), + + name VARCHAR(64) UNIQUE NOT NULL, + password VARCHAR(64) NOT NULL, + role_id INT DEFAULT 2 REFERENCES Roles(id) ON DELETE SET DEFAULT, -- default low privilleges + last_online TIMESTAMPTZ -- ! NULL +); + +INSERT INTO Users (name, password, role_id) VALUES ('Admin', 'admin', 1); -- Admin user + +CREATE TABLE NFC_Cards ( + id SERIAL PRIMARY KEY, + created_at TIMESTAMPTZ DEFAULT NOW(), + + user_id INT REFERENCES Users(id) ON DELETE SET NULL, -- ! NULL + device_id INT REFERENCES Devices(id) ON DELETE SET NULL, -- ! NULL + uid VARCHAR(7) NOT NULL UNIQUE, + CONSTRAINT uid_length CHECK (length(uid) = 4 OR length(uid) = 7) -- Check for valid UUID +); + +-- === Logs === +CREATE TABLE Logs ( + id SERIAL PRIMARY KEY, + created_at TIMESTAMPTZ DEFAULT NOW(), + + db_user TEXT DEFAULT current_user +); + +CREATE TABLE LogsUsers ( + log_id INT REFERENCES Logs(id) ON DELETE CASCADE, + user_id INT REFERENCES Users(id) ON DELETE CASCADE +); + +CREATE TABLE LogsDevices ( + log_id INT REFERENCES Logs(id) ON DELETE CASCADE, + device_id INT REFERENCES Devices(id) ON DELETE CASCADE +); + +CREATE TABLE Changes ( + id SERIAL PRIMARY KEY, + log_id INT NOT NULL REFERENCES Logs(id) ON DELETE CASCADE, + table_name TEXT NOT NULL, + operation TEXT NOT NULL, + old_value hstore, -- ! NULL + new_value hstore, -- ! NULL + CONSTRAINT change_diff CHECK (old_value != new_value) +); diff --git a/AppServer/postgresql.conf b/AppServer/postgresql.conf new file mode 100755 index 0000000..7e67009 --- /dev/null +++ b/AppServer/postgresql.conf @@ -0,0 +1,3 @@ +log_connections = on +log_destination = 'stderr' +listen_addresses='*' \ No newline at end of file diff --git a/AppServer/src/api.go b/AppServer/src/api.go new file mode 100644 index 0000000..72b14fc --- /dev/null +++ b/AppServer/src/api.go @@ -0,0 +1,180 @@ +/* +Implements gRPC API server. + +Author: Olek +*/ +package main + +import ( + "context" + "errors" + + api_common "server/app_comm/api/common" + api_device "server/app_comm/api/device" + api_user "server/app_comm/api/user" + + "github.com/jackc/pgx/v5" +) + +var ( + ErrNoIndex error = errors.New("no valid index provided for request") +) + +// === Device Service === +type DeviceServiceServer struct { + api_device.UnimplementedDeviceServiceServer + App *AppData +} + +func (s *DeviceServiceServer) GetFull(ctx context.Context, index *api_common.StrIndex) (*api_device.DeviceAllInfo, error) { + info := api_device.DeviceAllInfo{} + var err error + var row pgx.Row + var deviceId int32 + + switch index.Id.(type) { + case *api_common.StrIndex_Num: // Indexing by DB ID + deviceId = index.GetNum() + + row = s.App.DBPool.QueryRow(ctx, ` + SELECT euid, name, fw_version, charge, last_online, latitude, longitude, altitude + FROM Devices WHERE id = $1;`, + deviceId, + ) + err = row.Scan( + &info.Euid, + &info.Name, + &info.FwVersion, + &info.Charge, + &info.LastOnline, + &info.Latitude, + &info.Longitude, + &info.Altitude, + ) + case *api_common.StrIndex_Name: // Indexing by EUID + euid := index.GetName() + info.Euid = euid + + row = s.App.DBPool.QueryRow(ctx, ` + SELECT name, fw_version, charge, last_online, latitude, longitude, altitude, id + FROM Devices WHERE euid = $1;`, + euid, + ) + err = row.Scan( + &info.Name, + &info.FwVersion, + &info.Charge, + &info.LastOnline, + &info.Latitude, + &info.Longitude, + &info.Altitude, + &deviceId, + ) + default: // Zeroed out + return nil, ErrNoIndex + } + + if err != nil { + return &info, err + } + + // Fetch latest Status + row = s.App.DBPool.QueryRow(ctx, ` + SELECT internal_status, native_status + FROM Statuses + WHERE device_id = $1 + ORDER BY created_at DESC LIMIT 1;`, deviceId, + ) + var int_status int16 + var nat_status string + err = row.Scan(&int_status, &nat_status) + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + return &info, err + } + info.InternalStatus = int32(int_status) + info.NativeStatus = nat_status + + // Fetch paired cards + row = s.App.DBPool.QueryRow(ctx, ` + SELECT id + FROM NFC_Cards + WHERE device_id = $1 + ORDER BY created_at DESC;`, deviceId, + ) + var card_ids []int32 + err = row.Scan(&card_ids) + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + return &info, err + } + info.CardIds = card_ids + + return &info, nil +} + +func (s *DeviceServiceServer) GetInfo(ctx context.Context, index *api_common.StrIndex) (*api_device.DeviceBaseInfo, error) { + var err error + var row pgx.Row + var deviceId int32 + info := api_device.DeviceBaseInfo{} + + switch index.Id.(type) { + case *api_common.StrIndex_Num: + row = s.App.DBPool.QueryRow(ctx, "SELECT (id, name, euid, last_online) FROM Devices WHERE id = $1;", index.GetNum()) + err = row.Scan(&deviceId, &info.Name, &info.Euid, &info.LastOnline) + case *api_common.StrIndex_Name: + euid := index.GetName() + info.Euid = euid + + row = s.App.DBPool.QueryRow(ctx, "SELECT (id, name, last_online) FROM Devices WHERE euid = $1;", euid) + err = row.Scan(&deviceId, &info.Name, &info.LastOnline) + default: + return nil, ErrNoIndex + } + + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + return &info, err + } + + row = s.App.DBPool.QueryRow(ctx, ` + SELECT internal_status + FROM Statuses + WHERE device_id = $1 + ORDER BY created_at DESC LIMIT 1;`, deviceId, + ) + var status int16 + err = row.Scan(&status) + if err != nil && !errors.Is(err, pgx.ErrNoRows) { + return &info, err + } + + info.InternalStatus = int32(status) + + return &info, err +} + +// === User Service === +type UserServiceServer struct { + api_user.UnimplementedUserServiceServer + App *AppData +} + +func (s *UserServiceServer) GetPassword(ctx context.Context, index *api_common.StrIndex) (*api_user.Password, error) { + var err error + var row pgx.Row + info := api_user.Password{} + + switch index.Id.(type) { + case *api_common.StrIndex_Num: + row = s.App.DBPool.QueryRow(ctx, "SELECT password FROM Users WHERE id = $1;", index.GetNum()) + err = row.Scan(&info.Password) + case *api_common.StrIndex_Name: + row = s.App.DBPool.QueryRow(ctx, "SELECT password FROM Users WHERE name = $1;", index.GetName()) + err = row.Scan(&info.Password) + default: + return nil, ErrNoIndex + } + + return &info, err +} + +//TODO: finish diff --git a/AppServer/src/app_comm/api/change/change.pb.go b/AppServer/src/app_comm/api/change/change.pb.go new file mode 100644 index 0000000..2eaf33e --- /dev/null +++ b/AppServer/src/app_comm/api/change/change.pb.go @@ -0,0 +1,278 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: change.proto + +package api_change + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ChageAllInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OldValue string `protobuf:"bytes,1,opt,name=old_value,json=oldValue,proto3" json:"old_value,omitempty"` + NewValue string `protobuf:"bytes,2,opt,name=new_value,json=newValue,proto3" json:"new_value,omitempty"` + TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` + Operation string `protobuf:"bytes,4,opt,name=operation,proto3" json:"operation,omitempty"` + LogId int32 `protobuf:"varint,5,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` +} + +func (x *ChageAllInfo) Reset() { + *x = ChageAllInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_change_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChageAllInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChageAllInfo) ProtoMessage() {} + +func (x *ChageAllInfo) ProtoReflect() protoreflect.Message { + mi := &file_change_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChageAllInfo.ProtoReflect.Descriptor instead. +func (*ChageAllInfo) Descriptor() ([]byte, []int) { + return file_change_proto_rawDescGZIP(), []int{0} +} + +func (x *ChageAllInfo) GetOldValue() string { + if x != nil { + return x.OldValue + } + return "" +} + +func (x *ChageAllInfo) GetNewValue() string { + if x != nil { + return x.NewValue + } + return "" +} + +func (x *ChageAllInfo) GetTableName() string { + if x != nil { + return x.TableName + } + return "" +} + +func (x *ChageAllInfo) GetOperation() string { + if x != nil { + return x.Operation + } + return "" +} + +func (x *ChageAllInfo) GetLogId() int32 { + if x != nil { + return x.LogId + } + return 0 +} + +type Values struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OldValue string `protobuf:"bytes,1,opt,name=old_value,json=oldValue,proto3" json:"old_value,omitempty"` + NewValue string `protobuf:"bytes,2,opt,name=new_value,json=newValue,proto3" json:"new_value,omitempty"` +} + +func (x *Values) Reset() { + *x = Values{} + if protoimpl.UnsafeEnabled { + mi := &file_change_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Values) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Values) ProtoMessage() {} + +func (x *Values) ProtoReflect() protoreflect.Message { + mi := &file_change_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Values.ProtoReflect.Descriptor instead. +func (*Values) Descriptor() ([]byte, []int) { + return file_change_proto_rawDescGZIP(), []int{1} +} + +func (x *Values) GetOldValue() string { + if x != nil { + return x.OldValue + } + return "" +} + +func (x *Values) GetNewValue() string { + if x != nil { + return x.NewValue + } + return "" +} + +var File_change_proto protoreflect.FileDescriptor + +var file_change_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x1a, + 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x01, + 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x67, 0x65, 0x41, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, + 0x0a, 0x09, 0x6f, 0x6c, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6f, 0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, + 0x65, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x49, 0x64, 0x22, 0x42, 0x0a, 0x06, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x6c, 0x64, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x6c, 0x64, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x32, 0xc6, 0x01, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x16, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x17, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3f, + 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x1a, 0x1d, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x67, 0x65, 0x41, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, + 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x27, 0x5a, 0x25, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_change_proto_rawDescOnce sync.Once + file_change_proto_rawDescData = file_change_proto_rawDesc +) + +func file_change_proto_rawDescGZIP() []byte { + file_change_proto_rawDescOnce.Do(func() { + file_change_proto_rawDescData = protoimpl.X.CompressGZIP(file_change_proto_rawDescData) + }) + return file_change_proto_rawDescData +} + +var file_change_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_change_proto_goTypes = []interface{}{ + (*ChageAllInfo)(nil), // 0: pagerino.change.ChageAllInfo + (*Values)(nil), // 1: pagerino.change.Values + (*common.Index)(nil), // 2: pagerino.common.Index + (*common.Meta)(nil), // 3: pagerino.common.Meta +} +var file_change_proto_depIdxs = []int32{ + 2, // 0: pagerino.change.ChangeService.GetDiff:input_type -> pagerino.common.Index + 2, // 1: pagerino.change.ChangeService.GetAll:input_type -> pagerino.common.Index + 2, // 2: pagerino.change.ChangeService.GetMeta:input_type -> pagerino.common.Index + 1, // 3: pagerino.change.ChangeService.GetDiff:output_type -> pagerino.change.Values + 0, // 4: pagerino.change.ChangeService.GetAll:output_type -> pagerino.change.ChageAllInfo + 3, // 5: pagerino.change.ChangeService.GetMeta:output_type -> pagerino.common.Meta + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_change_proto_init() } +func file_change_proto_init() { + if File_change_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_change_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChageAllInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_change_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Values); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_change_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_change_proto_goTypes, + DependencyIndexes: file_change_proto_depIdxs, + MessageInfos: file_change_proto_msgTypes, + }.Build() + File_change_proto = out.File + file_change_proto_rawDesc = nil + file_change_proto_goTypes = nil + file_change_proto_depIdxs = nil +} diff --git a/AppServer/src/app_comm/api/change/change_grpc.pb.go b/AppServer/src/app_comm/api/change/change_grpc.pb.go new file mode 100644 index 0000000..9f9edcd --- /dev/null +++ b/AppServer/src/app_comm/api/change/change_grpc.pb.go @@ -0,0 +1,178 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_change + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ChangeServiceClient is the client API for ChangeService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ChangeServiceClient interface { + // === DB information + GetDiff(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*Values, error) + GetAll(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*ChageAllInfo, error) + // Common + GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) +} + +type changeServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewChangeServiceClient(cc grpc.ClientConnInterface) ChangeServiceClient { + return &changeServiceClient{cc} +} + +func (c *changeServiceClient) GetDiff(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*Values, error) { + out := new(Values) + err := c.cc.Invoke(ctx, "/pagerino.change.ChangeService/GetDiff", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *changeServiceClient) GetAll(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*ChageAllInfo, error) { + out := new(ChageAllInfo) + err := c.cc.Invoke(ctx, "/pagerino.change.ChangeService/GetAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *changeServiceClient) GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.change.ChangeService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ChangeServiceServer is the server API for ChangeService service. +// All implementations must embed UnimplementedChangeServiceServer +// for forward compatibility +type ChangeServiceServer interface { + // === DB information + GetDiff(context.Context, *common.Index) (*Values, error) + GetAll(context.Context, *common.Index) (*ChageAllInfo, error) + // Common + GetMeta(context.Context, *common.Index) (*common.Meta, error) + mustEmbedUnimplementedChangeServiceServer() +} + +// UnimplementedChangeServiceServer must be embedded to have forward compatible implementations. +type UnimplementedChangeServiceServer struct { +} + +func (UnimplementedChangeServiceServer) GetDiff(context.Context, *common.Index) (*Values, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDiff not implemented") +} +func (UnimplementedChangeServiceServer) GetAll(context.Context, *common.Index) (*ChageAllInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented") +} +func (UnimplementedChangeServiceServer) GetMeta(context.Context, *common.Index) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedChangeServiceServer) mustEmbedUnimplementedChangeServiceServer() {} + +// UnsafeChangeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ChangeServiceServer will +// result in compilation errors. +type UnsafeChangeServiceServer interface { + mustEmbedUnimplementedChangeServiceServer() +} + +func RegisterChangeServiceServer(s grpc.ServiceRegistrar, srv ChangeServiceServer) { + s.RegisterService(&ChangeService_ServiceDesc, srv) +} + +func _ChangeService_GetDiff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChangeServiceServer).GetDiff(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.change.ChangeService/GetDiff", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChangeServiceServer).GetDiff(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChangeService_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChangeServiceServer).GetAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.change.ChangeService/GetAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChangeServiceServer).GetAll(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChangeService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChangeServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.change.ChangeService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChangeServiceServer).GetMeta(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +// ChangeService_ServiceDesc is the grpc.ServiceDesc for ChangeService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ChangeService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.change.ChangeService", + HandlerType: (*ChangeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetDiff", + Handler: _ChangeService_GetDiff_Handler, + }, + { + MethodName: "GetAll", + Handler: _ChangeService_GetAll_Handler, + }, + { + MethodName: "GetMeta", + Handler: _ChangeService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "change.proto", +} diff --git a/AppServer/src/app_comm/api/common/common.pb.go b/AppServer/src/app_comm/api/common/common.pb.go new file mode 100644 index 0000000..b22546d --- /dev/null +++ b/AppServer/src/app_comm/api/common/common.pb.go @@ -0,0 +1,588 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: common.proto + +package api_common + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// For custom logic responses +type RequestCode int32 + +const ( + RequestCode_UNKNOWN RequestCode = 0 + RequestCode_OK RequestCode = 1 + RequestCode_UNAUTHORIZED RequestCode = 2 + RequestCode_NO_DATA RequestCode = 3 + RequestCode_INTERNAL_ERROR RequestCode = 4 +) + +// Enum value maps for RequestCode. +var ( + RequestCode_name = map[int32]string{ + 0: "UNKNOWN", + 1: "OK", + 2: "UNAUTHORIZED", + 3: "NO_DATA", + 4: "INTERNAL_ERROR", + } + RequestCode_value = map[string]int32{ + "UNKNOWN": 0, + "OK": 1, + "UNAUTHORIZED": 2, + "NO_DATA": 3, + "INTERNAL_ERROR": 4, + } +) + +func (x RequestCode) Enum() *RequestCode { + p := new(RequestCode) + *p = x + return p +} + +func (x RequestCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RequestCode) Descriptor() protoreflect.EnumDescriptor { + return file_common_proto_enumTypes[0].Descriptor() +} + +func (RequestCode) Type() protoreflect.EnumType { + return &file_common_proto_enumTypes[0] +} + +func (x RequestCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RequestCode.Descriptor instead. +func (RequestCode) EnumDescriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{0} +} + +// === DB indexing +type StrIndex struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Id: + // *StrIndex_Num + // *StrIndex_Name + Id isStrIndex_Id `protobuf_oneof:"id"` +} + +func (x *StrIndex) Reset() { + *x = StrIndex{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StrIndex) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StrIndex) ProtoMessage() {} + +func (x *StrIndex) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StrIndex.ProtoReflect.Descriptor instead. +func (*StrIndex) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{0} +} + +func (m *StrIndex) GetId() isStrIndex_Id { + if m != nil { + return m.Id + } + return nil +} + +func (x *StrIndex) GetNum() int32 { + if x, ok := x.GetId().(*StrIndex_Num); ok { + return x.Num + } + return 0 +} + +func (x *StrIndex) GetName() string { + if x, ok := x.GetId().(*StrIndex_Name); ok { + return x.Name + } + return "" +} + +type isStrIndex_Id interface { + isStrIndex_Id() +} + +type StrIndex_Num struct { + Num int32 `protobuf:"varint,1,opt,name=num,proto3,oneof"` // Database ID +} + +type StrIndex_Name struct { + Name string `protobuf:"bytes,2,opt,name=name,proto3,oneof"` // for external fields: username, euid, name... +} + +func (*StrIndex_Num) isStrIndex_Id() {} + +func (*StrIndex_Name) isStrIndex_Id() {} + +type Index struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Num int32 `protobuf:"varint,1,opt,name=num,proto3" json:"num,omitempty"` // Database ID +} + +func (x *Index) Reset() { + *x = Index{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Index) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Index) ProtoMessage() {} + +func (x *Index) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Index.ProtoReflect.Descriptor instead. +func (*Index) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{1} +} + +func (x *Index) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +// === DB information +type Meta struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *Meta) Reset() { + *x = Meta{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Meta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Meta) ProtoMessage() {} + +func (x *Meta) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Meta.ProtoReflect.Descriptor instead. +func (*Meta) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{2} +} + +func (x *Meta) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Meta) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type References struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` // 32 IDs per page from most recent + RefId []int32 `protobuf:"varint,2,rep,packed,name=ref_id,json=refId,proto3" json:"ref_id,omitempty"` +} + +func (x *References) Reset() { + *x = References{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *References) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*References) ProtoMessage() {} + +func (x *References) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use References.ProtoReflect.Descriptor instead. +func (*References) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{3} +} + +func (x *References) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *References) GetRefId() []int32 { + if x != nil { + return x.RefId + } + return nil +} + +type Reference struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RefId int32 `protobuf:"varint,1,opt,name=ref_id,json=refId,proto3" json:"ref_id,omitempty"` +} + +func (x *Reference) Reset() { + *x = Reference{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Reference) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reference) ProtoMessage() {} + +func (x *Reference) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Reference.ProtoReflect.Descriptor instead. +func (*Reference) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{4} +} + +func (x *Reference) GetRefId() int32 { + if x != nil { + return x.RefId + } + return 0 +} + +type Activity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LastOnline *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=last_online,json=lastOnline,proto3" json:"last_online,omitempty"` +} + +func (x *Activity) Reset() { + *x = Activity{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Activity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Activity) ProtoMessage() {} + +func (x *Activity) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Activity.ProtoReflect.Descriptor instead. +func (*Activity) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{5} +} + +func (x *Activity) GetLastOnline() *timestamppb.Timestamp { + if x != nil { + return x.LastOnline + } + return nil +} + +var File_common_proto protoreflect.FileDescriptor + +var file_common_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x3a, 0x0a, 0x08, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x03, + 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x03, 0x6e, 0x75, 0x6d, + 0x12, 0x14, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x22, 0x19, 0x0a, 0x05, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, 0x51, 0x0a, 0x04, 0x4d, 0x65, 0x74, 0x61, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x37, 0x0a, 0x0a, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x15, 0x0a, 0x06, + 0x72, 0x65, 0x66, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x72, 0x65, + 0x66, 0x49, 0x64, 0x22, 0x22, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x15, 0x0a, 0x06, 0x72, 0x65, 0x66, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x72, 0x65, 0x66, 0x49, 0x64, 0x22, 0x47, 0x0a, 0x08, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x69, + 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, + 0x2a, 0x55, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, + 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, + 0x49, 0x5a, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x4f, 0x5f, 0x44, 0x41, 0x54, + 0x41, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x42, 0x27, 0x5a, 0x25, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_proto_rawDescOnce sync.Once + file_common_proto_rawDescData = file_common_proto_rawDesc +) + +func file_common_proto_rawDescGZIP() []byte { + file_common_proto_rawDescOnce.Do(func() { + file_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_proto_rawDescData) + }) + return file_common_proto_rawDescData +} + +var file_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_common_proto_goTypes = []interface{}{ + (RequestCode)(0), // 0: pagerino.common.RequestCode + (*StrIndex)(nil), // 1: pagerino.common.StrIndex + (*Index)(nil), // 2: pagerino.common.Index + (*Meta)(nil), // 3: pagerino.common.Meta + (*References)(nil), // 4: pagerino.common.References + (*Reference)(nil), // 5: pagerino.common.Reference + (*Activity)(nil), // 6: pagerino.common.Activity + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp +} +var file_common_proto_depIdxs = []int32{ + 7, // 0: pagerino.common.Meta.created_at:type_name -> google.protobuf.Timestamp + 7, // 1: pagerino.common.Activity.last_online:type_name -> google.protobuf.Timestamp + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_common_proto_init() } +func file_common_proto_init() { + if File_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StrIndex); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Index); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Meta); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*References); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Reference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Activity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_common_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*StrIndex_Num)(nil), + (*StrIndex_Name)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_proto_rawDesc, + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_proto_goTypes, + DependencyIndexes: file_common_proto_depIdxs, + EnumInfos: file_common_proto_enumTypes, + MessageInfos: file_common_proto_msgTypes, + }.Build() + File_common_proto = out.File + file_common_proto_rawDesc = nil + file_common_proto_goTypes = nil + file_common_proto_depIdxs = nil +} diff --git a/AppServer/src/app_comm/api/device/device.pb.go b/AppServer/src/app_comm/api/device/device.pb.go new file mode 100644 index 0000000..b04eca9 --- /dev/null +++ b/AppServer/src/app_comm/api/device/device.pb.go @@ -0,0 +1,566 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: device.proto + +package api_device + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Charge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Charge float32 `protobuf:"fixed32,1,opt,name=charge,proto3" json:"charge,omitempty"` +} + +func (x *Charge) Reset() { + *x = Charge{} + if protoimpl.UnsafeEnabled { + mi := &file_device_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Charge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Charge) ProtoMessage() {} + +func (x *Charge) ProtoReflect() protoreflect.Message { + mi := &file_device_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Charge.ProtoReflect.Descriptor instead. +func (*Charge) Descriptor() ([]byte, []int) { + return file_device_proto_rawDescGZIP(), []int{0} +} + +func (x *Charge) GetCharge() float32 { + if x != nil { + return x.Charge + } + return 0 +} + +type Location struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Latitude float64 `protobuf:"fixed64,1,opt,name=latitude,proto3" json:"latitude,omitempty"` + Longitude float64 `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"` + Altitude float32 `protobuf:"fixed32,3,opt,name=altitude,proto3" json:"altitude,omitempty"` +} + +func (x *Location) Reset() { + *x = Location{} + if protoimpl.UnsafeEnabled { + mi := &file_device_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Location) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Location) ProtoMessage() {} + +func (x *Location) ProtoReflect() protoreflect.Message { + mi := &file_device_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Location.ProtoReflect.Descriptor instead. +func (*Location) Descriptor() ([]byte, []int) { + return file_device_proto_rawDescGZIP(), []int{1} +} + +func (x *Location) GetLatitude() float64 { + if x != nil { + return x.Latitude + } + return 0 +} + +func (x *Location) GetLongitude() float64 { + if x != nil { + return x.Longitude + } + return 0 +} + +func (x *Location) GetAltitude() float32 { + if x != nil { + return x.Altitude + } + return 0 +} + +type DeviceBaseInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Euid string `protobuf:"bytes,2,opt,name=euid,proto3" json:"euid,omitempty"` + InternalStatus int32 `protobuf:"zigzag32,3,opt,name=internal_status,json=internalStatus,proto3" json:"internal_status,omitempty"` + LastOnline *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_online,json=lastOnline,proto3" json:"last_online,omitempty"` +} + +func (x *DeviceBaseInfo) Reset() { + *x = DeviceBaseInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_device_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeviceBaseInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeviceBaseInfo) ProtoMessage() {} + +func (x *DeviceBaseInfo) ProtoReflect() protoreflect.Message { + mi := &file_device_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeviceBaseInfo.ProtoReflect.Descriptor instead. +func (*DeviceBaseInfo) Descriptor() ([]byte, []int) { + return file_device_proto_rawDescGZIP(), []int{2} +} + +func (x *DeviceBaseInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DeviceBaseInfo) GetEuid() string { + if x != nil { + return x.Euid + } + return "" +} + +func (x *DeviceBaseInfo) GetInternalStatus() int32 { + if x != nil { + return x.InternalStatus + } + return 0 +} + +func (x *DeviceBaseInfo) GetLastOnline() *timestamppb.Timestamp { + if x != nil { + return x.LastOnline + } + return nil +} + +type DeviceAllInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Euid string `protobuf:"bytes,2,opt,name=euid,proto3" json:"euid,omitempty"` + InternalStatus int32 `protobuf:"zigzag32,3,opt,name=internal_status,json=internalStatus,proto3" json:"internal_status,omitempty"` + NativeStatus string `protobuf:"bytes,4,opt,name=native_status,json=nativeStatus,proto3" json:"native_status,omitempty"` + LastOnline *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_online,json=lastOnline,proto3" json:"last_online,omitempty"` + FwVersion string `protobuf:"bytes,6,opt,name=fw_version,json=fwVersion,proto3" json:"fw_version,omitempty"` + CardIds []int32 `protobuf:"varint,7,rep,packed,name=card_ids,json=cardIds,proto3" json:"card_ids,omitempty"` + Charge float32 `protobuf:"fixed32,8,opt,name=charge,proto3" json:"charge,omitempty"` + Latitude float64 `protobuf:"fixed64,9,opt,name=latitude,proto3" json:"latitude,omitempty"` + Longitude float64 `protobuf:"fixed64,10,opt,name=longitude,proto3" json:"longitude,omitempty"` + Altitude float32 `protobuf:"fixed32,11,opt,name=altitude,proto3" json:"altitude,omitempty"` +} + +func (x *DeviceAllInfo) Reset() { + *x = DeviceAllInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_device_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeviceAllInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeviceAllInfo) ProtoMessage() {} + +func (x *DeviceAllInfo) ProtoReflect() protoreflect.Message { + mi := &file_device_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeviceAllInfo.ProtoReflect.Descriptor instead. +func (*DeviceAllInfo) Descriptor() ([]byte, []int) { + return file_device_proto_rawDescGZIP(), []int{3} +} + +func (x *DeviceAllInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DeviceAllInfo) GetEuid() string { + if x != nil { + return x.Euid + } + return "" +} + +func (x *DeviceAllInfo) GetInternalStatus() int32 { + if x != nil { + return x.InternalStatus + } + return 0 +} + +func (x *DeviceAllInfo) GetNativeStatus() string { + if x != nil { + return x.NativeStatus + } + return "" +} + +func (x *DeviceAllInfo) GetLastOnline() *timestamppb.Timestamp { + if x != nil { + return x.LastOnline + } + return nil +} + +func (x *DeviceAllInfo) GetFwVersion() string { + if x != nil { + return x.FwVersion + } + return "" +} + +func (x *DeviceAllInfo) GetCardIds() []int32 { + if x != nil { + return x.CardIds + } + return nil +} + +func (x *DeviceAllInfo) GetCharge() float32 { + if x != nil { + return x.Charge + } + return 0 +} + +func (x *DeviceAllInfo) GetLatitude() float64 { + if x != nil { + return x.Latitude + } + return 0 +} + +func (x *DeviceAllInfo) GetLongitude() float64 { + if x != nil { + return x.Longitude + } + return 0 +} + +func (x *DeviceAllInfo) GetAltitude() float32 { + if x != nil { + return x.Altitude + } + return 0 +} + +var File_device_proto protoreflect.FileDescriptor + +var file_device_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x20, + 0x0a, 0x06, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, + 0x22, 0x60, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, + 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, + 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, + 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x6f, 0x6e, + 0x67, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, + 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, + 0x64, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x42, 0x61, 0x73, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x75, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x75, 0x69, 0x64, 0x12, 0x27, 0x0a, + 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6f, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x6e, 0x6c, + 0x69, 0x6e, 0x65, 0x22, 0xea, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x6c, + 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x75, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x75, 0x69, 0x64, 0x12, 0x27, 0x0a, + 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, + 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x77, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x77, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, + 0x69, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, + 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x02, 0x52, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, + 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6c, 0x61, + 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, + 0x75, 0x64, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, + 0x74, 0x75, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, + 0x32, 0x95, 0x06, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x19, 0x2e, 0x70, + 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, + 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1e, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, + 0x6e, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x41, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x45, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1f, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x42, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3f, + 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x17, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, + 0x43, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4e, 0x66, 0x63, 0x43, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x46, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x74, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, + 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x73, 0x12, 0x4f, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x19, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x1a, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x07, 0x47, + 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x27, 0x5a, 0x25, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_device_proto_rawDescOnce sync.Once + file_device_proto_rawDescData = file_device_proto_rawDesc +) + +func file_device_proto_rawDescGZIP() []byte { + file_device_proto_rawDescOnce.Do(func() { + file_device_proto_rawDescData = protoimpl.X.CompressGZIP(file_device_proto_rawDescData) + }) + return file_device_proto_rawDescData +} + +var file_device_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_device_proto_goTypes = []interface{}{ + (*Charge)(nil), // 0: pagerino.device.Charge + (*Location)(nil), // 1: pagerino.device.Location + (*DeviceBaseInfo)(nil), // 2: pagerino.device.DeviceBaseInfo + (*DeviceAllInfo)(nil), // 3: pagerino.device.DeviceAllInfo + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*common.StrIndex)(nil), // 5: pagerino.common.StrIndex + (*common.References)(nil), // 6: pagerino.common.References + (*common.Activity)(nil), // 7: pagerino.common.Activity + (*common.Meta)(nil), // 8: pagerino.common.Meta +} +var file_device_proto_depIdxs = []int32{ + 4, // 0: pagerino.device.DeviceBaseInfo.last_online:type_name -> google.protobuf.Timestamp + 4, // 1: pagerino.device.DeviceAllInfo.last_online:type_name -> google.protobuf.Timestamp + 5, // 2: pagerino.device.DeviceService.GetAll:input_type -> pagerino.common.StrIndex + 5, // 3: pagerino.device.DeviceService.GetInfo:input_type -> pagerino.common.StrIndex + 5, // 4: pagerino.device.DeviceService.GetCharge:input_type -> pagerino.common.StrIndex + 5, // 5: pagerino.device.DeviceService.GetLocation:input_type -> pagerino.common.StrIndex + 5, // 6: pagerino.device.DeviceService.GetNfcCardIds:input_type -> pagerino.common.StrIndex + 5, // 7: pagerino.device.DeviceService.GetStatusIds:input_type -> pagerino.common.StrIndex + 5, // 8: pagerino.device.DeviceService.GetSentMessageIds:input_type -> pagerino.common.StrIndex + 5, // 9: pagerino.device.DeviceService.GetReceivedMessageIds:input_type -> pagerino.common.StrIndex + 5, // 10: pagerino.device.DeviceService.GetLogs:input_type -> pagerino.common.StrIndex + 5, // 11: pagerino.device.DeviceService.GetActivity:input_type -> pagerino.common.StrIndex + 5, // 12: pagerino.device.DeviceService.GetMeta:input_type -> pagerino.common.StrIndex + 3, // 13: pagerino.device.DeviceService.GetAll:output_type -> pagerino.device.DeviceAllInfo + 2, // 14: pagerino.device.DeviceService.GetInfo:output_type -> pagerino.device.DeviceBaseInfo + 0, // 15: pagerino.device.DeviceService.GetCharge:output_type -> pagerino.device.Charge + 1, // 16: pagerino.device.DeviceService.GetLocation:output_type -> pagerino.device.Location + 6, // 17: pagerino.device.DeviceService.GetNfcCardIds:output_type -> pagerino.common.References + 6, // 18: pagerino.device.DeviceService.GetStatusIds:output_type -> pagerino.common.References + 6, // 19: pagerino.device.DeviceService.GetSentMessageIds:output_type -> pagerino.common.References + 6, // 20: pagerino.device.DeviceService.GetReceivedMessageIds:output_type -> pagerino.common.References + 6, // 21: pagerino.device.DeviceService.GetLogs:output_type -> pagerino.common.References + 7, // 22: pagerino.device.DeviceService.GetActivity:output_type -> pagerino.common.Activity + 8, // 23: pagerino.device.DeviceService.GetMeta:output_type -> pagerino.common.Meta + 13, // [13:24] is the sub-list for method output_type + 2, // [2:13] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_device_proto_init() } +func file_device_proto_init() { + if File_device_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_device_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Charge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_device_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Location); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_device_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeviceBaseInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_device_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeviceAllInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_device_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_device_proto_goTypes, + DependencyIndexes: file_device_proto_depIdxs, + MessageInfos: file_device_proto_msgTypes, + }.Build() + File_device_proto = out.File + file_device_proto_rawDesc = nil + file_device_proto_goTypes = nil + file_device_proto_depIdxs = nil +} diff --git a/AppServer/src/app_comm/api/device/device_grpc.pb.go b/AppServer/src/app_comm/api/device/device_grpc.pb.go new file mode 100644 index 0000000..3467714 --- /dev/null +++ b/AppServer/src/app_comm/api/device/device_grpc.pb.go @@ -0,0 +1,468 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_device + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// DeviceServiceClient is the client API for DeviceService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DeviceServiceClient interface { + // === DB information + GetAll(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*DeviceAllInfo, error) + GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*DeviceBaseInfo, error) + GetCharge(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Charge, error) + GetLocation(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Location, error) + // References + GetNfcCardIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetStatusIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetSentMessageIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetReceivedMessageIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetLogs(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + // Common + GetActivity(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Activity, error) + GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) +} + +type deviceServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDeviceServiceClient(cc grpc.ClientConnInterface) DeviceServiceClient { + return &deviceServiceClient{cc} +} + +func (c *deviceServiceClient) GetAll(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*DeviceAllInfo, error) { + out := new(DeviceAllInfo) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*DeviceBaseInfo, error) { + out := new(DeviceBaseInfo) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetCharge(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Charge, error) { + out := new(Charge) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetCharge", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetLocation(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Location, error) { + out := new(Location) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetLocation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetNfcCardIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetNfcCardIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetStatusIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetStatusIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetSentMessageIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetSentMessageIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetReceivedMessageIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetReceivedMessageIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetLogs(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetLogs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetActivity(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Activity, error) { + out := new(common.Activity) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetActivity", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DeviceServiceServer is the server API for DeviceService service. +// All implementations must embed UnimplementedDeviceServiceServer +// for forward compatibility +type DeviceServiceServer interface { + // === DB information + GetAll(context.Context, *common.StrIndex) (*DeviceAllInfo, error) + GetInfo(context.Context, *common.StrIndex) (*DeviceBaseInfo, error) + GetCharge(context.Context, *common.StrIndex) (*Charge, error) + GetLocation(context.Context, *common.StrIndex) (*Location, error) + // References + GetNfcCardIds(context.Context, *common.StrIndex) (*common.References, error) + GetStatusIds(context.Context, *common.StrIndex) (*common.References, error) + GetSentMessageIds(context.Context, *common.StrIndex) (*common.References, error) + GetReceivedMessageIds(context.Context, *common.StrIndex) (*common.References, error) + GetLogs(context.Context, *common.StrIndex) (*common.References, error) + // Common + GetActivity(context.Context, *common.StrIndex) (*common.Activity, error) + GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) + mustEmbedUnimplementedDeviceServiceServer() +} + +// UnimplementedDeviceServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDeviceServiceServer struct { +} + +func (UnimplementedDeviceServiceServer) GetAll(context.Context, *common.StrIndex) (*DeviceAllInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented") +} +func (UnimplementedDeviceServiceServer) GetInfo(context.Context, *common.StrIndex) (*DeviceBaseInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedDeviceServiceServer) GetCharge(context.Context, *common.StrIndex) (*Charge, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCharge not implemented") +} +func (UnimplementedDeviceServiceServer) GetLocation(context.Context, *common.StrIndex) (*Location, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLocation not implemented") +} +func (UnimplementedDeviceServiceServer) GetNfcCardIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNfcCardIds not implemented") +} +func (UnimplementedDeviceServiceServer) GetStatusIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetStatusIds not implemented") +} +func (UnimplementedDeviceServiceServer) GetSentMessageIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSentMessageIds not implemented") +} +func (UnimplementedDeviceServiceServer) GetReceivedMessageIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetReceivedMessageIds not implemented") +} +func (UnimplementedDeviceServiceServer) GetLogs(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLogs not implemented") +} +func (UnimplementedDeviceServiceServer) GetActivity(context.Context, *common.StrIndex) (*common.Activity, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetActivity not implemented") +} +func (UnimplementedDeviceServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedDeviceServiceServer) mustEmbedUnimplementedDeviceServiceServer() {} + +// UnsafeDeviceServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DeviceServiceServer will +// result in compilation errors. +type UnsafeDeviceServiceServer interface { + mustEmbedUnimplementedDeviceServiceServer() +} + +func RegisterDeviceServiceServer(s grpc.ServiceRegistrar, srv DeviceServiceServer) { + s.RegisterService(&DeviceService_ServiceDesc, srv) +} + +func _DeviceService_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetAll(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetInfo(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetCharge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetCharge(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetCharge", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetCharge(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetLocation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetLocation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetLocation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetLocation(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetNfcCardIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetNfcCardIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetNfcCardIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetNfcCardIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetStatusIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetStatusIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetStatusIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetStatusIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetSentMessageIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetSentMessageIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetSentMessageIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetSentMessageIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetReceivedMessageIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetReceivedMessageIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetReceivedMessageIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetReceivedMessageIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetLogs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetLogs(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetActivity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetActivity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetActivity(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetMeta(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +// DeviceService_ServiceDesc is the grpc.ServiceDesc for DeviceService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DeviceService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.device.DeviceService", + HandlerType: (*DeviceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetAll", + Handler: _DeviceService_GetAll_Handler, + }, + { + MethodName: "GetInfo", + Handler: _DeviceService_GetInfo_Handler, + }, + { + MethodName: "GetCharge", + Handler: _DeviceService_GetCharge_Handler, + }, + { + MethodName: "GetLocation", + Handler: _DeviceService_GetLocation_Handler, + }, + { + MethodName: "GetNfcCardIds", + Handler: _DeviceService_GetNfcCardIds_Handler, + }, + { + MethodName: "GetStatusIds", + Handler: _DeviceService_GetStatusIds_Handler, + }, + { + MethodName: "GetSentMessageIds", + Handler: _DeviceService_GetSentMessageIds_Handler, + }, + { + MethodName: "GetReceivedMessageIds", + Handler: _DeviceService_GetReceivedMessageIds_Handler, + }, + { + MethodName: "GetLogs", + Handler: _DeviceService_GetLogs_Handler, + }, + { + MethodName: "GetActivity", + Handler: _DeviceService_GetActivity_Handler, + }, + { + MethodName: "GetMeta", + Handler: _DeviceService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "device.proto", +} diff --git a/AppServer/src/app_comm/api/log/log.pb.go b/AppServer/src/app_comm/api/log/log.pb.go new file mode 100644 index 0000000..002933a --- /dev/null +++ b/AppServer/src/app_comm/api/log/log.pb.go @@ -0,0 +1,81 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: log.proto + +package api_log + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_log_proto protoreflect.FileDescriptor + +var file_log_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x70, 0x61, 0x67, + 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6c, 0x6f, 0x67, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x8b, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x49, 0x64, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x07, 0x47, + 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x21, 0x5a, 0x1f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, + 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x6f, 0x67, + 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x6c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_log_proto_goTypes = []interface{}{ + (*common.Index)(nil), // 0: pagerino.common.Index + (*common.References)(nil), // 1: pagerino.common.References + (*common.Meta)(nil), // 2: pagerino.common.Meta +} +var file_log_proto_depIdxs = []int32{ + 0, // 0: pagerino.log.LogService.GetChangeIds:input_type -> pagerino.common.Index + 0, // 1: pagerino.log.LogService.GetMeta:input_type -> pagerino.common.Index + 1, // 2: pagerino.log.LogService.GetChangeIds:output_type -> pagerino.common.References + 2, // 3: pagerino.log.LogService.GetMeta:output_type -> pagerino.common.Meta + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_log_proto_init() } +func file_log_proto_init() { + if File_log_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_log_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_log_proto_goTypes, + DependencyIndexes: file_log_proto_depIdxs, + }.Build() + File_log_proto = out.File + file_log_proto_rawDesc = nil + file_log_proto_goTypes = nil + file_log_proto_depIdxs = nil +} diff --git a/AppServer/src/app_comm/api/log/log_grpc.pb.go b/AppServer/src/app_comm/api/log/log_grpc.pb.go new file mode 100644 index 0000000..83739f9 --- /dev/null +++ b/AppServer/src/app_comm/api/log/log_grpc.pb.go @@ -0,0 +1,144 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_log + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// LogServiceClient is the client API for LogService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type LogServiceClient interface { + // === DB information + // References + GetChangeIds(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.References, error) + // Common + GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) +} + +type logServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewLogServiceClient(cc grpc.ClientConnInterface) LogServiceClient { + return &logServiceClient{cc} +} + +func (c *logServiceClient) GetChangeIds(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.log.LogService/GetChangeIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *logServiceClient) GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.log.LogService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LogServiceServer is the server API for LogService service. +// All implementations must embed UnimplementedLogServiceServer +// for forward compatibility +type LogServiceServer interface { + // === DB information + // References + GetChangeIds(context.Context, *common.Index) (*common.References, error) + // Common + GetMeta(context.Context, *common.Index) (*common.Meta, error) + mustEmbedUnimplementedLogServiceServer() +} + +// UnimplementedLogServiceServer must be embedded to have forward compatible implementations. +type UnimplementedLogServiceServer struct { +} + +func (UnimplementedLogServiceServer) GetChangeIds(context.Context, *common.Index) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChangeIds not implemented") +} +func (UnimplementedLogServiceServer) GetMeta(context.Context, *common.Index) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedLogServiceServer) mustEmbedUnimplementedLogServiceServer() {} + +// UnsafeLogServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LogServiceServer will +// result in compilation errors. +type UnsafeLogServiceServer interface { + mustEmbedUnimplementedLogServiceServer() +} + +func RegisterLogServiceServer(s grpc.ServiceRegistrar, srv LogServiceServer) { + s.RegisterService(&LogService_ServiceDesc, srv) +} + +func _LogService_GetChangeIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LogServiceServer).GetChangeIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.log.LogService/GetChangeIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LogServiceServer).GetChangeIds(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _LogService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LogServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.log.LogService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LogServiceServer).GetMeta(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +// LogService_ServiceDesc is the grpc.ServiceDesc for LogService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LogService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.log.LogService", + HandlerType: (*LogServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetChangeIds", + Handler: _LogService_GetChangeIds_Handler, + }, + { + MethodName: "GetMeta", + Handler: _LogService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "log.proto", +} diff --git a/AppServer/src/app_comm/api/message/message.pb.go b/AppServer/src/app_comm/api/message/message.pb.go new file mode 100644 index 0000000..db87644 --- /dev/null +++ b/AppServer/src/app_comm/api/message/message.pb.go @@ -0,0 +1,267 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: message.proto + +package api_message + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MessageBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SenderId int32 `protobuf:"varint,1,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"` + ReceiverId int32 `protobuf:"varint,2,opt,name=receiver_id,json=receiverId,proto3" json:"receiver_id,omitempty"` + Payload string `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *MessageBasicInfo) Reset() { + *x = MessageBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_message_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageBasicInfo) ProtoMessage() {} + +func (x *MessageBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_message_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageBasicInfo.ProtoReflect.Descriptor instead. +func (*MessageBasicInfo) Descriptor() ([]byte, []int) { + return file_message_proto_rawDescGZIP(), []int{0} +} + +func (x *MessageBasicInfo) GetSenderId() int32 { + if x != nil { + return x.SenderId + } + return 0 +} + +func (x *MessageBasicInfo) GetReceiverId() int32 { + if x != nil { + return x.ReceiverId + } + return 0 +} + +func (x *MessageBasicInfo) GetPayload() string { + if x != nil { + return x.Payload + } + return "" +} + +func (x *MessageBasicInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type Payload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *Payload) Reset() { + *x = Payload{} + if protoimpl.UnsafeEnabled { + mi := &file_message_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Payload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Payload) ProtoMessage() {} + +func (x *Payload) ProtoReflect() protoreflect.Message { + mi := &file_message_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Payload.ProtoReflect.Descriptor instead. +func (*Payload) Descriptor() ([]byte, []int) { + return file_message_proto_rawDescGZIP(), []int{1} +} + +func (x *Payload) GetPayload() string { + if x != nil { + return x.Payload + } + return "" +} + +var File_message_proto protoreflect.FileDescriptor + +var file_message_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x10, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xa5, 0x01, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x61, 0x73, 0x69, + 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x39, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x23, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x32, 0xd2, 0x01, + 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x45, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x1a, 0x22, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x61, + 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x19, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, + 0x74, 0x61, 0x42, 0x29, 0x5a, 0x27, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_proto_rawDescOnce sync.Once + file_message_proto_rawDescData = file_message_proto_rawDesc +) + +func file_message_proto_rawDescGZIP() []byte { + file_message_proto_rawDescOnce.Do(func() { + file_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_proto_rawDescData) + }) + return file_message_proto_rawDescData +} + +var file_message_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_message_proto_goTypes = []interface{}{ + (*MessageBasicInfo)(nil), // 0: pagerino.message.MessageBasicInfo + (*Payload)(nil), // 1: pagerino.message.Payload + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*common.Index)(nil), // 3: pagerino.common.Index + (*common.Meta)(nil), // 4: pagerino.common.Meta +} +var file_message_proto_depIdxs = []int32{ + 2, // 0: pagerino.message.MessageBasicInfo.created_at:type_name -> google.protobuf.Timestamp + 3, // 1: pagerino.message.MessageService.GetInfo:input_type -> pagerino.common.Index + 3, // 2: pagerino.message.MessageService.GetPayload:input_type -> pagerino.common.Index + 3, // 3: pagerino.message.MessageService.GetMeta:input_type -> pagerino.common.Index + 0, // 4: pagerino.message.MessageService.GetInfo:output_type -> pagerino.message.MessageBasicInfo + 1, // 5: pagerino.message.MessageService.GetPayload:output_type -> pagerino.message.Payload + 4, // 6: pagerino.message.MessageService.GetMeta:output_type -> pagerino.common.Meta + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_message_proto_init() } +func file_message_proto_init() { + if File_message_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Payload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_message_proto_goTypes, + DependencyIndexes: file_message_proto_depIdxs, + MessageInfos: file_message_proto_msgTypes, + }.Build() + File_message_proto = out.File + file_message_proto_rawDesc = nil + file_message_proto_goTypes = nil + file_message_proto_depIdxs = nil +} diff --git a/AppServer/src/app_comm/api/message/message_grpc.pb.go b/AppServer/src/app_comm/api/message/message_grpc.pb.go new file mode 100644 index 0000000..b43c471 --- /dev/null +++ b/AppServer/src/app_comm/api/message/message_grpc.pb.go @@ -0,0 +1,178 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_message + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// MessageServiceClient is the client API for MessageService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MessageServiceClient interface { + // === DB information + GetInfo(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*MessageBasicInfo, error) + GetPayload(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*Payload, error) + // Common + GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) +} + +type messageServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMessageServiceClient(cc grpc.ClientConnInterface) MessageServiceClient { + return &messageServiceClient{cc} +} + +func (c *messageServiceClient) GetInfo(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*MessageBasicInfo, error) { + out := new(MessageBasicInfo) + err := c.cc.Invoke(ctx, "/pagerino.message.MessageService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageServiceClient) GetPayload(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*Payload, error) { + out := new(Payload) + err := c.cc.Invoke(ctx, "/pagerino.message.MessageService/GetPayload", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageServiceClient) GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.message.MessageService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MessageServiceServer is the server API for MessageService service. +// All implementations must embed UnimplementedMessageServiceServer +// for forward compatibility +type MessageServiceServer interface { + // === DB information + GetInfo(context.Context, *common.Index) (*MessageBasicInfo, error) + GetPayload(context.Context, *common.Index) (*Payload, error) + // Common + GetMeta(context.Context, *common.Index) (*common.Meta, error) + mustEmbedUnimplementedMessageServiceServer() +} + +// UnimplementedMessageServiceServer must be embedded to have forward compatible implementations. +type UnimplementedMessageServiceServer struct { +} + +func (UnimplementedMessageServiceServer) GetInfo(context.Context, *common.Index) (*MessageBasicInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedMessageServiceServer) GetPayload(context.Context, *common.Index) (*Payload, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPayload not implemented") +} +func (UnimplementedMessageServiceServer) GetMeta(context.Context, *common.Index) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedMessageServiceServer) mustEmbedUnimplementedMessageServiceServer() {} + +// UnsafeMessageServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MessageServiceServer will +// result in compilation errors. +type UnsafeMessageServiceServer interface { + mustEmbedUnimplementedMessageServiceServer() +} + +func RegisterMessageServiceServer(s grpc.ServiceRegistrar, srv MessageServiceServer) { + s.RegisterService(&MessageService_ServiceDesc, srv) +} + +func _MessageService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.message.MessageService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageServiceServer).GetInfo(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageService_GetPayload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageServiceServer).GetPayload(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.message.MessageService/GetPayload", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageServiceServer).GetPayload(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.message.MessageService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageServiceServer).GetMeta(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +// MessageService_ServiceDesc is the grpc.ServiceDesc for MessageService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MessageService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.message.MessageService", + HandlerType: (*MessageServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _MessageService_GetInfo_Handler, + }, + { + MethodName: "GetPayload", + Handler: _MessageService_GetPayload_Handler, + }, + { + MethodName: "GetMeta", + Handler: _MessageService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "message.proto", +} diff --git a/AppServer/src/app_comm/api/nfccard/nfccard.pb.go b/AppServer/src/app_comm/api/nfccard/nfccard.pb.go new file mode 100644 index 0000000..c055bcc --- /dev/null +++ b/AppServer/src/app_comm/api/nfccard/nfccard.pb.go @@ -0,0 +1,168 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: nfccard.proto + +package api_nfccard + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type NfcCardBaseInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` +} + +func (x *NfcCardBaseInfo) Reset() { + *x = NfcCardBaseInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_nfccard_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NfcCardBaseInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NfcCardBaseInfo) ProtoMessage() {} + +func (x *NfcCardBaseInfo) ProtoReflect() protoreflect.Message { + mi := &file_nfccard_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NfcCardBaseInfo.ProtoReflect.Descriptor instead. +func (*NfcCardBaseInfo) Descriptor() ([]byte, []int) { + return file_nfccard_proto_rawDescGZIP(), []int{0} +} + +func (x *NfcCardBaseInfo) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +var File_nfccard_proto protoreflect.FileDescriptor + +var file_nfccard_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x6e, 0x66, 0x63, 0x63, 0x61, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x11, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6e, 0x66, 0x63, 0x5f, 0x63, 0x61, + 0x72, 0x64, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x23, 0x0a, 0x0f, 0x4e, 0x66, 0x63, 0x43, 0x61, 0x72, 0x64, 0x42, 0x61, 0x73, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x32, 0xd4, 0x01, 0x0a, 0x0e, 0x4e, 0x66, 0x63, 0x43, 0x61, 0x72, + 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x22, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6e, 0x66, 0x63, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x2e, + 0x4e, 0x66, 0x63, 0x43, 0x61, 0x72, 0x64, 0x42, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x41, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x16, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x29, 0x5a, 0x27, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x66, 0x63, 0x63, 0x61, 0x72, 0x64, 0x3b, 0x61, 0x70, 0x69, 0x5f, + 0x6e, 0x66, 0x63, 0x63, 0x61, 0x72, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_nfccard_proto_rawDescOnce sync.Once + file_nfccard_proto_rawDescData = file_nfccard_proto_rawDesc +) + +func file_nfccard_proto_rawDescGZIP() []byte { + file_nfccard_proto_rawDescOnce.Do(func() { + file_nfccard_proto_rawDescData = protoimpl.X.CompressGZIP(file_nfccard_proto_rawDescData) + }) + return file_nfccard_proto_rawDescData +} + +var file_nfccard_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_nfccard_proto_goTypes = []interface{}{ + (*NfcCardBaseInfo)(nil), // 0: pagerino.nfc_card.NfcCardBaseInfo + (*common.Index)(nil), // 1: pagerino.common.Index + (*common.Reference)(nil), // 2: pagerino.common.Reference + (*common.Meta)(nil), // 3: pagerino.common.Meta +} +var file_nfccard_proto_depIdxs = []int32{ + 1, // 0: pagerino.nfc_card.NfcCardService.GetInfo:input_type -> pagerino.common.Index + 1, // 1: pagerino.nfc_card.NfcCardService.GetDeviceId:input_type -> pagerino.common.Index + 1, // 2: pagerino.nfc_card.NfcCardService.GetMeta:input_type -> pagerino.common.Index + 0, // 3: pagerino.nfc_card.NfcCardService.GetInfo:output_type -> pagerino.nfc_card.NfcCardBaseInfo + 2, // 4: pagerino.nfc_card.NfcCardService.GetDeviceId:output_type -> pagerino.common.Reference + 3, // 5: pagerino.nfc_card.NfcCardService.GetMeta:output_type -> pagerino.common.Meta + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_nfccard_proto_init() } +func file_nfccard_proto_init() { + if File_nfccard_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_nfccard_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NfcCardBaseInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_nfccard_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_nfccard_proto_goTypes, + DependencyIndexes: file_nfccard_proto_depIdxs, + MessageInfos: file_nfccard_proto_msgTypes, + }.Build() + File_nfccard_proto = out.File + file_nfccard_proto_rawDesc = nil + file_nfccard_proto_goTypes = nil + file_nfccard_proto_depIdxs = nil +} diff --git a/AppServer/src/app_comm/api/nfccard/nfccard_grpc.pb.go b/AppServer/src/app_comm/api/nfccard/nfccard_grpc.pb.go new file mode 100644 index 0000000..eb0bade --- /dev/null +++ b/AppServer/src/app_comm/api/nfccard/nfccard_grpc.pb.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_nfccard + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// NfcCardServiceClient is the client API for NfcCardService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type NfcCardServiceClient interface { + // === DB information + GetInfo(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*NfcCardBaseInfo, error) + // References + GetDeviceId(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Reference, error) + // Common + GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) +} + +type nfcCardServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNfcCardServiceClient(cc grpc.ClientConnInterface) NfcCardServiceClient { + return &nfcCardServiceClient{cc} +} + +func (c *nfcCardServiceClient) GetInfo(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*NfcCardBaseInfo, error) { + out := new(NfcCardBaseInfo) + err := c.cc.Invoke(ctx, "/pagerino.nfc_card.NfcCardService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nfcCardServiceClient) GetDeviceId(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Reference, error) { + out := new(common.Reference) + err := c.cc.Invoke(ctx, "/pagerino.nfc_card.NfcCardService/GetDeviceId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nfcCardServiceClient) GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.nfc_card.NfcCardService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NfcCardServiceServer is the server API for NfcCardService service. +// All implementations must embed UnimplementedNfcCardServiceServer +// for forward compatibility +type NfcCardServiceServer interface { + // === DB information + GetInfo(context.Context, *common.Index) (*NfcCardBaseInfo, error) + // References + GetDeviceId(context.Context, *common.Index) (*common.Reference, error) + // Common + GetMeta(context.Context, *common.Index) (*common.Meta, error) + mustEmbedUnimplementedNfcCardServiceServer() +} + +// UnimplementedNfcCardServiceServer must be embedded to have forward compatible implementations. +type UnimplementedNfcCardServiceServer struct { +} + +func (UnimplementedNfcCardServiceServer) GetInfo(context.Context, *common.Index) (*NfcCardBaseInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedNfcCardServiceServer) GetDeviceId(context.Context, *common.Index) (*common.Reference, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDeviceId not implemented") +} +func (UnimplementedNfcCardServiceServer) GetMeta(context.Context, *common.Index) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedNfcCardServiceServer) mustEmbedUnimplementedNfcCardServiceServer() {} + +// UnsafeNfcCardServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NfcCardServiceServer will +// result in compilation errors. +type UnsafeNfcCardServiceServer interface { + mustEmbedUnimplementedNfcCardServiceServer() +} + +func RegisterNfcCardServiceServer(s grpc.ServiceRegistrar, srv NfcCardServiceServer) { + s.RegisterService(&NfcCardService_ServiceDesc, srv) +} + +func _NfcCardService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NfcCardServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.nfc_card.NfcCardService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NfcCardServiceServer).GetInfo(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _NfcCardService_GetDeviceId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NfcCardServiceServer).GetDeviceId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.nfc_card.NfcCardService/GetDeviceId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NfcCardServiceServer).GetDeviceId(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _NfcCardService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NfcCardServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.nfc_card.NfcCardService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NfcCardServiceServer).GetMeta(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +// NfcCardService_ServiceDesc is the grpc.ServiceDesc for NfcCardService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NfcCardService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.nfc_card.NfcCardService", + HandlerType: (*NfcCardServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _NfcCardService_GetInfo_Handler, + }, + { + MethodName: "GetDeviceId", + Handler: _NfcCardService_GetDeviceId_Handler, + }, + { + MethodName: "GetMeta", + Handler: _NfcCardService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "nfccard.proto", +} diff --git a/AppServer/src/app_comm/api/permission/permission.pb.go b/AppServer/src/app_comm/api/permission/permission.pb.go new file mode 100644 index 0000000..a728f8e --- /dev/null +++ b/AppServer/src/app_comm/api/permission/permission.pb.go @@ -0,0 +1,181 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: permission.proto + +package api_permission + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PermissionBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *PermissionBasicInfo) Reset() { + *x = PermissionBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_permission_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PermissionBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PermissionBasicInfo) ProtoMessage() {} + +func (x *PermissionBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_permission_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PermissionBasicInfo.ProtoReflect.Descriptor instead. +func (*PermissionBasicInfo) Descriptor() ([]byte, []int) { + return file_permission_proto_rawDescGZIP(), []int{0} +} + +func (x *PermissionBasicInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PermissionBasicInfo) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +var File_permission_proto protoreflect.FileDescriptor + +var file_permission_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x13, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x13, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x32, 0xe6, 0x01, 0x0a, 0x11, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x28, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, + 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, + 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x3b, + 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x2f, 0x5a, 0x2d, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x3b, 0x61, 0x70, + 0x69, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_permission_proto_rawDescOnce sync.Once + file_permission_proto_rawDescData = file_permission_proto_rawDesc +) + +func file_permission_proto_rawDescGZIP() []byte { + file_permission_proto_rawDescOnce.Do(func() { + file_permission_proto_rawDescData = protoimpl.X.CompressGZIP(file_permission_proto_rawDescData) + }) + return file_permission_proto_rawDescData +} + +var file_permission_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_permission_proto_goTypes = []interface{}{ + (*PermissionBasicInfo)(nil), // 0: pagerino.permission.PermissionBasicInfo + (*common.StrIndex)(nil), // 1: pagerino.common.StrIndex + (*common.References)(nil), // 2: pagerino.common.References + (*common.Meta)(nil), // 3: pagerino.common.Meta +} +var file_permission_proto_depIdxs = []int32{ + 1, // 0: pagerino.permission.PermissionService.GetInfo:input_type -> pagerino.common.StrIndex + 1, // 1: pagerino.permission.PermissionService.GetRoleIds:input_type -> pagerino.common.StrIndex + 1, // 2: pagerino.permission.PermissionService.GetMeta:input_type -> pagerino.common.StrIndex + 0, // 3: pagerino.permission.PermissionService.GetInfo:output_type -> pagerino.permission.PermissionBasicInfo + 2, // 4: pagerino.permission.PermissionService.GetRoleIds:output_type -> pagerino.common.References + 3, // 5: pagerino.permission.PermissionService.GetMeta:output_type -> pagerino.common.Meta + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_permission_proto_init() } +func file_permission_proto_init() { + if File_permission_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_permission_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PermissionBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_permission_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_permission_proto_goTypes, + DependencyIndexes: file_permission_proto_depIdxs, + MessageInfos: file_permission_proto_msgTypes, + }.Build() + File_permission_proto = out.File + file_permission_proto_rawDesc = nil + file_permission_proto_goTypes = nil + file_permission_proto_depIdxs = nil +} diff --git a/AppServer/src/app_comm/api/permission/permission_grpc.pb.go b/AppServer/src/app_comm/api/permission/permission_grpc.pb.go new file mode 100644 index 0000000..ec3370a --- /dev/null +++ b/AppServer/src/app_comm/api/permission/permission_grpc.pb.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_permission + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PermissionServiceClient is the client API for PermissionService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PermissionServiceClient interface { + // === DB information + GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*PermissionBasicInfo, error) + // References + GetRoleIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + // Common + GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) +} + +type permissionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPermissionServiceClient(cc grpc.ClientConnInterface) PermissionServiceClient { + return &permissionServiceClient{cc} +} + +func (c *permissionServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*PermissionBasicInfo, error) { + out := new(PermissionBasicInfo) + err := c.cc.Invoke(ctx, "/pagerino.permission.PermissionService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *permissionServiceClient) GetRoleIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.permission.PermissionService/GetRoleIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *permissionServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.permission.PermissionService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PermissionServiceServer is the server API for PermissionService service. +// All implementations must embed UnimplementedPermissionServiceServer +// for forward compatibility +type PermissionServiceServer interface { + // === DB information + GetInfo(context.Context, *common.StrIndex) (*PermissionBasicInfo, error) + // References + GetRoleIds(context.Context, *common.StrIndex) (*common.References, error) + // Common + GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) + mustEmbedUnimplementedPermissionServiceServer() +} + +// UnimplementedPermissionServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPermissionServiceServer struct { +} + +func (UnimplementedPermissionServiceServer) GetInfo(context.Context, *common.StrIndex) (*PermissionBasicInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedPermissionServiceServer) GetRoleIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRoleIds not implemented") +} +func (UnimplementedPermissionServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedPermissionServiceServer) mustEmbedUnimplementedPermissionServiceServer() {} + +// UnsafePermissionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PermissionServiceServer will +// result in compilation errors. +type UnsafePermissionServiceServer interface { + mustEmbedUnimplementedPermissionServiceServer() +} + +func RegisterPermissionServiceServer(s grpc.ServiceRegistrar, srv PermissionServiceServer) { + s.RegisterService(&PermissionService_ServiceDesc, srv) +} + +func _PermissionService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PermissionServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.permission.PermissionService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PermissionServiceServer).GetInfo(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _PermissionService_GetRoleIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PermissionServiceServer).GetRoleIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.permission.PermissionService/GetRoleIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PermissionServiceServer).GetRoleIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _PermissionService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PermissionServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.permission.PermissionService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PermissionServiceServer).GetMeta(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +// PermissionService_ServiceDesc is the grpc.ServiceDesc for PermissionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PermissionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.permission.PermissionService", + HandlerType: (*PermissionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _PermissionService_GetInfo_Handler, + }, + { + MethodName: "GetRoleIds", + Handler: _PermissionService_GetRoleIds_Handler, + }, + { + MethodName: "GetMeta", + Handler: _PermissionService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "permission.proto", +} diff --git a/AppServer/src/app_comm/api/role/role.pb.go b/AppServer/src/app_comm/api/role/role.pb.go new file mode 100644 index 0000000..09aa284 --- /dev/null +++ b/AppServer/src/app_comm/api/role/role.pb.go @@ -0,0 +1,184 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: role.proto + +package api_role + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RoleBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *RoleBasicInfo) Reset() { + *x = RoleBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_role_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RoleBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleBasicInfo) ProtoMessage() {} + +func (x *RoleBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_role_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RoleBasicInfo.ProtoReflect.Descriptor instead. +func (*RoleBasicInfo) Descriptor() ([]byte, []int) { + return file_role_proto_rawDescGZIP(), []int{0} +} + +func (x *RoleBasicInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RoleBasicInfo) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +var File_role_proto protoreflect.FileDescriptor + +var file_role_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x0d, 0x52, 0x6f, 0x6c, + 0x65, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x32, 0xa0, 0x02, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x42, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x61, 0x73, 0x69, 0x63, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4a, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, + 0x12, 0x44, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x19, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, + 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, + 0x65, 0x74, 0x61, 0x42, 0x23, 0x5a, 0x21, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, + 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x3b, + 0x61, 0x70, 0x69, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_role_proto_rawDescOnce sync.Once + file_role_proto_rawDescData = file_role_proto_rawDesc +) + +func file_role_proto_rawDescGZIP() []byte { + file_role_proto_rawDescOnce.Do(func() { + file_role_proto_rawDescData = protoimpl.X.CompressGZIP(file_role_proto_rawDescData) + }) + return file_role_proto_rawDescData +} + +var file_role_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_role_proto_goTypes = []interface{}{ + (*RoleBasicInfo)(nil), // 0: pagerino.role.RoleBasicInfo + (*common.StrIndex)(nil), // 1: pagerino.common.StrIndex + (*common.References)(nil), // 2: pagerino.common.References + (*common.Meta)(nil), // 3: pagerino.common.Meta +} +var file_role_proto_depIdxs = []int32{ + 1, // 0: pagerino.role.RoleService.GetInfo:input_type -> pagerino.common.StrIndex + 1, // 1: pagerino.role.RoleService.GetPermissionIds:input_type -> pagerino.common.StrIndex + 1, // 2: pagerino.role.RoleService.GetUserIds:input_type -> pagerino.common.StrIndex + 1, // 3: pagerino.role.RoleService.GetMeta:input_type -> pagerino.common.StrIndex + 0, // 4: pagerino.role.RoleService.GetInfo:output_type -> pagerino.role.RoleBasicInfo + 2, // 5: pagerino.role.RoleService.GetPermissionIds:output_type -> pagerino.common.References + 2, // 6: pagerino.role.RoleService.GetUserIds:output_type -> pagerino.common.References + 3, // 7: pagerino.role.RoleService.GetMeta:output_type -> pagerino.common.Meta + 4, // [4:8] is the sub-list for method output_type + 0, // [0:4] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_role_proto_init() } +func file_role_proto_init() { + if File_role_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_role_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoleBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_role_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_role_proto_goTypes, + DependencyIndexes: file_role_proto_depIdxs, + MessageInfos: file_role_proto_msgTypes, + }.Build() + File_role_proto = out.File + file_role_proto_rawDesc = nil + file_role_proto_goTypes = nil + file_role_proto_depIdxs = nil +} diff --git a/AppServer/src/app_comm/api/role/role_grpc.pb.go b/AppServer/src/app_comm/api/role/role_grpc.pb.go new file mode 100644 index 0000000..b5bf872 --- /dev/null +++ b/AppServer/src/app_comm/api/role/role_grpc.pb.go @@ -0,0 +1,216 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_role + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// RoleServiceClient is the client API for RoleService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RoleServiceClient interface { + // === DB information + GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*RoleBasicInfo, error) + // References + GetPermissionIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetUserIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + // Common + GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) +} + +type roleServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRoleServiceClient(cc grpc.ClientConnInterface) RoleServiceClient { + return &roleServiceClient{cc} +} + +func (c *roleServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*RoleBasicInfo, error) { + out := new(RoleBasicInfo) + err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) GetPermissionIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetPermissionIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) GetUserIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetUserIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RoleServiceServer is the server API for RoleService service. +// All implementations must embed UnimplementedRoleServiceServer +// for forward compatibility +type RoleServiceServer interface { + // === DB information + GetInfo(context.Context, *common.StrIndex) (*RoleBasicInfo, error) + // References + GetPermissionIds(context.Context, *common.StrIndex) (*common.References, error) + GetUserIds(context.Context, *common.StrIndex) (*common.References, error) + // Common + GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) + mustEmbedUnimplementedRoleServiceServer() +} + +// UnimplementedRoleServiceServer must be embedded to have forward compatible implementations. +type UnimplementedRoleServiceServer struct { +} + +func (UnimplementedRoleServiceServer) GetInfo(context.Context, *common.StrIndex) (*RoleBasicInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedRoleServiceServer) GetPermissionIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPermissionIds not implemented") +} +func (UnimplementedRoleServiceServer) GetUserIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserIds not implemented") +} +func (UnimplementedRoleServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedRoleServiceServer) mustEmbedUnimplementedRoleServiceServer() {} + +// UnsafeRoleServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RoleServiceServer will +// result in compilation errors. +type UnsafeRoleServiceServer interface { + mustEmbedUnimplementedRoleServiceServer() +} + +func RegisterRoleServiceServer(s grpc.ServiceRegistrar, srv RoleServiceServer) { + s.RegisterService(&RoleService_ServiceDesc, srv) +} + +func _RoleService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.role.RoleService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetInfo(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_GetPermissionIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetPermissionIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.role.RoleService/GetPermissionIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetPermissionIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_GetUserIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetUserIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.role.RoleService/GetUserIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetUserIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.role.RoleService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetMeta(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +// RoleService_ServiceDesc is the grpc.ServiceDesc for RoleService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RoleService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.role.RoleService", + HandlerType: (*RoleServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _RoleService_GetInfo_Handler, + }, + { + MethodName: "GetPermissionIds", + Handler: _RoleService_GetPermissionIds_Handler, + }, + { + MethodName: "GetUserIds", + Handler: _RoleService_GetUserIds_Handler, + }, + { + MethodName: "GetMeta", + Handler: _RoleService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "role.proto", +} diff --git a/AppServer/src/app_comm/api/status/status.pb.go b/AppServer/src/app_comm/api/status/status.pb.go new file mode 100644 index 0000000..5a50e8c --- /dev/null +++ b/AppServer/src/app_comm/api/status/status.pb.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: status.proto + +package api_status + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type StatusBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InternalStatus int32 `protobuf:"zigzag32,1,opt,name=internal_status,json=internalStatus,proto3" json:"internal_status,omitempty"` + NativeStatus string `protobuf:"bytes,2,opt,name=native_status,json=nativeStatus,proto3" json:"native_status,omitempty"` +} + +func (x *StatusBasicInfo) Reset() { + *x = StatusBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_status_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusBasicInfo) ProtoMessage() {} + +func (x *StatusBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_status_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusBasicInfo.ProtoReflect.Descriptor instead. +func (*StatusBasicInfo) Descriptor() ([]byte, []int) { + return file_status_proto_rawDescGZIP(), []int{0} +} + +func (x *StatusBasicInfo) GetInternalStatus() int32 { + if x != nil { + return x.InternalStatus + } + return 0 +} + +func (x *StatusBasicInfo) GetNativeStatus() string { + if x != nil { + return x.NativeStatus + } + return "" +} + +var File_status_proto protoreflect.FileDescriptor + +var file_status_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, + 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, + 0x0f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xda, + 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x46, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x20, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, + 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, + 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x3b, + 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x27, 0x5a, 0x25, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_status_proto_rawDescOnce sync.Once + file_status_proto_rawDescData = file_status_proto_rawDesc +) + +func file_status_proto_rawDescGZIP() []byte { + file_status_proto_rawDescOnce.Do(func() { + file_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_status_proto_rawDescData) + }) + return file_status_proto_rawDescData +} + +var file_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_status_proto_goTypes = []interface{}{ + (*StatusBasicInfo)(nil), // 0: pagerino.status.StatusBasicInfo + (*common.StrIndex)(nil), // 1: pagerino.common.StrIndex + (*common.Reference)(nil), // 2: pagerino.common.Reference + (*common.Meta)(nil), // 3: pagerino.common.Meta +} +var file_status_proto_depIdxs = []int32{ + 1, // 0: pagerino.status.StatusService.GetInfo:input_type -> pagerino.common.StrIndex + 1, // 1: pagerino.status.StatusService.GetDeviceId:input_type -> pagerino.common.StrIndex + 1, // 2: pagerino.status.StatusService.GetMeta:input_type -> pagerino.common.StrIndex + 0, // 3: pagerino.status.StatusService.GetInfo:output_type -> pagerino.status.StatusBasicInfo + 2, // 4: pagerino.status.StatusService.GetDeviceId:output_type -> pagerino.common.Reference + 3, // 5: pagerino.status.StatusService.GetMeta:output_type -> pagerino.common.Meta + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_status_proto_init() } +func file_status_proto_init() { + if File_status_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_status_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_status_proto_goTypes, + DependencyIndexes: file_status_proto_depIdxs, + MessageInfos: file_status_proto_msgTypes, + }.Build() + File_status_proto = out.File + file_status_proto_rawDesc = nil + file_status_proto_goTypes = nil + file_status_proto_depIdxs = nil +} diff --git a/AppServer/src/app_comm/api/status/status_grpc.pb.go b/AppServer/src/app_comm/api/status/status_grpc.pb.go new file mode 100644 index 0000000..6f6782d --- /dev/null +++ b/AppServer/src/app_comm/api/status/status_grpc.pb.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_status + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// StatusServiceClient is the client API for StatusService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StatusServiceClient interface { + // === DB information + GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*StatusBasicInfo, error) + // References + GetDeviceId(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Reference, error) + // Common + GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) +} + +type statusServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewStatusServiceClient(cc grpc.ClientConnInterface) StatusServiceClient { + return &statusServiceClient{cc} +} + +func (c *statusServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*StatusBasicInfo, error) { + out := new(StatusBasicInfo) + err := c.cc.Invoke(ctx, "/pagerino.status.StatusService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *statusServiceClient) GetDeviceId(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Reference, error) { + out := new(common.Reference) + err := c.cc.Invoke(ctx, "/pagerino.status.StatusService/GetDeviceId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *statusServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.status.StatusService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StatusServiceServer is the server API for StatusService service. +// All implementations must embed UnimplementedStatusServiceServer +// for forward compatibility +type StatusServiceServer interface { + // === DB information + GetInfo(context.Context, *common.StrIndex) (*StatusBasicInfo, error) + // References + GetDeviceId(context.Context, *common.StrIndex) (*common.Reference, error) + // Common + GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) + mustEmbedUnimplementedStatusServiceServer() +} + +// UnimplementedStatusServiceServer must be embedded to have forward compatible implementations. +type UnimplementedStatusServiceServer struct { +} + +func (UnimplementedStatusServiceServer) GetInfo(context.Context, *common.StrIndex) (*StatusBasicInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedStatusServiceServer) GetDeviceId(context.Context, *common.StrIndex) (*common.Reference, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDeviceId not implemented") +} +func (UnimplementedStatusServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedStatusServiceServer) mustEmbedUnimplementedStatusServiceServer() {} + +// UnsafeStatusServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StatusServiceServer will +// result in compilation errors. +type UnsafeStatusServiceServer interface { + mustEmbedUnimplementedStatusServiceServer() +} + +func RegisterStatusServiceServer(s grpc.ServiceRegistrar, srv StatusServiceServer) { + s.RegisterService(&StatusService_ServiceDesc, srv) +} + +func _StatusService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StatusServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.status.StatusService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StatusServiceServer).GetInfo(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _StatusService_GetDeviceId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StatusServiceServer).GetDeviceId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.status.StatusService/GetDeviceId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StatusServiceServer).GetDeviceId(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _StatusService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StatusServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.status.StatusService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StatusServiceServer).GetMeta(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +// StatusService_ServiceDesc is the grpc.ServiceDesc for StatusService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var StatusService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.status.StatusService", + HandlerType: (*StatusServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _StatusService_GetInfo_Handler, + }, + { + MethodName: "GetDeviceId", + Handler: _StatusService_GetDeviceId_Handler, + }, + { + MethodName: "GetMeta", + Handler: _StatusService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "status.proto", +} diff --git a/AppServer/src/app_comm/api/user/user.pb.go b/AppServer/src/app_comm/api/user/user.pb.go new file mode 100644 index 0000000..c483c78 --- /dev/null +++ b/AppServer/src/app_comm/api/user/user.pb.go @@ -0,0 +1,384 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: user.proto + +package api_user + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Password struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *Password) Reset() { + *x = Password{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Password) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Password) ProtoMessage() {} + +func (x *Password) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Password.ProtoReflect.Descriptor instead. +func (*Password) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{0} +} + +func (x *Password) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type UserAllInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + RoleId int32 `protobuf:"varint,3,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` + LastOnline *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_online,json=lastOnline,proto3" json:"last_online,omitempty"` +} + +func (x *UserAllInfo) Reset() { + *x = UserAllInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserAllInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserAllInfo) ProtoMessage() {} + +func (x *UserAllInfo) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserAllInfo.ProtoReflect.Descriptor instead. +func (*UserAllInfo) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{1} +} + +func (x *UserAllInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UserAllInfo) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *UserAllInfo) GetRoleId() int32 { + if x != nil { + return x.RoleId + } + return 0 +} + +func (x *UserAllInfo) GetLastOnline() *timestamppb.Timestamp { + if x != nil { + return x.LastOnline + } + return nil +} + +type UserBaseInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + RoleId int32 `protobuf:"varint,2,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` + LastOnline *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=last_online,json=lastOnline,proto3" json:"last_online,omitempty"` +} + +func (x *UserBaseInfo) Reset() { + *x = UserBaseInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserBaseInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserBaseInfo) ProtoMessage() {} + +func (x *UserBaseInfo) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserBaseInfo.ProtoReflect.Descriptor instead. +func (*UserBaseInfo) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{2} +} + +func (x *UserBaseInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UserBaseInfo) GetRoleId() int32 { + if x != nil { + return x.RoleId + } + return 0 +} + +func (x *UserBaseInfo) GetLastOnline() *timestamppb.Timestamp { + if x != nil { + return x.LastOnline + } + return nil +} + +var File_user_proto protoreflect.FileDescriptor + +var file_user_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x26, 0x0a, 0x08, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, + 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x78, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, + 0x42, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, + 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6f, 0x6e, + 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x69, + 0x6e, 0x65, 0x32, 0xa5, 0x04, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x19, 0x2e, 0x70, + 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, + 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, + 0x6e, 0x6f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x41, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, + 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x41, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x1a, 0x17, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, + 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x46, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, + 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, + 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x1a, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, + 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x23, 0x5a, 0x21, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_proto_rawDescOnce sync.Once + file_user_proto_rawDescData = file_user_proto_rawDesc +) + +func file_user_proto_rawDescGZIP() []byte { + file_user_proto_rawDescOnce.Do(func() { + file_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_proto_rawDescData) + }) + return file_user_proto_rawDescData +} + +var file_user_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_user_proto_goTypes = []interface{}{ + (*Password)(nil), // 0: pagerino.user.Password + (*UserAllInfo)(nil), // 1: pagerino.user.UserAllInfo + (*UserBaseInfo)(nil), // 2: pagerino.user.UserBaseInfo + (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp + (*common.StrIndex)(nil), // 4: pagerino.common.StrIndex + (*common.Reference)(nil), // 5: pagerino.common.Reference + (*common.References)(nil), // 6: pagerino.common.References + (*common.Activity)(nil), // 7: pagerino.common.Activity + (*common.Meta)(nil), // 8: pagerino.common.Meta +} +var file_user_proto_depIdxs = []int32{ + 3, // 0: pagerino.user.UserAllInfo.last_online:type_name -> google.protobuf.Timestamp + 3, // 1: pagerino.user.UserBaseInfo.last_online:type_name -> google.protobuf.Timestamp + 4, // 2: pagerino.user.UserService.GetAll:input_type -> pagerino.common.StrIndex + 4, // 3: pagerino.user.UserService.GetInfo:input_type -> pagerino.common.StrIndex + 4, // 4: pagerino.user.UserService.GetPassword:input_type -> pagerino.common.StrIndex + 4, // 5: pagerino.user.UserService.GetRoleId:input_type -> pagerino.common.StrIndex + 4, // 6: pagerino.user.UserService.GetDeviceIds:input_type -> pagerino.common.StrIndex + 4, // 7: pagerino.user.UserService.GetLogs:input_type -> pagerino.common.StrIndex + 4, // 8: pagerino.user.UserService.GetActivity:input_type -> pagerino.common.StrIndex + 4, // 9: pagerino.user.UserService.GetMeta:input_type -> pagerino.common.StrIndex + 1, // 10: pagerino.user.UserService.GetAll:output_type -> pagerino.user.UserAllInfo + 2, // 11: pagerino.user.UserService.GetInfo:output_type -> pagerino.user.UserBaseInfo + 0, // 12: pagerino.user.UserService.GetPassword:output_type -> pagerino.user.Password + 5, // 13: pagerino.user.UserService.GetRoleId:output_type -> pagerino.common.Reference + 6, // 14: pagerino.user.UserService.GetDeviceIds:output_type -> pagerino.common.References + 6, // 15: pagerino.user.UserService.GetLogs:output_type -> pagerino.common.References + 7, // 16: pagerino.user.UserService.GetActivity:output_type -> pagerino.common.Activity + 8, // 17: pagerino.user.UserService.GetMeta:output_type -> pagerino.common.Meta + 10, // [10:18] is the sub-list for method output_type + 2, // [2:10] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_user_proto_init() } +func file_user_proto_init() { + if File_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Password); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserAllInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserBaseInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_proto_goTypes, + DependencyIndexes: file_user_proto_depIdxs, + MessageInfos: file_user_proto_msgTypes, + }.Build() + File_user_proto = out.File + file_user_proto_rawDesc = nil + file_user_proto_goTypes = nil + file_user_proto_depIdxs = nil +} diff --git a/AppServer/src/app_comm/api/user/user_grpc.pb.go b/AppServer/src/app_comm/api/user/user_grpc.pb.go new file mode 100644 index 0000000..514b278 --- /dev/null +++ b/AppServer/src/app_comm/api/user/user_grpc.pb.go @@ -0,0 +1,360 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_user + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// UserServiceClient is the client API for UserService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserServiceClient interface { + // === DB information + GetAll(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*UserAllInfo, error) + GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*UserBaseInfo, error) + GetPassword(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Password, error) + // References + GetRoleId(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Reference, error) + GetDeviceIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetLogs(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + // Common + GetActivity(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Activity, error) + GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) GetAll(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*UserAllInfo, error) { + out := new(UserAllInfo) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*UserBaseInfo, error) { + out := new(UserBaseInfo) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetPassword(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Password, error) { + out := new(Password) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetPassword", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetRoleId(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Reference, error) { + out := new(common.Reference) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetRoleId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetDeviceIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetDeviceIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetLogs(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetLogs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetActivity(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Activity, error) { + out := new(common.Activity) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetActivity", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations must embed UnimplementedUserServiceServer +// for forward compatibility +type UserServiceServer interface { + // === DB information + GetAll(context.Context, *common.StrIndex) (*UserAllInfo, error) + GetInfo(context.Context, *common.StrIndex) (*UserBaseInfo, error) + GetPassword(context.Context, *common.StrIndex) (*Password, error) + // References + GetRoleId(context.Context, *common.StrIndex) (*common.Reference, error) + GetDeviceIds(context.Context, *common.StrIndex) (*common.References, error) + GetLogs(context.Context, *common.StrIndex) (*common.References, error) + // Common + GetActivity(context.Context, *common.StrIndex) (*common.Activity, error) + GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) + mustEmbedUnimplementedUserServiceServer() +} + +// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserServiceServer struct { +} + +func (UnimplementedUserServiceServer) GetAll(context.Context, *common.StrIndex) (*UserAllInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented") +} +func (UnimplementedUserServiceServer) GetInfo(context.Context, *common.StrIndex) (*UserBaseInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedUserServiceServer) GetPassword(context.Context, *common.StrIndex) (*Password, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPassword not implemented") +} +func (UnimplementedUserServiceServer) GetRoleId(context.Context, *common.StrIndex) (*common.Reference, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRoleId not implemented") +} +func (UnimplementedUserServiceServer) GetDeviceIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDeviceIds not implemented") +} +func (UnimplementedUserServiceServer) GetLogs(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLogs not implemented") +} +func (UnimplementedUserServiceServer) GetActivity(context.Context, *common.StrIndex) (*common.Activity, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetActivity not implemented") +} +func (UnimplementedUserServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + s.RegisterService(&UserService_ServiceDesc, srv) +} + +func _UserService_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetAll(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetInfo(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetPassword", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetPassword(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetRoleId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetRoleId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetRoleId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetRoleId(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetDeviceIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetDeviceIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetDeviceIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetDeviceIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetLogs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetLogs(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetActivity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetActivity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetActivity(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetMeta(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.user.UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetAll", + Handler: _UserService_GetAll_Handler, + }, + { + MethodName: "GetInfo", + Handler: _UserService_GetInfo_Handler, + }, + { + MethodName: "GetPassword", + Handler: _UserService_GetPassword_Handler, + }, + { + MethodName: "GetRoleId", + Handler: _UserService_GetRoleId_Handler, + }, + { + MethodName: "GetDeviceIds", + Handler: _UserService_GetDeviceIds_Handler, + }, + { + MethodName: "GetLogs", + Handler: _UserService_GetLogs_Handler, + }, + { + MethodName: "GetActivity", + Handler: _UserService_GetActivity_Handler, + }, + { + MethodName: "GetMeta", + Handler: _UserService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user.proto", +} diff --git a/AppServer/src/app_comm/proto/change.proto b/AppServer/src/app_comm/proto/change.proto new file mode 100644 index 0000000..793183c --- /dev/null +++ b/AppServer/src/app_comm/proto/change.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package pagerino.change; +option go_package = "server/app_comm/api/change;api_change"; + +import "common.proto"; + + +message ChageAllInfo { + string old_value = 1; + string new_value = 2; + string table_name = 3; + string operation = 4; + int32 log_id = 5; +} + +message Values { + string old_value = 1; + string new_value = 2; +} + + +service ChangeService { + // === DB information + rpc GetDiff(common.Index) returns (Values); + rpc GetAll(common.Index) returns (ChageAllInfo); + + // Common + rpc GetMeta(common.Index) returns (common.Meta); +} diff --git a/AppServer/src/app_comm/proto/common.proto b/AppServer/src/app_comm/proto/common.proto new file mode 100644 index 0000000..b7c2f00 --- /dev/null +++ b/AppServer/src/app_comm/proto/common.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +package pagerino.common; +option go_package = "server/app_comm/api/common;api_common"; + + +import "google/protobuf/timestamp.proto"; + +// For custom logic responses +enum RequestCode { + UNKNOWN = 0; + OK = 1; + UNAUTHORIZED = 2; + NO_DATA = 3; + INTERNAL_ERROR = 4; +} + +// === DB indexing +message StrIndex { + oneof id { + int32 num = 1; // Database ID + string name = 2; // for external fields: username, euid, name... + } +} + +message Index { + int32 num = 1; // Database ID +} + +// === DB information +message Meta { + int32 id = 1; + google.protobuf.Timestamp created_at = 2; +} + +message References { + int32 page = 1; // 32 IDs per page from most recent + repeated int32 ref_id = 2; +} + +message Reference { + int32 ref_id = 1; +} + +message Activity { + google.protobuf.Timestamp last_online = 1; +} diff --git a/AppServer/src/app_comm/proto/device.proto b/AppServer/src/app_comm/proto/device.proto new file mode 100644 index 0000000..df8844d --- /dev/null +++ b/AppServer/src/app_comm/proto/device.proto @@ -0,0 +1,65 @@ +syntax = "proto3"; + +package pagerino.device; +option go_package = "server/app_comm/api/device;api_device"; + +import "google/protobuf/timestamp.proto"; +import "common.proto"; + + +message Charge { + float charge = 1; +} + +message Location { + double latitude = 1; + double longitude = 2; + float altitude = 3; +} + +message DeviceBaseInfo { + string name = 1; + string euid = 2; + sint32 internal_status = 3; + google.protobuf.Timestamp last_online = 4; +} + +message DeviceAllInfo { // Meta not included! + string name = 1; + string euid = 2; + + sint32 internal_status = 3; + string native_status = 4; + + google.protobuf.Timestamp last_online = 5; + string fw_version = 6; + + repeated int32 card_ids = 7; + + float charge = 8; + + double latitude = 9; + double longitude = 10; + float altitude = 11; +} + + +service DeviceService { + // === DB information + rpc GetAll(common.StrIndex) returns (DeviceAllInfo); + rpc GetInfo(common.StrIndex) returns (DeviceBaseInfo); + rpc GetCharge(common.StrIndex) returns (Charge); + rpc GetLocation(common.StrIndex) returns (Location); + + // References + rpc GetNfcCardIds(common.StrIndex) returns (common.References); + rpc GetStatusIds(common.StrIndex) returns (common.References); + rpc GetSentMessageIds(common.StrIndex) returns (common.References); + rpc GetReceivedMessageIds(common.StrIndex) returns (common.References); + rpc GetLogs(common.StrIndex) returns (common.References); + + // Common + rpc GetActivity(common.StrIndex) returns (common.Activity); + rpc GetMeta(common.StrIndex) returns (common.Meta); +} + diff --git a/AppServer/src/app_comm/proto/log.proto b/AppServer/src/app_comm/proto/log.proto new file mode 100644 index 0000000..6a337ac --- /dev/null +++ b/AppServer/src/app_comm/proto/log.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package pagerino.log; +option go_package = "server/app_comm/api/log;api_log"; + +import "common.proto"; + + +service LogService { + // === DB information + // References + rpc GetChangeIds(common.Index) returns (common.References); + + // Common + rpc GetMeta(common.Index) returns (common.Meta); +} diff --git a/AppServer/src/app_comm/proto/message.proto b/AppServer/src/app_comm/proto/message.proto new file mode 100644 index 0000000..99060e7 --- /dev/null +++ b/AppServer/src/app_comm/proto/message.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; + +package pagerino.message; +option go_package = "server/app_comm/api/message;api_message"; + +import "google/protobuf/timestamp.proto"; +import "common.proto"; + + +message MessageBasicInfo { + int32 sender_id = 1; + int32 receiver_id = 2; + string payload = 3; + google.protobuf.Timestamp created_at = 4; +} + +message Payload { + string payload = 1; +} + + +service MessageService { + // === DB information + rpc GetInfo(common.Index) returns (MessageBasicInfo); + rpc GetPayload(common.Index) returns (Payload); + + // Common + rpc GetMeta(common.Index) returns (common.Meta); +} diff --git a/AppServer/src/app_comm/proto/nfccard.proto b/AppServer/src/app_comm/proto/nfccard.proto new file mode 100644 index 0000000..8975bf5 --- /dev/null +++ b/AppServer/src/app_comm/proto/nfccard.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package pagerino.nfc_card; +option go_package = "server/app_comm/api/nfccard;api_nfccard"; + + +import "common.proto"; + + +message NfcCardBaseInfo { + string uid = 1; +} + + +service NfcCardService { + // === DB information + rpc GetInfo(common.Index) returns (NfcCardBaseInfo); + + // References + rpc GetDeviceId(common.Index) returns (common.Reference); + + // Common + rpc GetMeta(common.Index) returns (common.Meta); +} diff --git a/AppServer/src/app_comm/proto/permission.proto b/AppServer/src/app_comm/proto/permission.proto new file mode 100644 index 0000000..ca46f60 --- /dev/null +++ b/AppServer/src/app_comm/proto/permission.proto @@ -0,0 +1,24 @@ +syntax = "proto3"; + +package pagerino.permission; +option go_package = "server/app_comm/api/permission;api_permission"; + +import "common.proto"; + + +message PermissionBasicInfo { + string name = 1; + string description = 2; +} + + +service PermissionService { + // === DB information + rpc GetInfo(common.StrIndex) returns (PermissionBasicInfo); + + // References + rpc GetRoleIds(common.StrIndex) returns (common.References); + + // Common + rpc GetMeta(common.StrIndex) returns (common.Meta); +} diff --git a/AppServer/src/app_comm/proto/role.proto b/AppServer/src/app_comm/proto/role.proto new file mode 100644 index 0000000..eeeadd3 --- /dev/null +++ b/AppServer/src/app_comm/proto/role.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package pagerino.role; +option go_package = "server/app_comm/api/role;api_role"; + +import "common.proto"; + + +message RoleBasicInfo { + string name = 1; + string description = 2; +} + + +service RoleService { + // === DB information + rpc GetInfo(common.StrIndex) returns (RoleBasicInfo); + + // References + rpc GetPermissionIds(common.StrIndex) returns (common.References); + rpc GetUserIds(common.StrIndex) returns (common.References); + + // Common + rpc GetMeta(common.StrIndex) returns (common.Meta); +} diff --git a/AppServer/src/app_comm/proto/status.proto b/AppServer/src/app_comm/proto/status.proto new file mode 100644 index 0000000..673d3cf --- /dev/null +++ b/AppServer/src/app_comm/proto/status.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; + +package pagerino.status; +option go_package = "server/app_comm/api/status;api_status"; + + +import "common.proto"; + + +message StatusBasicInfo { + sint32 internal_status = 1; + string native_status = 2; +} + + +// When getting Status, string index is for Device! +service StatusService { + // === DB information + rpc GetInfo(common.StrIndex) returns (StatusBasicInfo); + + // References + rpc GetDeviceId(common.StrIndex) returns (common.Reference); + + // Common + rpc GetMeta(common.StrIndex) returns (common.Meta); +} diff --git a/AppServer/src/app_comm/proto/user.proto b/AppServer/src/app_comm/proto/user.proto new file mode 100644 index 0000000..76b817d --- /dev/null +++ b/AppServer/src/app_comm/proto/user.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; + +package pagerino.user; +option go_package = "server/app_comm/api/user;api_user"; + +import "google/protobuf/timestamp.proto"; +import "common.proto"; + + +message Password { + string password = 1; +} + +message UserAllInfo { // Meta not included! + string name = 1; + string password = 2; + + int32 role_id = 3; + google.protobuf.Timestamp last_online = 4; +} + +message UserBaseInfo { + string name = 1; + int32 role_id = 2; + google.protobuf.Timestamp last_online = 3; +} + + +service UserService { + // === DB information + rpc GetAll(common.StrIndex) returns (UserAllInfo); + rpc GetInfo(common.StrIndex) returns (UserBaseInfo); + rpc GetPassword(common.StrIndex) returns (Password); + + // References + rpc GetRoleId(common.StrIndex) returns (common.Reference); + rpc GetDeviceIds(common.StrIndex) returns (common.References); + rpc GetLogs(common.StrIndex) returns (common.References); + + // Common + rpc GetActivity(common.StrIndex) returns (common.Activity); + rpc GetMeta(common.StrIndex) returns (common.Meta); +} diff --git a/AppServer/src/go.mod b/AppServer/src/go.mod new file mode 100755 index 0000000..22fdf72 --- /dev/null +++ b/AppServer/src/go.mod @@ -0,0 +1,28 @@ +module server + +go 1.24.5 + +require ( + github.com/eclipse/paho.mqtt.golang v1.5.0 // direct + github.com/jackc/pgx/v5 v5.7.5 // direct +) + +require ( + github.com/chirpstack/chirpstack/api/go/v4 v4.14.1 + golang.org/x/crypto v0.39.0 + google.golang.org/grpc v1.75.0 + google.golang.org/protobuf v1.36.8 +) + +require ( + github.com/gorilla/websocket v1.5.3 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect + github.com/jackc/puddle/v2 v2.2.2 // indirect + golang.org/x/net v0.41.0 // indirect + golang.org/x/sync v0.16.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/text v0.26.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect +) diff --git a/AppServer/src/go.sum b/AppServer/src/go.sum new file mode 100755 index 0000000..1550403 --- /dev/null +++ b/AppServer/src/go.sum @@ -0,0 +1,70 @@ +github.com/chirpstack/chirpstack/api/go/v4 v4.14.1 h1:w961GhhQArXqWxLcudZ4wI6AzcCkpHgPfuf03f3DtiM= +github.com/chirpstack/chirpstack/api/go/v4 v4.14.1/go.mod h1:EqvcS3qE73PunKGKkwxQ69pBx+xPcGAwVE6FFYSIzhk= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/eclipse/paho.mqtt.golang v1.5.0 h1:EH+bUVJNgttidWFkLLVKaQPGmkTUfQQqjOsyvMGvD6o= +github.com/eclipse/paho.mqtt.golang v1.5.0/go.mod h1:du/2qNQVqJf/Sqs4MEL77kR8QTqANF7XU7Fk0aOTAgk= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.7.5 h1:JHGfMnQY+IEtGM63d+NGMjoRpysB2JBwDr5fsngwmJs= +github.com/jackc/pgx/v5 v5.7.5/go.mod h1:aruU7o91Tc2q2cFp5h4uP3f6ztExVpyVv88Xl/8Vl8M= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= +go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= +go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= +go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= +go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI= +go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg= +go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc= +go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps= +go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= +go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 h1:APHvLLYBhtZvsbnpkfknDZ7NyH4z5+ub/I0u8L3Oz6g= +google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1/go.mod h1:xUjFWUnWDpZ/C0Gu0qloASKFb6f8/QXiiXhSPFsD668= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c h1:qXWI/sQtv5UKboZ/zUk7h+mrf/lXORyI+n9DKDAusdg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c/go.mod h1:gw1tLEfykwDz2ET4a12jcXt4couGAm7IwsVaTy0Sflo= +google.golang.org/grpc v1.75.0 h1:+TW+dqTd2Biwe6KKfhE5JpiYIBWq865PhKGSXiivqt4= +google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= +google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc= +google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/AppServer/src/main.go b/AppServer/src/main.go new file mode 100755 index 0000000..cda0006 --- /dev/null +++ b/AppServer/src/main.go @@ -0,0 +1,439 @@ +/* +Basic functionality to receive uplink messages from TTN, +process them and send appropriate responses to devices. + +Author: Olek +*/ +package main + +// go mod vendor -> for static libraries +// go mod tidy -> to download to /go/pkg/mod +// or just use docker +import ( + "context" + "crypto/tls" + "crypto/x509" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "log" + "net" + "os" + "os/signal" + "strconv" + "syscall" + "time" + + api_user "server/app_comm/api/user" + serder "server/serder" + + chirp_api "github.com/chirpstack/chirpstack/api/go/v4/api" + + mqtt "github.com/eclipse/paho.mqtt.golang" + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgxpool" + "golang.org/x/crypto/bcrypt" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" +) + +const ( + MAX_CHAR_LEN = 64 // Limits fields like: names, passwords... + MAX_PING_RETRIES = 6 +) + +// FPort signifies meaning of each port's message +const ( + FNotif uint8 = iota + 1 // Basic notfication message + FTask // Assigned task message + FAuth // Authorization message: system, device, NFC, NFC Reader... + FWarn // Warning message: emergency, help request... +) + +// Internal Pagerino status table +type Status uint16 + +const ( + StatUnknown Status = iota + StatOperational + StatIssue // Cannot operate until fixed, small issue + StatTempUnavailable // Cannot operate for a period of time regardless of any action + StatRepair // Explicitly repaired and unavailable + StatOffline // Not powered on or not disconnected from system + StatFatal // Cannot operate until professionally repaired or replaced + StatMAX // Maximum value, no other meaning +) + +// AppData holds data and connections needed througout the program +type AppData struct { + ExitSig chan os.Signal // Use on fatal error to graciously exit, otherwise potential leaks + DBPool *pgxpool.Pool // Execute queries on internal DB on this pool + APIServer *grpc.Server // Provide API for apps + MQTTClient mqtt.Client // Get Uplinks and downlinks + ChirpGateClient chirp_api.GatewayServiceClient // Check gateway stats and manage them + Timeout time.Duration // General connection/request timeout +} + +// Uplink reflects Chirpstack's uplink format +type Uplink struct { + ApplicationID string `json:"applicationID"` + DevEUI string `json:"devEUI"` + FCnt uint32 `json:"fCnt"` + FPort uint8 `json:"fPort"` + Data string `json:"data"` // Base64 payload + RxInfo []struct { + GatewayID string `json:"gatewayID"` + Time string `json:"time"` + RSSI int32 `json:"rssi"` + SNR float64 `json:"snr"` + } `json:"rxInfo"` + DecodedPayload map[string]any `json:"decodedPayload,omitempty"` +} + +// Downlink reflects Chirpstack's downlink format +type Downlink struct { + Confirmed bool `json:"confirmed"` // false for no Ack + FPort uint8 `json:"fPort"` // refer to FPort enum + Data string `json:"data"` // Base64 payload +} + +// Common errors +var ( + ErrNotFound error = errors.New("query returned empty") + ErrTooLong error = errors.New("given parameter(s) is too long") + ErrTimedOut error = errors.New("operation did not complete before timeout") + ErrModify error = errors.New("database data manipulation error") +) + +type RPCCredentials struct { + Token string +} + +func (cred *RPCCredentials) GetRequestMetadata(ctx context.Context, url ...string) (map[string]string, error) { + return map[string]string{ + "authorization": "Bearer " + cred.Token, + }, nil +} + +// TODO: Change to true if want certs +func (cred *RPCCredentials) RequireTransportSecurity() bool { + return false +} + +// Get non-empty config value, otherwise terminate program +func FindEnv(name string) string { + val := os.Getenv(name) + if val == "" { + log.Fatalln("Missing or empty configuration value for: " + name) + } + + return val +} + +// MakeTLSConfig loads client certificates for TLS and SSL +func MakeTLSConfig() (*tls.Config, error) { + // Load CA certificate + caCert, err := os.ReadFile("./certs/ca.pem") + if err != nil { + return nil, err + } + caCertPool := x509.NewCertPool() + caCertPool.AppendCertsFromPEM(caCert) + + // Load client certificate + cert, err := tls.LoadX509KeyPair("./certs/client.pem", "./certs/client.key") + if err != nil { + return nil, err + } + + return &tls.Config{ + RootCAs: caCertPool, + Certificates: []tls.Certificate{cert}, + MinVersion: tls.VersionTLS12, + }, nil +} + +// VerifyCredentials returns no error if password matches in DB +func VerifyCredentials(username string, password string, data *AppData) error { + if len(username) > MAX_CHAR_LEN || len(password) > MAX_CHAR_LEN { + return ErrTooLong + } + + hash, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) + if err != nil { + return err + } + + ctx, close_ctx := context.WithTimeout(context.Background(), data.Timeout) + defer close_ctx() + + row := data.DBPool.QueryRow(ctx, "SELECT password FROM User WHERE name = $1;") + + var pass string + if err = row.Scan(&pass); err != nil { + if errors.Is(err, pgx.ErrNoRows) { + return fmt.Errorf("%w for: User.name", ErrNotFound) + } else { + return err + } + } + + err = bcrypt.CompareHashAndPassword(hash, []byte(pass)) + + return err +} + +// SendDownlink sends downlink message to MQTT broker +func SendDownlink(data *AppData, topic string, msg *Downlink) error { + jsonData, _ := json.Marshal(msg) + publish_token := data.MQTTClient.Publish(topic, 0, false, jsonData) + if ok := publish_token.WaitTimeout(data.Timeout); !ok { + return fmt.Errorf("%w for: Downlink", ErrTimedOut) + } + + return nil +} + +// makeMQTTHandler returns a callback function that hanldes uplink messages +// from MQTT broker. +// +// Does most of the application logic. +func makeMQTTHandler(data *AppData) mqtt.MessageHandler { + return func(client mqtt.Client, msg mqtt.Message) { + var uplink Uplink + // Parse + err := json.Unmarshal(msg.Payload(), &uplink) + if err != nil { + log.Println("Failed to parse uplink message: " + err.Error()) + return + } + + // Decode to original + saves space + decoded, err := base64.StdEncoding.DecodeString(uplink.Data) + if err != nil { + log.Println("Failed to decode uplink payload: " + err.Error()) + return + } + + // Print + log.Println("Uplink from DeviceEUI [" + uplink.DevEUI + "]") + + switch uplink.FPort { + case FNotif: + log.Println("Uplink is responding to a normal message or notification") + case FTask: + log.Println("Uplink is responding to a task") + case FAuth: + log.Println("Uplink is responding to an authentication message") + case FWarn: + log.Println("Uplink is responding to a warning") + default: + log.Println("Uplink is responding in an unrecognized channel") + } + + // Query timeout + ctx, close := context.WithTimeout(context.Background(), data.Timeout) + defer close() + + // Get device IDs + row := data.DBPool.QueryRow(ctx, + "SELECT id FROM Devices WHERE euid = '$1'", + uplink.DevEUI, + ) + + var dev_id int32 + if err = row.Scan(&dev_id); err != nil { + log.Println(ErrNotFound.Error() + ": Device.euid = " + uplink.DevEUI) + return + } + + // Add Message to DB + _, err = data.DBPool.Exec(ctx, + "INSERT INTO Messages (sender_id, receiver_id, payload) VALUES ($1, $2, $3)", + dev_id, nil, decoded, + ) + + if err != nil { + log.Println(ErrModify.Error() + ": Message") + return + } + + // Get decoded custom payload + pager_msg, err := serder.Deserialize(decoded) + if err != nil { + log.Println(err.Error() + ": deserialization") + return + } + + log.Println("Received Pagerino payload for AppID[", pager_msg.AppID, "]:") + for _, field := range pager_msg.Fields { + log.Println(field) + } + } +} + +func main() { + // = Quit signal + quit_signal := make(chan os.Signal, 1) + signal.Notify(quit_signal, syscall.SIGINT, syscall.SIGTERM) + + Data := AppData{ + ExitSig: quit_signal, + } + + // === Logger settings + log.SetFlags(log.Ldate | log.Ltime | log.Lmsgprefix | log.Lshortfile) + log.SetPrefix(FindEnv("LOG_PREFIX") + " ") + + tmout, err := time.ParseDuration(FindEnv("TIMEOUT")) + if err != nil { + log.Println(`Format misconfiguration for TIMEOUT: +Expected: [number]{h|m|s|ms|us|ns}...`) + return + } + Data.Timeout = tmout + + // === PostgreSQL database + ctx_tmout, cancel_ctx := context.WithTimeout(context.Background(), Data.Timeout) + defer cancel_ctx() + + db_pool, err := pgxpool.New(ctx_tmout, + "postgres://"+FindEnv("DB_USER")+":"+FindEnv("DB_PASSWORD")+"@"+ + FindEnv("DB_HOST")+":5432/"+FindEnv("DB_NAME"), + ) + if err != nil { + log.Println("DB connection pool creation failed: " + err.Error()) + return + } + defer db_pool.Close() + log.Println("Created database connection.") + + Data.DBPool = db_pool + + // Check responsiveness + failed := true + for count := 0; count < MAX_PING_RETRIES; count++ { + if err = db_pool.Ping(ctx_tmout); err != nil { + time.Sleep(200 * time.Millisecond) + } else { + failed = false + break + } + } + if failed { + log.Println("Database is not responding: " + err.Error()) + return + } + + // === MQTT broker + tls_config, err := MakeTLSConfig() + if err != nil { + log.Println("Error creating TLS configuration: " + err.Error()) + return + } + opts := mqtt.NewClientOptions(). + AddBroker(FindEnv("MQTT_ADDRESS")). + SetClientID(FindEnv("MQTT_CLIENT_ID")). + SetTLSConfig(tls_config). + SetKeepAlive(30 * time.Second) + + client := mqtt.NewClient(opts) + connect_token := client.Connect() + if err := connect_token.Error(); err != nil { + log.Println("Failed to connect to MQTT broker: " + err.Error()) + return + } + + if ok := connect_token.WaitTimeout(Data.Timeout); !ok { + + log.Println("Connection to MQTT broker timed out") + return + } + + log.Println("Created MQTT broker connection.") + defer client.Disconnect(150) + + Data.MQTTClient = client + + // === API Server + api_port := FindEnv("SERVER_API_PORT") + net_listen, err := net.Listen("tcp", ":"+api_port) + if err != nil { + log.Println("Failed to listen on port " + api_port + ": " + err.Error()) + return + } + + grpc_server := grpc.NewServer() + // User service + api_user.RegisterUserServiceServer( + grpc_server, + &UserServiceServer{App: &Data}, + ) + Data.APIServer = grpc_server + + // Serve gRPC + go func() { + if err := grpc_server.Serve(net_listen); err != nil { + log.Println("Failed to serve gRPC API") + return + } + }() + log.Println("gRPC API serving on port: " + api_port) + + // === Chirpstack's gRPC API + dialOpts := []grpc.DialOption{ + //grpc.WithBlock(), + grpc.WithPerRPCCredentials(&RPCCredentials{FindEnv("CHIRP_API_KEY")}), + grpc.WithTransportCredentials(insecure.NewCredentials()), // remove this when using TLS + } + + grpc_conn, err := grpc.Dial("chirpstack:8080", dialOpts...) + if err != nil { + log.Println("Failed to create a gRPC connection to Chirpstack's API: " + err.Error()) + return + } + + Data.ChirpGateClient = chirp_api.NewGatewayServiceClient(grpc_conn) + defer grpc_conn.Close() + + log.Println("Created Chirpstack's API connection.") + + // Test gRPC connection + ctx_tmout, cancel_ctx = context.WithTimeout(context.Background(), Data.Timeout) + defer cancel_ctx() + + resp, err := Data.ChirpGateClient.List(ctx_tmout, &chirp_api.ListGatewaysRequest{ + Limit: 10, + Offset: 0, + OrderByDesc: true, + }) + if err != nil { + log.Println("Failed to test Chirpstack's API connection: "+err.Error(), resp) + return + } + + log.Println("Found the following gateways (first 10):") + for idx, gate := range resp.Result { + log.Println(strconv.FormatInt(int64(idx), 10) + ": App[" + + gate.TenantId + "] GateID[" + gate.GatewayId + "] Name[" + + gate.Name + "]") + } + log.Println("[END]") + + // === Listen for Uplinks + // Subscribe to topics + topic := "application/" + FindEnv("APP_ID") + "/device/+/event/up" + qos, err := strconv.Atoi(FindEnv("MQTT_QOS")) + if err != nil { + log.Println("Format misconfiguration for MQTT_QOS: " + err.Error()) + return + } + + client.Subscribe(topic, byte(qos), makeMQTTHandler(&Data)) + log.Println("Subscribed to uplink data on: " + topic + ".") + + // === Shutdown + <-Data.ExitSig // Continue here on force quit + log.Println("The server is shutting down.") +} diff --git a/AppServer/src/serder/serder.go b/AppServer/src/serder/serder.go new file mode 100644 index 0000000..90d6f8f --- /dev/null +++ b/AppServer/src/serder/serder.go @@ -0,0 +1,312 @@ +/* +Serialize and deserialize data with custom +Pagerino message templates. + +Author: Olek +*/ +package serder + +import ( + "encoding/binary" + "errors" + "fmt" + "math" +) + +const ( + NFC_LENGTH = 7 +) + +var ( + ErrTooShort error = errors.New("insufficient bytes in message") + ErrNoType error = errors.New("encountered unknown data type") + ErrNoLength error = errors.New("data type has no defined length") + ErrUndefined error = errors.New("encountered unexpected symbol, behaviour undefined") + ErrInvalidData error = errors.New("invalid underlying data provided") + ErrTooLong error = errors.New("data provided is too long") +) + +type Reaction uint8 + +const ( + React_OK Reaction = iota + React_IN + React_OUT +) + +const ( + DT_NULL byte = iota + DT_Char // byte + DT_Array // array + DT_Location // Location + DT_Temperature // float + DT_Charge // float + DT_Authorization // UID + DT_Reaction // byte + DT_NFCPair // UID + DT_NFCUnpair // None +) + +var DataSizeMap = map[byte]int{ + DT_NULL: 0, + DT_Array: 2, // type + length + DT_Char: 1, + DT_Location: 20, + DT_Temperature: 4, + DT_Charge: 4, + DT_Authorization: 7, + DT_Reaction: 1, + DT_NFCPair: 7, + DT_NFCUnpair: 0, +} + +type Location struct { + Latitude float64 + Longitude float64 + Altitude float32 +} + +type Field struct { + DType byte + Value any +} + +type PagerMessage struct { + AppID uint16 + Fields []Field +} + +// readArray reads a subset of bytes marked with DT_Array. +// This data is copied, it is not parsed. +func readArray(data []byte, offset int, dest *[]byte) (int, error) { + if offset+2 >= len(data) { + return offset, ErrTooShort + } + + dtype := data[offset] + offset++ + + length := int(data[offset]) + offset++ + + size, found := DataSizeMap[dtype] + if !found { + return offset, ErrNoLength + } + + if size*length+offset >= len(data) { + return len(data), ErrTooShort + } + + // Untyped! + *dest = append(*dest, data[offset:offset+length*size]...) + return offset + length*size, nil +} + +// readField returns single Field struct reflecting the next data segment +func readField(data []byte, offset int) (Field, int, error) { + pair := Field{} + if offset >= len(data) { + return pair, offset, ErrTooShort + } + + // Get type + pair.DType = data[offset] + offset++ + + size, found := DataSizeMap[pair.DType] + if !found { + return pair, offset, ErrNoLength + } + + if size != 0 { + if offset+size >= len(data) { + return pair, offset, ErrTooShort + } + + switch pair.DType { + case DT_Char, DT_Reaction: + pair.Value = data[offset] + offset++ + + case DT_Array: + sub_pair := Field{DType: data[offset]} + val, ok := sub_pair.Value.([]byte) + if !ok { + return pair, offset, ErrInvalidData + } + + offset, err := readArray(data, offset, &val) + if err != nil { + return pair, offset, err + } + + pair.Value = sub_pair + + case DT_Charge, DT_Temperature: + pair.Value = math.Float32frombits(binary.LittleEndian.Uint32(data[offset:])) + offset += 4 + + case DT_Authorization, DT_NFCPair: + pair.Value = data[offset : offset+NFC_LENGTH] + offset += NFC_LENGTH + + case DT_Location: + val := Location{Latitude: math.Float64frombits(binary.LittleEndian.Uint64(data[offset:]))} + offset += 8 + val.Longitude = math.Float64frombits(binary.LittleEndian.Uint64(data[offset:])) + offset += 8 + val.Altitude = math.Float32frombits(binary.LittleEndian.Uint32(data[offset:])) + offset += 4 + + pair.Value = val + + default: + return pair, offset, ErrNoType + } + } + + return pair, offset, nil +} + +// writeField encodes a field into buffer +func writeField(field *Field, buf []byte) ([]byte, error) { + buf = append(buf, field.DType) + + switch field.DType { + case DT_Array: + sub_pair, ok := field.Value.(Field) + if !ok { + return buf, ErrInvalidData + } + buf = append(buf, sub_pair.DType) + + size, ok := DataSizeMap[sub_pair.DType] + if !ok { + return buf, ErrNoLength + } + + val, ok := sub_pair.Value.([]byte) + if !ok { + return buf, ErrInvalidData + } + + length := len(val) / size + if length > 255 { + return buf, ErrTooLong + } + + buf = append(buf, byte(length)) + buf = append(buf, val...) + case DT_Char, DT_Reaction: + val, ok := field.Value.(byte) + if !ok { + return buf, ErrInvalidData + } + + buf = append(buf, val) + + case DT_Authorization, DT_NFCPair: + val, ok := field.Value.([7]byte) + if !ok { + return buf, ErrInvalidData + } + + buf = append(buf, val[:]...) + + case DT_Charge, DT_Temperature: + val, ok := field.Value.(float32) + if !ok { + return buf, ErrInvalidData + } + + buf = binary.LittleEndian.AppendUint32(buf, math.Float32bits(val)) + + case DT_Location: + val, ok := field.Value.(Location) + if !ok { + return buf, ErrInvalidData + } + + buf = binary.LittleEndian.AppendUint64(buf, math.Float64bits(val.Latitude)) + buf = binary.LittleEndian.AppendUint64(buf, math.Float64bits(val.Longitude)) + buf = binary.LittleEndian.AppendUint32(buf, math.Float32bits(val.Altitude)) + + case DT_NULL, DT_NFCUnpair: + + default: + return buf, ErrNoType + } + + return buf, nil +} + +// SplitByLimit splits encoded message into parts +// with maximum length derived from data rate. +// +// These messages are not decodable on the server, as +// data is fractured. (TODO) +func SplitByLimit(buf []byte, data_rate int) ([][]byte, error) { + var limit int + if data_rate >= 0 && data_rate <= 3 { + limit = 51 + } else if data_rate == 4 { + limit = 115 + } else if data_rate >= 5 && data_rate <= 7 { + limit = 222 + } else { + return nil, ErrUndefined + } + + length := len(buf) + count := length / limit + if length%limit != 0 { + count++ + } + + output := make([][]byte, 0, count) + offset := 0 + for ; offset+limit < length; offset += limit { + output = append(output, buf[offset:offset+limit]) + } + output = append(output, buf[offset:length]) + + return output, nil +} + +// Deserialize deserializes bytes into a structured message +func Deserialize(input []byte) (*PagerMessage, error) { + output := PagerMessage{} + + length := len(input) + if length < 2 { + return &output, fmt.Errorf("%w while reading AppID", ErrTooShort) + } + offset := 0 + output.AppID = binary.LittleEndian.Uint16(input[offset:]) + offset += 2 + + var err error + var field Field + for ; err == nil && offset < length; field, offset, err = readField(input, offset) { + output.Fields = append(output.Fields, field) + } + + return &output, err +} + +// Serialize serializes a message into bytes. +// +// Resulting array length is not limited, to get +// split messages for downlink use "SplitByLimit()" +func Serialize(msg *PagerMessage) ([]byte, error) { + buf := make([]byte, 0, 2+len(msg.Fields)*2) // May overalloc! + buf = binary.LittleEndian.AppendUint16(buf, msg.AppID) + + var err error + for idx := 0; idx < len(msg.Fields) && err == nil; idx++ { + buf, err = writeField(&msg.Fields[idx], buf) + } + + return buf, err +} diff --git a/AppServer/tarball.tar.gz b/AppServer/tarball.tar.gz new file mode 100644 index 0000000..46687e6 Binary files /dev/null and b/AppServer/tarball.tar.gz differ diff --git a/Chirpstack_v4/LICENSE b/Chirpstack_v4/LICENSE new file mode 100644 index 0000000..7e575a7 --- /dev/null +++ b/Chirpstack_v4/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2019 Orne Brocaar + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/Chirpstack_v4/Makefile b/Chirpstack_v4/Makefile new file mode 100644 index 0000000..5ed7277 --- /dev/null +++ b/Chirpstack_v4/Makefile @@ -0,0 +1,5 @@ +import-lorawan-devices: + docker-compose run --rm --entrypoint sh --user root chirpstack -c '\ + apk add --no-cache git && \ + git clone https://github.com/brocaar/lorawan-devices /tmp/lorawan-devices && \ + chirpstack -c /etc/chirpstack import-legacy-lorawan-devices-repository -d /tmp/lorawan-devices' diff --git a/Chirpstack_v4/README.md b/Chirpstack_v4/README.md new file mode 100644 index 0000000..e557ece --- /dev/null +++ b/Chirpstack_v4/README.md @@ -0,0 +1,99 @@ +# ChirpStack Docker example + +This repository contains a skeleton to setup the [ChirpStack](https://www.chirpstack.io) +open-source LoRaWAN Network Server (v4) using [Docker Compose](https://docs.docker.com/compose/). + +**Note:** Please use this `docker-compose.yml` file as a starting point for testing +but keep in mind that for production usage it might need modifications. + +## Directory layout + +* `docker-compose.yml`: the docker-compose file containing the services +* `configuration/chirpstack`: directory containing the ChirpStack configuration files +* `configuration/chirpstack-gateway-bridge`: directory containing the ChirpStack Gateway Bridge configuration +* `configuration/mosquitto`: directory containing the Mosquitto (MQTT broker) configuration +* `configuration/postgresql/initdb/`: directory containing PostgreSQL initialization scripts + +## Configuration + +This setup is pre-configured for all regions. You can either connect a ChirpStack Gateway Bridge +instance (v3.14.0+) to the MQTT broker (port 1883) or connect a Semtech UDP Packet Forwarder. +Please note that: + +* You must prefix the MQTT topic with the region. + Please see the region configuration files in the `configuration/chirpstack` for a list + of topic prefixes (e.g. eu868, us915_0, au915_0, as923_2, ...). +* The protobuf marshaler is configured. + +This setup also comes with two instances of the ChirpStack Gateway Bridge. One +is configured to handle the Semtech UDP Packet Forwarder data (port 1700), the +other is configured to handle the Basics Station protocol (port 3001). Both +instances are by default configured for EU868 (using the `eu868` MQTT topic +prefix). + +### Reconfigure regions + +ChirpStack has at least one configuration of each region enabled. You will find +the list of `enabled_regions` in `configuration/chirpstack/chirpstack.toml`. +Each entry in `enabled_regions` refers to the `id` that can be found in the +`region_XXX.toml` file. This `region_XXX.toml` also contains a `topic_prefix` +configuration which you need to configure the ChirpStack Gateway Bridge +UDP instance (see below). + +#### ChirpStack Gateway Bridge (UDP) + +Within the `docker-compose.yml` file, you must replace the `eu868` prefix in the +`INTEGRATION__..._TOPIC_TEMPLATE` configuration with the MQTT `topic_prefix` of +the region you would like to use (e.g. `us915_0`, `au915_0`, `in865`, ...). + +#### ChirpStack Gateway Bridge (Basics Station) + +Within the `docker-compose.yml` file, you must update the configuration file +that the ChirpStack Gateway Bridge instance must used. The default is +`chirpstack-gateway-bridge-basicstation-eu868.toml`. For available +configuration files, please see the `configuration/chirpstack-gateway-bridge` +directory. + +# Data persistence + +PostgreSQL and Redis data is persisted in Docker volumes, see the `docker-compose.yml` +`volumes` definition. + +## Requirements + +Before using this `docker-compose.yml` file, make sure you have [Docker](https://www.docker.com/community-edition) +installed. + +## Importing device repository + +To import the [lorawan-devices](https://github.com/TheThingsNetwork/lorawan-devices) +repository (optional step), run the following command: + +```bash +make import-lorawan-devices +``` + +This will clone the `lorawan-devices` repository and execute the import command of ChirpStack. +Please note that for this step you need to have the `make` command installed. + +**Note:** an older snapshot of the `lorawan-devices` repository is cloned as the +latest revision no longer contains a `LICENSE` file. + +## Usage + +To start the ChirpStack simply run: + +```bash +$ docker-compose up +``` + +After all the components have been initialized and started, you should be able +to open http://localhost:8080/ in your browser. + +## + +The example includes the [ChirpStack REST API](https://github.com/chirpstack/chirpstack-rest-api). +You should be able to access the UI by opening http://localhost:8090 in your browser. + +**Note:** It is recommended to use the [gRPC](https://www.chirpstack.io/docs/chirpstack/api/grpc.html) +interface over the [REST](https://www.chirpstack.io/docs/chirpstack/api/rest.html) interface. diff --git a/Chirpstack_v4/certs/ca.key b/Chirpstack_v4/certs/ca.key new file mode 100644 index 0000000..f56142e --- /dev/null +++ b/Chirpstack_v4/certs/ca.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDKru8yd0ZYdoxD +gL0Ls2IiL5+oYmyoEIAqGKaQltKOUMBMLOaDXum+/aEnCVoch5yzX7As/rIAH1p6 +rrGy5HJs7xww1ls5yjonIcVjlpWMnH3PecilVQuZOXEeny2h6zIVaK0aThVB3/+p +EVY3nprk9i29KEz+8biUykDce30EvemV4g6hF7AfrGiSv/EFLNTyX9YBPZ9LgbC1 +EHd4W07vYIz67JNcuw42xyYSMnp0hsxBiXv7KXlu2h5MjzNOXR8fI9WEkg5BkmVX +6h+Uruvaw26uw5prXbYpFtakDjnnQ+wS7Q3Jl7e0hF4pejvfgZoqJZXErUpRGIPB +GD2Gxm+S5J2RahaUOvKYAQg32okeoOtwv0YoP4Tei3HPyQkKjgGCWjMog3yUCG7z +59zXilcl6GvESZEEh0Q/M0VKOzh85MnWSJ2otppjCYzzklyUwm5zvWiUS3xQr6e3 +EapsthS5ccuAzNa++LMUVs6TO7U8BshbgNFUqpc7exBdPPdGVzKbzidwJeanshLy +0+zc2ZUH+nIdlmQRSlM1cyUk0Z5N0X6so3NouHSag7lhqYBGmESX+P4dOqhwgFw4 +EfmuSLdduXVehU2Cca/16e7YQi+Zy9lHLCN1kmHU0Eu8xoaDH0D3jnKccrWqsV/f +iiainAUnTxHkzV8K8guq3iTrcBsI2QIDAQABAoICAA3cY4WQIF6PoeVCZjtI/dyw +ZNLpQzzFnxwx4h84f0cGCPaUqgGBMctS0Uzn//J8SDhAop3bH61wN3n1HTgqlRQz +0HnbCPNVa/9t2O/H9it+7sAr+A+tdpz4j468bEya1uqdpVvri9rc0KE9ayfj1/wx +RTy+xzA2s+yx/bhOViUHP1SVmHJGGlB6NA8YIwmbcKcwLGSalByf7oedbAwuM2Jd +uBp3aBcDAFR471a2fsceClUvi6voINK2xjRuZR/2cJjKtLELo3+yvS1DWLxMb5r+ ++0BmplZyGtFpy00+H1HcZGZBcaxQDLtCw6VCw5o0BOjdt+Wyw6ay3lzL1XZUdwAF +lTQUupg6PVg44eTG/YFTvK3uuV34U/e28D2IpMa6H8Q329cFCj6h9vDYPLZxtTgD +alcwJWhXH9+7PR3LWGAcRq7SY5v0zuWpNxeD79BwQGmtPxyLSUAQwORPbpJS1tH2 +jJeuMFDtbFKv6fofPjA/zCcoPYX4VyUoMaRqO+vdqetgE363/7AaK0V/TxT4xdVW +DkIivtZpHKdvFgYzL+tK9f1ZVMApxXndtcPETgkSxJ45xQYiF0THaGljOVIAlxoC +OmL0CIj0m7gLm0RDGBl9J7CUar9GM4IsxLdEe6zZdtp24kNhZJY7/UcgMdewmjOL +BNssp4DLS/OK62UW+w/RAoIBAQD1ymnsYTS3PDJmkf7hUcs5vn6E/QTWcb2TmWiX +46ACWOaOkDlglALKPcbC+A+9WyaPh6Va3js+dbgUZtZ1Du1sNWgc4Wn3EZCaYWuS +HPln66L0ukn6uAzSfvkWZgdKRnVayMJblh5j+aKv0MeqjgFnOfPhz9W7tYUghuN0 ++lCGqIbEwjubl5ET3VVuyoPeb5qnCOla/J1Bi8/tIHQOkIvni4KvzEO1+UfkoYb1 +jrfmFHqxgRceLYbytvwpNzqxQrT5Bxh7ncolRHErUcmEfejMyFMNYJH50W8Z06Ds +Jn4sG5tElJhak2XfasByl6rKNXggPLtIYPmp32QSwo5GdV3xAoIBAQDTGiTNnXFY +Vz78MV7ttG0+Hva7NvEmHt8WOIzXCZ71Nv5jz/Nn3U/sL763Q81AwybF52C6IROb +zXjiZyhM+2AKEtYNRCz12ULzwdrr+Uzwk/+Ip8pq8FrpQ3+q6/1w8C88EhMKeWdt +SnZxo9opoPp+Z4CRGB4AvwboX/VSgPh+jN1Pbjo7KWQmn7QqqUg/EIs6Dxv/xgE4 +j/XDgl8c0trNnCAduseP1DL5XLoQBgNQy90kHhOI55artv7TuIV172qb3cflLH1h +GB+MAnynJ4Bqmpb3ozZ6fwak1TJEmvYcwK2a8RX02bpGFjceh17k1LlQ7JWNYPjP +jWF7yRAx4pFpAoIBAQCHLRJCMVe3qoChjouZyc017cFRTIH7mkRDx6wRVNusTs5F ++6XCqsQ6C+2jTqABaP71EwnqxqvYdw+NEN3DNTl4OIsQzxvjCKL5dLiffBXihGJz +q3yCSfSrU6+UFPrPa56hFiZmDlKaczF49h7Jex3kcqfhOdd3S6ZytBymOgBNfqPX +1GbJ9HqSbTjOHMyXadOpJ6qHIsUtxkHNTPrnA7Id3sk5++IFU5qpb/h0VlBnVj4A +H1nie/FqzR4zYK+Dy4cSKkfZvHbvNgvzYiCtID4HWejrQ4Ak33z1vEEVfzoG8gvb +lMmRjt0JGYHLxAPm/68YM65gaQ0F0tkLxDpRH71RAoIBABpa6zlYbKwwyEZIC6f1 +nKXiy773zweJVyS5DqxSISxQH1ZqweK3uKCuHUtYBaoOMysGBgd21bHf5zWs11U1 +FPps+5hQaKSQ6VDxZNmNGFP4xjBTcmwDcfYpXSkDqXKOKfd/8iyel5EHeN4bLMOB +u4RIe76hmi1RrBUa1c/lFiEGiSK/ijmUo1JHIgEpfUGSWS94b3BxUfmzz2UHQ8Sf +dn2w/jl39i44udxz/S6+8W8G5Kb7skinUSJDCHF6Wf8tUsv+1lQAR+71Sgr6zIE5 +50hn4G0uTUDh1vyBOXNjPVK9o27ypmEZRa42W89N60T6YeB+iPVLpASVjBQeOA1i +UfECggEBAMz0ET9XPaUpW1G8EsPFs5OAF48wJjmKkRB5yWXeI1XHFcAjr6j1XGR2 +UQjxUbw8crCkrEQts1nUKEsgXb0mnDDVX2RIgyL84JVlfacfVj7//LBqqAoD5m2t +0t5wwpQymdsX+dbhJiTDkLL8ogEqIjA+4HvQZNVJNdKbsWyl4nyqO26VCXVPPEm9 +mdIAs2MjBVTcdFPOXKZ+vcpPR03lszJdsHokdib+1ZUYwwvi6mEb2QwujtYuJqN3 +JfDdcP8RUhArr/YN7VSiuemWDKe8Pg+/iNZd76YIrjK6hfLNpEGVsBE3uHGWhpf2 +5EXK2y9J+I8XZ9QFfm64/Yt3AKTz2zI= +-----END PRIVATE KEY----- diff --git a/Chirpstack_v4/certs/ca.pem b/Chirpstack_v4/certs/ca.pem new file mode 100644 index 0000000..19457dd --- /dev/null +++ b/Chirpstack_v4/certs/ca.pem @@ -0,0 +1,30 @@ +-----BEGIN CERTIFICATE----- +MIIFETCCAvmgAwIBAgIUBcNVhGn2QaXZrzEfo7NEcktfjQowDQYJKoZIhvcNAQEL +BQAwGDEWMBQGA1UEAwwNQ2hpcnBTdGFjay1DQTAeFw0yNTA5MDYyMjUwMzlaFw0y +ODA5MDUyMjUwMzlaMBgxFjAUBgNVBAMMDUNoaXJwU3RhY2stQ0EwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQDKru8yd0ZYdoxDgL0Ls2IiL5+oYmyoEIAq +GKaQltKOUMBMLOaDXum+/aEnCVoch5yzX7As/rIAH1p6rrGy5HJs7xww1ls5yjon +IcVjlpWMnH3PecilVQuZOXEeny2h6zIVaK0aThVB3/+pEVY3nprk9i29KEz+8biU +ykDce30EvemV4g6hF7AfrGiSv/EFLNTyX9YBPZ9LgbC1EHd4W07vYIz67JNcuw42 +xyYSMnp0hsxBiXv7KXlu2h5MjzNOXR8fI9WEkg5BkmVX6h+Uruvaw26uw5prXbYp +FtakDjnnQ+wS7Q3Jl7e0hF4pejvfgZoqJZXErUpRGIPBGD2Gxm+S5J2RahaUOvKY +AQg32okeoOtwv0YoP4Tei3HPyQkKjgGCWjMog3yUCG7z59zXilcl6GvESZEEh0Q/ +M0VKOzh85MnWSJ2otppjCYzzklyUwm5zvWiUS3xQr6e3EapsthS5ccuAzNa++LMU +Vs6TO7U8BshbgNFUqpc7exBdPPdGVzKbzidwJeanshLy0+zc2ZUH+nIdlmQRSlM1 +cyUk0Z5N0X6so3NouHSag7lhqYBGmESX+P4dOqhwgFw4EfmuSLdduXVehU2Cca/1 +6e7YQi+Zy9lHLCN1kmHU0Eu8xoaDH0D3jnKccrWqsV/fiiainAUnTxHkzV8K8guq +3iTrcBsI2QIDAQABo1MwUTAdBgNVHQ4EFgQUFYNQfsgbp5HNBPVNlZ12GSM3FAIw +HwYDVR0jBBgwFoAUFYNQfsgbp5HNBPVNlZ12GSM3FAIwDwYDVR0TAQH/BAUwAwEB +/zANBgkqhkiG9w0BAQsFAAOCAgEAMgeVJHzXHdS47agDhqkz4gPQl4ynohXaZIUw +3tMDLayjj2MuQ/LDuk2by4FTwWCTGGYhbv0WMaPueatdZVygmokh4jXhux+6Yen7 +fBeqV5hkzhl9BPPaMp9Et2FZRYLMkaNXYcEc697NZUQSWkR2VbJ3P+wMk9N61T6n +q0tUdtWW/2EB5w0TtN+Qz2EcANUD1dqdTQkZUUR7yCWbOvUeUvyqx2GBYA9QWxtT +Vg+t4TlXpbSd/28jxpJwjFCrG+kcoyDnnmCqlfKQX3uj0mnuXg0sgKzwf6OroPgR +7wUjL3/RtlQhxxhen2tAoYThVQ6WMfxioSZPUKzkfapib5/pbb2t/srxb7D35ho+ +Iw1qZCIZ1vpRQ7sKeOXqmDmq6wiIHKP3D0ODsppond2BKagb3umJ7LKV3k6hnOTo +vCsnotXXT2apO4S2YcfQ4yTCW6E05Qo8S7hSzXB8RQpq5gGUSB78DB7tAkhf9RIQ +Ek9O+fBDv2LqyPxLUZM7eyaXQ8RzhpQqO+MYESAQgwxu5etPJTjLMxB8eIxrWY0H +CTnTHmKmpbL9YrU4903YvpTh2NDB/0VmlQe9S1PU0FqPws5fCZtaAK4P9Gsfv59j +CiMy2OPUDMrItR/pl3zSAof2lHN1Tp/Lg9yIY5udgwCDzXo7ajxnbL1W+qLC9pq4 +v/HHA+g= +-----END CERTIFICATE----- diff --git a/Chirpstack_v4/certs/cert-gen.sh b/Chirpstack_v4/certs/cert-gen.sh new file mode 100755 index 0000000..b469f65 --- /dev/null +++ b/Chirpstack_v4/certs/cert-gen.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +EXPIRY_DURATION=365 #days +AUTHORITY_DURATION=$(( $EXPIRY_DURATION * 3 )) + +# 1. Root CA (v3) +openssl genrsa -out ca.key 4096 +openssl req -x509 -new -nodes -key ca.key -sha256 -days "$AUTHORITY_DURATION" -out ca.pem -subj "/CN=ChirpStack-CA" + +# 2. Server cert (Mosquitto) v3 +openssl genrsa -out server.key 2048 +openssl req -new -key server.key -out server.csr -subj "/CN=mosquitto" + +# Add v3 extensions for rustls +cat >server_ext.cnf <client_ext.cnf <:@/?sslmode=. + # + # SSL mode options: + # * disable - Do not use TLS + # * prefer - Attempt to connect with TLS but allow sessions without + # * require - Require the use of TLS + dsn="postgres://chirpstack:chirpstack@$POSTGRESQL_HOST/chirpstack?sslmode=disable" + + # Max open connections. + # + # This sets the max. number of open connections that are allowed in the + # PostgreSQL connection pool. + max_open_connections=10 + + # Min idle connections. + # + # This sets the min. number of idle connections in the PostgreSQL connection + # pool (0 = equal to max_open_connections). + min_idle_connections=0 + + +# Redis configuration. +[redis] + + # Server address or addresses. + # + # Set multiple addresses when connecting to a cluster. + servers=[ + "redis://$REDIS_HOST/", + ] + + # TLS enabled. + tls_enabled=false + + # Redis Cluster. + # + # Set this to true when the provided URLs are pointing to a Redis Cluster + # instance. + cluster=false + + +# Network related configuration. +[network] + + # Network identifier (NetID, 3 bytes) encoded as HEX (e.g. 010203). + net_id="10204" + + # Enabled regions. + # + # Multiple regions can be enabled simultaneously. Each region must match + # the 'name' parameter of the region configuration in '[[regions]]'. + enabled_regions=[ + # "as923", + # "as923_2", + # "as923_3", + # "as923_4", + # "au915_0", + # "cn470_10", + # "cn779", + # "eu433", + "eu868" + # "in865", + # "ism2400", + # "kr920", + # "ru864", + # "us915_0", + # "us915_1", + ] + + +# API interface configuration. +[api] + + # interface:port to bind the API interface to. + bind="0.0.0.0:8080" + + # Secret. + # + # This secret is used for generating login and API tokens, make sure this + # is never exposed. Changing this secret will invalidate all login and API + # tokens. The following command can be used to generate a random secret: + # openssl rand -base64 32 + secret="7E7bNXrmFoFznYKTqWBUrz5lGBpHx3N2zdabP1jCd5s=" + + +# Global gateway configuration. +# Please note that backend configuration can be found in the per-region +# configuration. +[gateway] + + # CA certificate and key file (optional). + # + # If setting the CA certificate and key file options, ChirpStack + # will generate client certificates which can be used by the gateway for + # authentication and authorization. The Common Name of the certificate will + # be set to the Gateway ID. + # + # The ca_key is expected to be in PKCS#8 format (you can use openssl to + # convert to PKCS#8). + ca_cert="/etc/chirpstack/certs/ca.pem" + ca_key="/etc/chirpstack/certs/ca-key.pem" + + # Certificate lifetime. + # + # This defines how long (after generating) the certificate remains valid. + client_cert_lifetime="365days" + + # Allow unknown gateways. + # + # If set to true, then uplinks received from gateways not configured in + # ChirpStack will be allowed. + allow_unknown_gateways=false + + # RX timestamp max. drift. + # + # If the delta between the gateway reported RX timestamp vs ChirpStack + # server time is bigger than the configured value, then ChirpStack will + # ignore it. ChirpStack will then use the RX timestamp from the other + # receiving gateways, or failing that, will fall back onto the current + # server time. + rx_timestamp_max_drift="30s" + + +[integration] + enabled=["mqtt"] + + [integration.mqtt] + # Event topic template. + event_topic="application/{{application_id}}/device/{{dev_eui}}/event/{{event}}" + + # Command topic. + # + # This is the topic on which the MQTT subscribes for receiving (enqueue) commands. + command_topic="application/{{application_id}}/device/{{dev_eui}}/command/{{command}}" + + # Use JSON encoding instead of Protobuf (binary). + json=true + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="ssl://$MQTT_BROKER_HOST:8883/" + + # Connect with the given username (optional) + # username="" + + # Connect with the given password (optional) + # password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="chirpstack" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="/etc/chirpstack/certs/ca.pem" + + # TLS certificate file (optional) + tls_cert="/etc/chirpstack/certs/client.pem" + + # TLS key file (PKCS#8) (optional) + tls_key="/etc/chirpstack/certs/client.key" + diff --git a/Chirpstack_v4/configuration/chirpstack/region_as923.toml b/Chirpstack_v4/configuration/chirpstack/region_as923.toml new file mode 100644 index 0000000..0992c00 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_as923.toml @@ -0,0 +1,204 @@ +# This file contains an example AS923 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="as923" + + # Description is a short description for this region. + description="AS923" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AS923" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="as923" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=923200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=923400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=2 + + # RX2 frequency (Hz) + rx2_frequency=923200000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=3 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_as923_2.toml b/Chirpstack_v4/configuration/chirpstack/region_as923_2.toml new file mode 100644 index 0000000..04f865e --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_as923_2.toml @@ -0,0 +1,204 @@ +# This file contains an example AS923_2 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="as923_2" + + # Description is a short description for this region. + description="AS923-2" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AS923_2" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="as923_2" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=921400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=921600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=921400000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=3 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_as923_3.toml b/Chirpstack_v4/configuration/chirpstack/region_as923_3.toml new file mode 100644 index 0000000..7792267 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_as923_3.toml @@ -0,0 +1,204 @@ +# This file contains an example AS923_3 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="as923_3" + + # Description is a short description for this region. + description="AS923-3" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AS923_3" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="as923_3" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=916600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=916800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=2 + + # RX2 frequency (Hz) + rx2_frequency=916600000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=3 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_as923_4.toml b/Chirpstack_v4/configuration/chirpstack/region_as923_4.toml new file mode 100644 index 0000000..d8a17f7 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_as923_4.toml @@ -0,0 +1,204 @@ +# This file contains an example AS923_4 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="as923_4" + + # Description is a short description for this region. + description="AS923-4" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AS923_4" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="as923_4" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=917300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=917500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=2 + + # RX2 frequency (Hz) + rx2_frequency=917300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=3 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_au915_0.toml b/Chirpstack_v4/configuration/chirpstack/region_au915_0.toml new file mode 100644 index 0000000..29f903b --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_au915_0.toml @@ -0,0 +1,253 @@ +# This file contains an example AU915 example (channels 0-7 + 64). +[[regions]] + + # ID is an use-defined identifier for this region. + id="au915_0" + + # Description is a short description for this region. + description="AU915 (channels 0-7 + 64)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AU915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="au915_0" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=915200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=915400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=915600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=915800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=916000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=916200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=916400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=916600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=915900000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[0, 1, 2, 3, 4, 5, 6, 7, 64] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_au915_1.toml b/Chirpstack_v4/configuration/chirpstack/region_au915_1.toml new file mode 100644 index 0000000..6d2e31d --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_au915_1.toml @@ -0,0 +1,253 @@ +# This file contains an example AU915 example (channels 8-15 + 65). +[[regions]] + + # ID is an use-defined identifier for this region. + id="au915_1" + + # Description is a short description for this region. + description="AU915 (channels 8-15 + 65)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AU915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="au915_1" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=916800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=917000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=917200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=917400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=917600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=917800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=918000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=918200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=917500000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[8, 9, 10, 11, 12, 13, 14, 15, 65] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_au915_2.toml b/Chirpstack_v4/configuration/chirpstack/region_au915_2.toml new file mode 100644 index 0000000..3d1e5e7 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_au915_2.toml @@ -0,0 +1,253 @@ +# This file contains an example AU915 example (channels 16-23 + 66). +[[regions]] + + # ID is an use-defined identifier for this region. + id="au915_2" + + # Description is a short description for this region. + description="AU915 (channels 16-23 + 65)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AU915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="au915_2" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=918400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=918600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=918800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=919000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=919200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=919400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=919600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=919800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=919100000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[16, 17, 18, 19, 20, 21, 22, 23, 65] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_au915_3.toml b/Chirpstack_v4/configuration/chirpstack/region_au915_3.toml new file mode 100644 index 0000000..c1098c7 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_au915_3.toml @@ -0,0 +1,253 @@ +# This file contains an example AU915 example (channels 24-31 + 67). +[[regions]] + + # ID is an use-defined identifier for this region. + id="au915_3" + + # Description is a short description for this region. + description="AU915 (channels 24-31 + 67)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AU915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="au915_3" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=920000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=920200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=920400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=920600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=920800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=921000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=921200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=921400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=920700000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[24, 25, 26, 27, 28, 29, 30, 31, 67] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_au915_4.toml b/Chirpstack_v4/configuration/chirpstack/region_au915_4.toml new file mode 100644 index 0000000..ec51fef --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_au915_4.toml @@ -0,0 +1,253 @@ +# This file contains an example AU915 example (channels 32-39 + 68). +[[regions]] + + # ID is an use-defined identifier for this region. + id="au915_4" + + # Description is a short description for this region. + description="AU915 (channels 32-39 + 68)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AU915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="au915_4" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=921600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=921800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=922000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=922200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=922400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=922600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=922800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=923000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=922300000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[32, 33, 34, 35, 36, 37, 38, 39, 68] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_au915_5.toml b/Chirpstack_v4/configuration/chirpstack/region_au915_5.toml new file mode 100644 index 0000000..59b5f40 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_au915_5.toml @@ -0,0 +1,253 @@ +# This file contains an example AU915 example (channels 40-47 + 69). +[[regions]] + + # ID is an use-defined identifier for this region. + id="au915_5" + + # Description is a short description for this region. + description="AU915 (channels 40-47 + 69)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AU915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="au915_5" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=923200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=923400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=923600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=923800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=924000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=924200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=924400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=924600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=923900000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[40, 41, 42, 43, 44, 45, 46, 47, 69] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_au915_6.toml b/Chirpstack_v4/configuration/chirpstack/region_au915_6.toml new file mode 100644 index 0000000..2181344 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_au915_6.toml @@ -0,0 +1,253 @@ +# This file contains an example AU915 example (channels 48-55 + 70). +[[regions]] + + # ID is an use-defined identifier for this region. + id="au915_6" + + # Description is a short description for this region. + description="AU915 (channels 48-55 + 70)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AU915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="au915_6" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=924800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=925000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=925200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=925400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=925600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=925800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=926000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=926200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=925500000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[48, 49, 50, 51, 52, 53, 54, 55, 70] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_au915_7.toml b/Chirpstack_v4/configuration/chirpstack/region_au915_7.toml new file mode 100644 index 0000000..09c5dba --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_au915_7.toml @@ -0,0 +1,253 @@ +# This file contains an example AU915 example (channels 56-63 + 71). +[[regions]] + + # ID is an use-defined identifier for this region. + id="au915_7" + + # Description is a short description for this region. + description="AU915 (channels 56-63 + 71)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="AU915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="au915_7" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=926400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=926600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=926800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=927000000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=927200000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=927400000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=927600000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=927800000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=927100000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[56, 57, 58, 59, 60, 61, 62, 63, 71] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_0.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_0.toml new file mode 100644 index 0000000..5686f6e --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_0.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 0-7). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_0" + + # Description is a short description for this region. + description="CN470 (channels 0-7)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_0" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=470300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=470500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=470700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=470900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=471100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=471300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=471500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=471700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[0, 1, 2, 3, 4, 5, 6, 7] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_1.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_1.toml new file mode 100644 index 0000000..277b900 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_1.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 8-15). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_1" + + # Description is a short description for this region. + description="CN470 (channels 8-15)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_1" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=471900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=472100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=472300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=472500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=472700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=472900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=473100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=473300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[8, 9, 10, 11, 12, 13, 14, 15] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_10.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_10.toml new file mode 100644 index 0000000..bd02dd1 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_10.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 80-87). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_10" + + # Description is a short description for this region. + description="CN470 (channels 80-87)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_10" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=486300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=486500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=486700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=486900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=487100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=487300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=487500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=487700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[80, 81, 82, 83, 84, 85, 86, 87] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_11.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_11.toml new file mode 100644 index 0000000..fb043c6 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_11.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 88-95). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_11" + + # Description is a short description for this region. + description="CN470 (channels 88-95)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_11" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=487900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=488100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=488300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=488500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=488700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=488900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=489100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=489300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[88, 89, 90, 91, 92, 93, 94, 95] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_2.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_2.toml new file mode 100644 index 0000000..bc30825 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_2.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 16-23). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_2" + + # Description is a short description for this region. + description="CN470 (channels 16-23)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_2" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=473500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=473700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=473900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=474100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=474300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=474500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=474700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=474900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[16, 17, 18, 19, 20, 21, 22, 23] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_3.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_3.toml new file mode 100644 index 0000000..6efc24d --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_3.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 24-31). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_3" + + # Description is a short description for this region. + description="CN470 (channels 24-31)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_3" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=475100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=475300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=475500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=475700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=475900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=476100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=476300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=476500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[24, 25, 26, 27, 28, 29, 30, 31] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_4.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_4.toml new file mode 100644 index 0000000..17f46b8 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_4.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 32-39). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_4" + + # Description is a short description for this region. + description="CN470 (channels 32-39)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_4" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=476700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=476900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=477100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=477300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=477500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=477700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=477900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=478100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[32, 33, 34, 35, 36, 37, 38, 39] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_5.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_5.toml new file mode 100644 index 0000000..75256fd --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_5.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 40-47). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_5" + + # Description is a short description for this region. + description="CN470 (channels 40-47)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_5" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=478300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=478500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=478700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=478900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=479100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=479300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=479500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=479700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[40, 41, 42, 43, 44, 45, 46, 47] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_6.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_6.toml new file mode 100644 index 0000000..b1d6693 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_6.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 48-55). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_6" + + # Description is a short description for this region. + description="CN470 (channels 48-55)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_6" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=479900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=480100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=480300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=480500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=480700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=480900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=481100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=481300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[48, 49, 50, 51, 52, 53, 54, 55] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_7.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_7.toml new file mode 100644 index 0000000..70937cf --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_7.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 56-63). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_7" + + # Description is a short description for this region. + description="CN470 (channels 56-63)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_7" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=481500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=481700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=481900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=482100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=482300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=482500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=482700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=482900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[56, 57, 58, 59, 60, 61, 62, 63] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_8.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_8.toml new file mode 100644 index 0000000..8fcf3b0 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_8.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 64-71). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_8" + + # Description is a short description for this region. + description="CN470 (channels 64-71)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_8" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=483100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=483300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=483500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=483700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=483900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=484100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=484300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=484500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[64, 65, 66, 67, 68, 69, 70, 71] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn470_9.toml b/Chirpstack_v4/configuration/chirpstack/region_cn470_9.toml new file mode 100644 index 0000000..87973f7 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn470_9.toml @@ -0,0 +1,247 @@ +# This file contains an example CN470 example (channels 72-79). +[[regions]] + + # ID is an use-defined identifier for this region. + id="cn470_9" + + # Description is a short description for this region. + description="CN470 (channels 72-79)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN470" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn470_9" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=484700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=484900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=485100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=485300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=485500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=485700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=485900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=486100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=505300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[72, 73, 74, 75, 76, 77, 78, 79] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=2 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_cn779.toml b/Chirpstack_v4/configuration/chirpstack/region_cn779.toml new file mode 100644 index 0000000..94aa163 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_cn779.toml @@ -0,0 +1,210 @@ +# This file contains an example CN779 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="cn779" + + # Description is a short description for this region. + description="CN779" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="CN779" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="cn779" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=779500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=779700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=779900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=786000000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=3 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_eu433.toml b/Chirpstack_v4/configuration/chirpstack/region_eu433.toml new file mode 100644 index 0000000..c471542 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_eu433.toml @@ -0,0 +1,210 @@ +# This file contains an example EU433 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="eu433" + + # Description is a short description for this region. + description="EU443" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="EU433" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="eu433" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=433175000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=433375000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=433575000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=434665000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=3 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_eu868.toml b/Chirpstack_v4/configuration/chirpstack/region_eu868.toml new file mode 100644 index 0000000..af83452 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_eu868.toml @@ -0,0 +1,280 @@ +# This file contains an example EU868 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="eu868" + + # Description is a short description for this region. + description="EU868" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="EU868" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="eu868" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="ssl://$MQTT_BROKER_HOST:8883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="/etc/chirpstack/certs/ca.pem" + + # TLS certificate file (optional) + tls_cert="/etc/chirpstack/certs/client.pem" + + # TLS key file (PKCS#8) (optional) + tls_key="/etc/chirpstack/certs/client.key" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=868100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=868300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=868500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=867100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=867300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=867500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=867700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=867900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=868300000 + bandwidth=250000 + modulation="LORA" + spreading_factors=[7] + + [[regions.gateway.channels]] + frequency=868800000 + bandwidth=125000 + modulation="FSK" + datarate=50000 + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=869525000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=3 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 + + + # Below is the common set of extra channels. Please make sure that these + # channels are also supported by the gateways. + [[regions.network.extra_channels]] + frequency=867100000 + min_dr=0 + max_dr=5 + + [[regions.network.extra_channels]] + frequency=867300000 + min_dr=0 + max_dr=5 + + [[regions.network.extra_channels]] + frequency=867500000 + min_dr=0 + max_dr=5 + + [[regions.network.extra_channels]] + frequency=867700000 + min_dr=0 + max_dr=5 + + [[regions.network.extra_channels]] + frequency=867900000 + min_dr=0 + max_dr=5 diff --git a/Chirpstack_v4/configuration/chirpstack/region_in865.toml b/Chirpstack_v4/configuration/chirpstack/region_in865.toml new file mode 100644 index 0000000..6b0930b --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_in865.toml @@ -0,0 +1,210 @@ +# This file contains an example IN865 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="in865" + + # Description is a short description for this region. + description="IN865" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="IN865" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="in865" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=865062500 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=865402500 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=865985000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=2 + + # RX2 frequency (Hz) + rx2_frequency=866550000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=4 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_ism2400.toml b/Chirpstack_v4/configuration/chirpstack/region_ism2400.toml new file mode 100644 index 0000000..9b37d2d --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_ism2400.toml @@ -0,0 +1,210 @@ +# This file contains an example ISM2400 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="ism2400" + + # Description is a short description for this region. + description="ISM2400" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="ISM2400" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="ism2400" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=2403000000 + bandwidth=812000 + modulation="LORA" + spreading_factors=[12] + + [[regions.gateway.channels]] + frequency=2479000000 + bandwidth=812000 + modulation="LORA" + spreading_factors=[12] + + [[regions.gateway.channels]] + frequency=2425000000 + bandwidth=812000 + modulation="LORA" + spreading_factors=[12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=2423000000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=7 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=0 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_kr920.toml b/Chirpstack_v4/configuration/chirpstack/region_kr920.toml new file mode 100644 index 0000000..c20a9db --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_kr920.toml @@ -0,0 +1,210 @@ +# This file contains an example KR920 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="kr920" + + # Description is a short description for this region. + description="KR920" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="KR920" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="kr920" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=922100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=922300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=922500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=921900000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=3 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_ru864.toml b/Chirpstack_v4/configuration/chirpstack/region_ru864.toml new file mode 100644 index 0000000..071be02 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_ru864.toml @@ -0,0 +1,204 @@ +# This file contains an example RU864 configuration. +[[regions]] + + # ID is an user-defined identifier for this region. + id="ru864" + + # Description is a short description for this region. + description="RU864" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="RU864" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="ru864" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=868900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + [[regions.gateway.channels]] + frequency=869100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10, 11, 12] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=0 + + # RX2 frequency (Hz) + rx2_frequency=869100000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=5 + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=3 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_us915_0.toml b/Chirpstack_v4/configuration/chirpstack/region_us915_0.toml new file mode 100644 index 0000000..0bca96f --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_us915_0.toml @@ -0,0 +1,253 @@ +# This file contains an example US915 example (channels 0-7 + 64). +[[regions]] + + # ID is an use-defined identifier for this region. + id="us915_0" + + # Description is a short description for this region. + description="US915 (channels 0-7 + 64)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="US915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="us915_0" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=902300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=902500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=902700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=902900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=903100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=903300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=903500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=903700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=903000000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=3 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[0, 1, 2, 3, 4, 5, 6, 7, 64] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_us915_1.toml b/Chirpstack_v4/configuration/chirpstack/region_us915_1.toml new file mode 100644 index 0000000..2ed6b3f --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_us915_1.toml @@ -0,0 +1,253 @@ +# This file contains an example US915 example (channels 8-15 + 65). +[[regions]] + + # ID is an use-defined identifier for this region. + id="us915_1" + + # Description is a short description for this region. + description="US915 (channels 8-15 + 65)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="US915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="us915_1" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=903900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=904100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=904300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=904500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=904700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=904900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=905100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=905300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=904600000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=3 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[8, 9, 10, 11, 12, 13, 14, 15, 65] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_us915_2.toml b/Chirpstack_v4/configuration/chirpstack/region_us915_2.toml new file mode 100644 index 0000000..7d906cd --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_us915_2.toml @@ -0,0 +1,253 @@ +# This file contains an example US915 example (channels 16-23 + 66). +[[regions]] + + # ID is an use-defined identifier for this region. + id="us915_2" + + # Description is a short description for this region. + description="US915 (channels 16-23 + 66)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="US915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="us915_2" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=905500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=905700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=905900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=906100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=906300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=906500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=906700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=906900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=906200000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=3 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[16, 17, 18, 19, 20, 21, 22, 23, 66] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_us915_3.toml b/Chirpstack_v4/configuration/chirpstack/region_us915_3.toml new file mode 100644 index 0000000..708e810 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_us915_3.toml @@ -0,0 +1,253 @@ +# This file contains an example US915 example (channels 24-31 + 67). +[[regions]] + + # ID is an use-defined identifier for this region. + id="us915_3" + + # Description is a short description for this region. + description="US915 (channels 24-31 + 67)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="US915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="us915_3" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=907100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=907300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=907500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=907700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=907900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=908100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=908300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=908500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=907800000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=3 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[24, 25, 26, 27, 28, 29, 30, 31, 67] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_us915_4.toml b/Chirpstack_v4/configuration/chirpstack/region_us915_4.toml new file mode 100644 index 0000000..bd0ac39 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_us915_4.toml @@ -0,0 +1,253 @@ +# This file contains an example US915 example (channels 32-39 + 68). +[[regions]] + + # ID is an use-defined identifier for this region. + id="us915_4" + + # Description is a short description for this region. + description="US915 (channels 32-39 + 68)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="US915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="us915_4" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=908700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=908900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=909100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=909300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=909500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=909700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=909900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=910100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=909400000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=3 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[32, 33, 34, 35, 36, 37, 38, 39, 68] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_us915_5.toml b/Chirpstack_v4/configuration/chirpstack/region_us915_5.toml new file mode 100644 index 0000000..3d27aaf --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_us915_5.toml @@ -0,0 +1,253 @@ +# This file contains an example US915 example (channels 40-47 + 69). +[[regions]] + + # ID is an use-defined identifier for this region. + id="us915_5" + + # Description is a short description for this region. + description="US915 (channels 40-47 + 69)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="US915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="us915_5" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=910300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=910500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=910700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=910900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=911100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=911300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=911500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=911700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=911000000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=3 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[40, 41, 42, 43, 44, 45, 46, 47, 69] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_us915_6.toml b/Chirpstack_v4/configuration/chirpstack/region_us915_6.toml new file mode 100644 index 0000000..d02d935 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_us915_6.toml @@ -0,0 +1,253 @@ +# This file contains an example US915 example (channels 48-55 + 70). +[[regions]] + + # ID is an use-defined identifier for this region. + id="us915_6" + + # Description is a short description for this region. + description="US915 (channels 48-55 + 70)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="US915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="us915_6" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=911900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=912100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=912300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=912500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=912700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=912900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=913100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=913300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=912600000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=3 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[48, 49, 50, 51, 52, 53, 54, 55, 70] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/chirpstack/region_us915_7.toml b/Chirpstack_v4/configuration/chirpstack/region_us915_7.toml new file mode 100644 index 0000000..f563ce3 --- /dev/null +++ b/Chirpstack_v4/configuration/chirpstack/region_us915_7.toml @@ -0,0 +1,253 @@ +# This file contains an example US915 example (channels 56-63 + 71). +[[regions]] + + # ID is an use-defined identifier for this region. + id="us915_7" + + # Description is a short description for this region. + description="US915 (channels 56-63 + 71)" + + # Common-name refers to the common-name of this region as defined by + # the LoRa Alliance. + common_name="US915" + + + # Gateway configuration. + [regions.gateway] + + # Force gateways as private. + # + # If enabled, gateways can only be used by devices under the same tenant. + force_gws_private=false + + + # Gateway backend configuration. + [regions.gateway.backend] + + # The enabled backend type. + enabled="mqtt" + + # MQTT configuration. + [regions.gateway.backend.mqtt] + + # Topic prefix. + # + # The topic prefix can be used to define the region of the gateway. + # Note, there is no need to add a trailing '/' to the prefix. The trailing + # '/' is automatically added to the prefix if it is configured. + topic_prefix="us915_7" + + # MQTT server (e.g. scheme://host:port where scheme is tcp, ssl or ws) + server="tcp://$MQTT_BROKER_HOST:1883" + + # Connect with the given username (optional) + username="" + + # Connect with the given password (optional) + password="" + + # Quality of service level + # + # 0: at most once + # 1: at least once + # 2: exactly once + # + # Note: an increase of this value will decrease the performance. + # For more information: https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels + qos=0 + + # Clean session + # + # Set the "clean session" flag in the connect message when this client + # connects to an MQTT broker. By setting this flag you are indicating + # that no messages saved by the broker for this client should be delivered. + clean_session=false + + # Client ID + # + # Set the client id to be used by this client when connecting to the MQTT + # broker. A client id must be no longer than 23 characters. If left blank, + # a random id will be generated by ChirpStack. + client_id="" + + # Keep alive interval. + # + # This defines the maximum time that that should pass without communication + # between the client and server. + keep_alive_interval="30s" + + # CA certificate file (optional) + # + # Use this when setting up a secure connection (when server uses ssl://...) + # but the certificate used by the server is not trusted by any CA certificate + # on the server (e.g. when self generated). + ca_cert="" + + # TLS certificate file (optional) + tls_cert="" + + # TLS key file (optional) + tls_key="" + + + # Gateway channel configuration. + # + # Note: this configuration is only used in case the gateway is using the + # ChirpStack Concentratord daemon. In any other case, this configuration + # is ignored. + [[regions.gateway.channels]] + frequency=913500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=913700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=913900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=914100000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=914300000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=914500000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=914700000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=914900000 + bandwidth=125000 + modulation="LORA" + spreading_factors=[7, 8, 9, 10] + + [[regions.gateway.channels]] + frequency=914200000 + bandwidth=500000 + modulation="LORA" + spreading_factors=[8] + + + # Region specific network configuration. + [regions.network] + + # Installation margin (dB) used by the ADR engine. + # + # A higher number means that the network-server will keep more margin, + # resulting in a lower data-rate but decreasing the chance that the + # device gets disconnected because it is unable to reach one of the + # surrounded gateways. + installation_margin=10 + + # RX window (Class-A). + # + # Set this to: + # 0: RX1 / RX2 + # 1: RX1 only + # 2: RX2 only + rx_window=0 + + # RX1 delay (1 - 15 seconds). + rx1_delay=1 + + # RX1 data-rate offset + rx1_dr_offset=0 + + # RX2 data-rate + rx2_dr=8 + + # RX2 frequency (Hz) + rx2_frequency=923300000 + + # Prefer RX2 on RX1 data-rate less than. + # + # Prefer RX2 over RX1 based on the RX1 data-rate. When the RX1 data-rate + # is smaller than the configured value, then the Network Server will + # first try to schedule the downlink for RX2, failing that (e.g. the gateway + # has already a payload scheduled at the RX2 timing) it will try RX1. + rx2_prefer_on_rx1_dr_lt=0 + + # Prefer RX2 on link budget. + # + # When the link-budget is better for RX2 than for RX1, the Network Server will first + # try to schedule the downlink in RX2, failing that it will try RX1. + rx2_prefer_on_link_budget=false + + # Downlink TX Power (dBm) + # + # When set to -1, the downlink TX Power from the configured band will + # be used. + # + # Please consult the LoRaWAN Regional Parameters and local regulations + # for valid and legal options. Note that the configured TX Power must be + # supported by your gateway(s). + downlink_tx_power=-1 + + # ADR is disabled. + adr_disabled=false + + # Minimum data-rate. + min_dr=0 + + # Maximum data-rate. + max_dr=3 + + # Enabled uplink channels. + # + # Use this when ony a sub-set of the by default enabled channels are being + # used. For example when only using the first 8 channels of the US band. + # Note: when left blank / empty array, all channels will be enabled. + enabled_uplink_channels=[56, 57, 58, 59, 60, 61, 62, 63, 71] + + + # Rejoin-request configuration (LoRaWAN 1.1) + [regions.network.rejoin_request] + + # Request devices to periodically send rejoin-requests. + enabled=false + + # The device must send a rejoin-request type 0 at least every 2^(max_count_n + 4) + # uplink messages. Valid values are 0 to 15. + max_count_n=0 + + # The device must send a rejoin-request type 0 at least every 2^(max_time_n + 10) + # seconds. Valid values are 0 to 15. + # + # 0 = roughly 17 minutes + # 15 = about 1 year + max_time_n=0 + + + # Class-B configuration. + [regions.network.class_b] + + # Ping-slot data-rate. + ping_slot_dr=8 + + # Ping-slot frequency (Hz) + # + # set this to 0 to use the default frequency plan for the configured region + # (which could be frequency hopping). + ping_slot_frequency=0 diff --git a/Chirpstack_v4/configuration/mosquitto/config/mosquitto.conf b/Chirpstack_v4/configuration/mosquitto/config/mosquitto.conf new file mode 100644 index 0000000..2d040f2 --- /dev/null +++ b/Chirpstack_v4/configuration/mosquitto/config/mosquitto.conf @@ -0,0 +1,13 @@ +# listener 1883 +# allow_anonymous true + +listener 8883 +protocol mqtt + +cafile /mosquitto/certs/ca.pem +certfile /mosquitto/certs/server.pem +keyfile /mosquitto/certs/server.key + +require_certificate true # enforce client cert +use_identity_as_username true # CN becomes MQTT username +allow_anonymous true # optional: false for strict auth diff --git a/Chirpstack_v4/configuration/postgresql/initdb/001-chirpstack_extensions.sh b/Chirpstack_v4/configuration/postgresql/initdb/001-chirpstack_extensions.sh new file mode 100755 index 0000000..4028a2d --- /dev/null +++ b/Chirpstack_v4/configuration/postgresql/initdb/001-chirpstack_extensions.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="$POSTGRES_DB" <<-EOSQL + create extension pg_trgm; + create extension hstore; +EOSQL diff --git a/Chirpstack_v4/docker-compose.yml b/Chirpstack_v4/docker-compose.yml new file mode 100644 index 0000000..ebca3db --- /dev/null +++ b/Chirpstack_v4/docker-compose.yml @@ -0,0 +1,109 @@ +version: '3.0' + +services: + chirpstack: + image: chirpstack/chirpstack:4 + command: -c /etc/chirpstack + restart: unless-stopped + networks: + pagerino_net: + chirp_net: + volumes: + - ./configuration/chirpstack:/etc/chirpstack + - ./certs:/etc/chirpstack/certs + depends_on: + - postgres + - mosquitto + - redis + environment: + - MQTT_BROKER_HOST=mosquitto + - REDIS_HOST=redis + - POSTGRESQL_HOST=postgres + - RUST_LOG=debug + ports: + - "8080:8080" + + chirpstack-gateway-bridge: + image: chirpstack/chirpstack-gateway-bridge:4 + restart: unless-stopped + networks: + chirp_net: + ports: + - "1700:1700/udp" + volumes: + - ./configuration/chirpstack-gateway-bridge:/etc/chirpstack-gateway-bridge + - ./certs:/etc/chirpstack-gateway-bridge/certs + environment: + - INTEGRATION__MQTT__EVENT_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/event/{{ .EventType }} + - INTEGRATION__MQTT__STATE_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/state/{{ .StateType }} + - INTEGRATION__MQTT__COMMAND_TOPIC_TEMPLATE=eu868/gateway/{{ .GatewayID }}/command/# + depends_on: + - mosquitto + + # chirpstack-gateway-bridge-basicstation: + # image: chirpstack/chirpstack-gateway-bridge:4 + # restart: 'no' + # networks: + # chirp_net: + # command: -c /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge-basicstation-eu868.toml + # ports: + # - "3001:3001" + # volumes: + # - ./configuration/chirpstack-gateway-bridge:/etc/chirpstack-gateway-bridge + # - ./certs:/etc/chirpstack-gateway-bridge/certs + # depends_on: + # - mosquitto + + chirpstack-rest-api: + image: chirpstack/chirpstack-rest-api:4 + restart: unless-stopped + networks: + chirp_net: + command: --server chirpstack:8080 --bind 0.0.0.0:8090 --insecure + ports: + - "8090:8090" + depends_on: + - chirpstack + + postgres: + image: postgres:14-alpine + restart: unless-stopped + networks: + chirp_net: + volumes: + - ./configuration/postgresql/initdb:/docker-entrypoint-initdb.d + - postgresqldata:/var/lib/postgresql/data + environment: + - POSTGRES_USER=chirpstack + - POSTGRES_PASSWORD=chirpstack + - POSTGRES_DB=chirpstack + + redis: + image: redis:7-alpine + restart: unless-stopped + networks: + chirp_net: + command: redis-server --save 300 1 --save 60 100 --appendonly no + volumes: + - redisdata:/data + + mosquitto: + image: eclipse-mosquitto:2 + restart: unless-stopped + networks: + pagerino_net: + chirp_net: + ports: + - "8883:8883" + volumes: + - ./configuration/mosquitto/config/:/mosquitto/config/ + - ./certs:/mosquitto/certs + +volumes: + postgresqldata: + redisdata: + +networks: + pagerino_net: + external: true + chirp_net: diff --git a/Chirpstack_v4/tarball.tar.gz b/Chirpstack_v4/tarball.tar.gz new file mode 100644 index 0000000..88236b9 Binary files /dev/null and b/Chirpstack_v4/tarball.tar.gz differ diff --git a/WebApp/.env b/WebApp/.env new file mode 100644 index 0000000..8280d19 --- /dev/null +++ b/WebApp/.env @@ -0,0 +1,36 @@ +# Enviroment variables that will be available for every application + +# General version of the system +VERSION=0.1 + +# Optional prefix for logging +LOG_PREFIX=[Pagerino] + +# Main app container name +SERVER_NAME=pagerino-app +SERVER_API_PORT=50222 + +# General preferred connection timeout +TIMEOUT=3s + +WS_NAME=send +WS_TIMEOUT=3s +WS_SIZE=512 +CROSS_ORIGINS= # CSV format for all URLs that can communicate with web app + +# === Basic +APP_NAME=Pagerino +LOG_PREFIX=[Pagerino Web] + +DEV_MODE=true + +# === Host settings +WEB_PORT=8222 + +# === UX configs +HOME_NAME=dashboard # Leave empty for default "/" +SESSION_DURATION=12h # one authorization duration + + +# === Secets & keys +JWT_SECRET=7jkNtpI4mM2QSW23ZILh2z6v0+gvKadNXi8I8jThiHU= diff --git a/WebApp/Dockerfile b/WebApp/Dockerfile new file mode 100755 index 0000000..3e2830d --- /dev/null +++ b/WebApp/Dockerfile @@ -0,0 +1,35 @@ +# [0] Go build environment +FROM golang:1.24.5-alpine3.21 AS builder +WORKDIR /web-server + +## Dependencies +# Get +COPY ./src/main/go.mod ./src/main/go.sum ./src/ +# Download +RUN cd ./src && \ + go mod download + +## Executable +# Get +COPY ./src/main/ ./src/ +# Build +RUN cd ./src && \ + go build -o ../build/web_server + +# [1] Final image -> new FS +FROM alpine:latest +WORKDIR /root/ + +# Add certs for net communication +RUN apk add --no-cache ca-certificates + +## Final build +# Get +COPY --from=builder /web-server/build ./build/ +COPY ./build/stylesheet.css ./layouts/ +COPY ./src/layouts ./layouts/ +COPY ./config ./config/ +COPY ./shared.env ./config/shared.env + +# Run +CMD ["./build/web_server"] diff --git a/WebApp/LICENCE b/WebApp/LICENCE new file mode 100644 index 0000000..8b98c19 --- /dev/null +++ b/WebApp/LICENCE @@ -0,0 +1,38 @@ +PAGERINO(tm) WEB APPLICATION LICENSE AGREEMENT + +1. Parties & Purpose +This License Agreement (“Agreement”) is entered into between GORAK Industries s.r.o., hereinafter “Licensor,” and [Client Name], hereinafter “Licensee,” for the use of the proprietary web application (“Software”) designed to work with specific provided and configured devices for the Pagerino(tm) system ("Devices"). + +2. Intended Use +The Software is designed for operation within a private local area network environment ("Environment") together with Devices and optimized for use in such a setting. If the Licensee chooses to expose the Software to external networks, use unathorized devices, use any parts of the Pagerino(tm) system in undocumented ways, the Licensee assumes full responsibility for any resulting risks, data breaches, performance degradation, or service interruptions. The Licensor is not liable for damages or losses arising from such use. + +3. Rights Granted +Licensee may install and run the Software on approved internal servers and grant access to Licensee's authorized employees. Backup copies may be made for disaster recovery only. No rights are granted to modify, reverse-engineer, redistribute, rent, lease, or sublicense the Software. + +4. Ownership +All intellectual property rights, including source code, remain the sole property of the Licensor. This Agreement does not transfer ownership of the Software or any associated rights, except the limited right to use as stated herein. + +5. Fees and Support +The license fee covers the right to use the Software in its delivered state. Updates, upgrades, enhancements, and technical support are not included in the license fee and will be provided only under separate agreements and at prices determined by the Licensor’s company at the time of service. The Licensor is not obliged to provide updates or support unless explicitly agreed in writing. + +6. Limitations + + The Software’s performance and accuracy depend on the network environment and the connected devices’ compliance with supported protocols. + + The Licensor is not liable for malfunctions caused by third-party hardware, network configuration errors, incompatible devices, or environmental factors outside its control. + + In case of system relocation, hardware replacement, or major infrastructure changes, reinstallation or reconfiguration support is considered a billable service. + + If the Licensee modifies the Software without authorization, the Licensor may terminate the Agreement immediately. + +7. Liability +The Software is provided “as-is.” To the maximum extent permitted under Czech law, the Licensor disclaims all warranties, whether express or implied, including fitness for a particular purpose. The Licensor’s liability for damages is limited to the amount actually paid for the license. Indirect, incidental, or consequential damages (including downtime, lost profits, or data loss) are excluded. + +8. Term & Termination +This license is granted as perpetual, allowing the Licensee to use the Software for an unlimited time, subject to compliance with this Agreement. The Licensee’s right to use the Software may be terminated by the Licensor only if the Licensee breaches the terms of this Agreement. Upon termination, the Licensee must cease all use of the Software and destroy all copies in its possession. + +9. Governing Law & Jurisdiction +This Agreement is governed by the laws of the Czech Republic. Any disputes will be resolved before the courts of Brno. + +10. Language & Final Provisions +This Agreement may be provided in multiple languages. In case of discrepancies, the Czech version shall prevail. This document contains the entire agreement between the parties concerning the Software. \ No newline at end of file diff --git a/WebApp/Makefile b/WebApp/Makefile new file mode 100644 index 0000000..ae3a79e --- /dev/null +++ b/WebApp/Makefile @@ -0,0 +1,23 @@ +# Variables +CSS_INPUT:=./src/layouts/styles/global.css +CSS_OUTPUT:=./build/stylesheet.css +NAME:=web-app + +all: css + +# Build Tailwind +css: ./src/layouts/**/*.css ./src/layouts/**/*.tmpl + npx tailwindcss -i $(CSS_INPUT) -o $(CSS_OUTPUT) --minify + +# Build App +go: ./src/main/*.go + go build -o ./build/$(NAME) ./src/main.go + +run: css go + ./build/$(NAME) + +# Clear build +clean: + rm -rf ./build/$(NAME) ./build/stylesheet.css + +.PHONY: run clean all \ No newline at end of file diff --git a/WebApp/README.md b/WebApp/README.md new file mode 100644 index 0000000..d59e62b --- /dev/null +++ b/WebApp/README.md @@ -0,0 +1,29 @@ +# Pagerino: **Web server** + +### Description + +Dockerized server communicating with Pagerino applications to provide an interface. + +### Features + +Current working and in-progress capabilities include: + - list all devices + - add/modify/remove users, devices, roles and other objects + - see user, device, role and other's properties + - see live map view of devices + +### Usage + +The web app connects to other Pagerino applications after user authorization, +so all of the accessed apps have to be running and reachable. + +First build the Tailwind css: +```make css``` + +Then to start the server with docker: +```docker compose up``` + +Alternatively you can just run it normally: +```make go && make run``` + +*Created by Olek \@ Gorak Industries* diff --git a/WebApp/build/stylesheet.css b/WebApp/build/stylesheet.css new file mode 100644 index 0000000..3358cbe --- /dev/null +++ b/WebApp/build/stylesheet.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-gray-100:oklch(96.7% .003 264.542);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-900:oklch(21% .034 264.665);--color-white:#fff;--spacing:.25rem;--container-7xl:80rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.fixed{position:fixed}.top-0{top:calc(var(--spacing)*0)}.z-50{z-index:50}.mx-auto{margin-inline:auto}.mt-8{margin-top:calc(var(--spacing)*8)}.mt-12{margin-top:calc(var(--spacing)*12)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.ml-2{margin-left:calc(var(--spacing)*2)}.flex{display:flex}.hidden{display:none}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-12{height:calc(var(--spacing)*12)}.w-6{width:calc(var(--spacing)*6)}.w-full{width:100%}.max-w-7xl{max-width:var(--container-7xl)}.flex-1{flex:1}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*4)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-6>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*6)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-x-reverse)))}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-gray-700{border-color:var(--color-gray-700)}.bg-\[var\(--primary-bg\)\]{background-color:var(--primary-bg)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-900{background-color:var(--color-gray-900)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-10{padding-block:calc(var(--spacing)*10)}.pt-6{padding-top:calc(var(--spacing)*6)}.text-center{text-align:center}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-\[var\(--accent\)\]{color:var(--accent)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.text-gray-300{color:var(--color-gray-300)}.text-gray-500{color:var(--color-gray-500)}.text-white{color:var(--color-white)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}@media (hover:hover){.hover\:text-\[var\(--accent\)\]:hover{color:var(--accent)}.hover\:text-\[var\(--accent-light\)\]:hover{color:var(--accent-light)}.hover\:underline:hover{text-decoration-line:underline}}@media (min-width:48rem){.md\:flex{display:flex}.md\:hidden{display:none}.md\:h-10{height:calc(var(--spacing)*10)}.md\:h-16{height:calc(var(--spacing)*16)}.md\:flex-row{flex-direction:row}.md\:justify-between{justify-content:space-between}.md\:py-3{padding-block:calc(var(--spacing)*3)}.md\:py-4{padding-block:calc(var(--spacing)*4)}.md\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}}}:root{--color-bg:#f8f9fa;--color-bg-alt:#e9ecef;--color-surface:#111213;--color-surface-alt:#1c1d1f;--color-text:#111213;--color-text-muted:#555;--color-text-inverse:#f8f9fa;--color-accent:#4f46e5;--color-accent-hover:#6366f1;--color-accent-muted:#818cf8;--color-success:#22c55e;--color-warning:#eab308;--color-danger:#ef4444}body{background-color:var(--color-bg);color:var(--color-text);margin:0;font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;line-height:1.6}a{color:var(--color-accent);text-decoration:none;transition:color .2s}a:hover{color:var(--color-accent-hover);text-decoration:underline}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false} \ No newline at end of file diff --git a/WebApp/docker-compose.yml b/WebApp/docker-compose.yml new file mode 100644 index 0000000..eb406c3 --- /dev/null +++ b/WebApp/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.0' + +services: + web_server: + build: . + container_name: web_server + networks: + pagerino_net: + restart: on-failure:3 + +networks: + pagerino_net: + external: true \ No newline at end of file diff --git a/WebApp/package-lock.json b/WebApp/package-lock.json new file mode 100644 index 0000000..9928eaa --- /dev/null +++ b/WebApp/package-lock.json @@ -0,0 +1,1133 @@ +{ + "name": "WebApp", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "@tailwindcss/cli": "^4.1.12", + "tailwindcss": "^4.1.12" + } + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.30", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.30.tgz", + "integrity": "sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@parcel/watcher": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", + "integrity": "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.5.1", + "@parcel/watcher-darwin-arm64": "2.5.1", + "@parcel/watcher-darwin-x64": "2.5.1", + "@parcel/watcher-freebsd-x64": "2.5.1", + "@parcel/watcher-linux-arm-glibc": "2.5.1", + "@parcel/watcher-linux-arm-musl": "2.5.1", + "@parcel/watcher-linux-arm64-glibc": "2.5.1", + "@parcel/watcher-linux-arm64-musl": "2.5.1", + "@parcel/watcher-linux-x64-glibc": "2.5.1", + "@parcel/watcher-linux-x64-musl": "2.5.1", + "@parcel/watcher-win32-arm64": "2.5.1", + "@parcel/watcher-win32-ia32": "2.5.1", + "@parcel/watcher-win32-x64": "2.5.1" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz", + "integrity": "sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz", + "integrity": "sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz", + "integrity": "sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz", + "integrity": "sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz", + "integrity": "sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz", + "integrity": "sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz", + "integrity": "sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz", + "integrity": "sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz", + "integrity": "sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz", + "integrity": "sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz", + "integrity": "sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz", + "integrity": "sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz", + "integrity": "sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@tailwindcss/cli": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/cli/-/cli-4.1.12.tgz", + "integrity": "sha512-2PyJ5MGh/6JPS+cEaAq6MGDx3UemkX/mJt+/phm7/VOpycpecwNnHuFZbbgx6TNK/aIjvFOhhTVlappM7tmqvQ==", + "license": "MIT", + "dependencies": { + "@parcel/watcher": "^2.5.1", + "@tailwindcss/node": "4.1.12", + "@tailwindcss/oxide": "4.1.12", + "enhanced-resolve": "^5.18.3", + "mri": "^1.2.0", + "picocolors": "^1.1.1", + "tailwindcss": "4.1.12" + }, + "bin": { + "tailwindcss": "dist/index.mjs" + } + }, + "node_modules/@tailwindcss/node": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.12.tgz", + "integrity": "sha512-3hm9brwvQkZFe++SBt+oLjo4OLDtkvlE8q2WalaD/7QWaeM7KEJbAiY/LJZUaCs7Xa8aUu4xy3uoyX4q54UVdQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "enhanced-resolve": "^5.18.3", + "jiti": "^2.5.1", + "lightningcss": "1.30.1", + "magic-string": "^0.30.17", + "source-map-js": "^1.2.1", + "tailwindcss": "4.1.12" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.12.tgz", + "integrity": "sha512-gM5EoKHW/ukmlEtphNwaGx45fGoEmP10v51t9unv55voWh6WrOL19hfuIdo2FjxIaZzw776/BUQg7Pck++cIVw==", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.4", + "tar": "^7.4.3" + }, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.1.12", + "@tailwindcss/oxide-darwin-arm64": "4.1.12", + "@tailwindcss/oxide-darwin-x64": "4.1.12", + "@tailwindcss/oxide-freebsd-x64": "4.1.12", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.12", + "@tailwindcss/oxide-linux-arm64-gnu": "4.1.12", + "@tailwindcss/oxide-linux-arm64-musl": "4.1.12", + "@tailwindcss/oxide-linux-x64-gnu": "4.1.12", + "@tailwindcss/oxide-linux-x64-musl": "4.1.12", + "@tailwindcss/oxide-wasm32-wasi": "4.1.12", + "@tailwindcss/oxide-win32-arm64-msvc": "4.1.12", + "@tailwindcss/oxide-win32-x64-msvc": "4.1.12" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.12.tgz", + "integrity": "sha512-oNY5pq+1gc4T6QVTsZKwZaGpBb2N1H1fsc1GD4o7yinFySqIuRZ2E4NvGasWc6PhYJwGK2+5YT1f9Tp80zUQZQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.12.tgz", + "integrity": "sha512-cq1qmq2HEtDV9HvZlTtrj671mCdGB93bVY6J29mwCyaMYCP/JaUBXxrQQQm7Qn33AXXASPUb2HFZlWiiHWFytw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.12.tgz", + "integrity": "sha512-6UCsIeFUcBfpangqlXay9Ffty9XhFH1QuUFn0WV83W8lGdX8cD5/+2ONLluALJD5+yJ7k8mVtwy3zMZmzEfbLg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.12.tgz", + "integrity": "sha512-JOH/f7j6+nYXIrHobRYCtoArJdMJh5zy5lr0FV0Qu47MID/vqJAY3r/OElPzx1C/wdT1uS7cPq+xdYYelny1ww==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.12.tgz", + "integrity": "sha512-v4Ghvi9AU1SYgGr3/j38PD8PEe6bRfTnNSUE3YCMIRrrNigCFtHZ2TCm8142X8fcSqHBZBceDx+JlFJEfNg5zQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.12.tgz", + "integrity": "sha512-YP5s1LmetL9UsvVAKusHSyPlzSRqYyRB0f+Kl/xcYQSPLEw/BvGfxzbH+ihUciePDjiXwHh+p+qbSP3SlJw+6g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.12.tgz", + "integrity": "sha512-V8pAM3s8gsrXcCv6kCHSuwyb/gPsd863iT+v1PGXC4fSL/OJqsKhfK//v8P+w9ThKIoqNbEnsZqNy+WDnwQqCA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.12.tgz", + "integrity": "sha512-xYfqYLjvm2UQ3TZggTGrwxjYaLB62b1Wiysw/YE3Yqbh86sOMoTn0feF98PonP7LtjsWOWcXEbGqDL7zv0uW8Q==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.12.tgz", + "integrity": "sha512-ha0pHPamN+fWZY7GCzz5rKunlv9L5R8kdh+YNvP5awe3LtuXb5nRi/H27GeL2U+TdhDOptU7T6Is7mdwh5Ar3A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.12.tgz", + "integrity": "sha512-4tSyu3dW+ktzdEpuk6g49KdEangu3eCYoqPhWNsZgUhyegEda3M9rG0/j1GV/JjVVsj+lG7jWAyrTlLzd/WEBg==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.4.5", + "@emnapi/runtime": "^1.4.5", + "@emnapi/wasi-threads": "^1.0.4", + "@napi-rs/wasm-runtime": "^0.2.12", + "@tybys/wasm-util": "^0.10.0", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.12.tgz", + "integrity": "sha512-iGLyD/cVP724+FGtMWslhcFyg4xyYyM+5F4hGvKA7eifPkXHRAUDFaimu53fpNg9X8dfP75pXx/zFt/jlNF+lg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.12.tgz", + "integrity": "sha512-NKIh5rzw6CpEodv/++r0hGLlfgT/gFN+5WNdZtvh6wpU2BpGNgdjvj6H2oFc8nCM839QM1YOhjpgbAONUb4IxA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide/node_modules/detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "license": "Apache-2.0", + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.18.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz", + "integrity": "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/jiti": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz", + "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==", + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/lightningcss": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.1.tgz", + "integrity": "sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg==", + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-darwin-arm64": "1.30.1", + "lightningcss-darwin-x64": "1.30.1", + "lightningcss-freebsd-x64": "1.30.1", + "lightningcss-linux-arm-gnueabihf": "1.30.1", + "lightningcss-linux-arm64-gnu": "1.30.1", + "lightningcss-linux-arm64-musl": "1.30.1", + "lightningcss-linux-x64-gnu": "1.30.1", + "lightningcss-linux-x64-musl": "1.30.1", + "lightningcss-win32-arm64-msvc": "1.30.1", + "lightningcss-win32-x64-msvc": "1.30.1" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.1.tgz", + "integrity": "sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.1.tgz", + "integrity": "sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.1.tgz", + "integrity": "sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.1.tgz", + "integrity": "sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.1.tgz", + "integrity": "sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.1.tgz", + "integrity": "sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz", + "integrity": "sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.1.tgz", + "integrity": "sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.1.tgz", + "integrity": "sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.1.tgz", + "integrity": "sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss/node_modules/detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minizlib": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", + "license": "MIT", + "dependencies": { + "minipass": "^7.1.2" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tailwindcss": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.12.tgz", + "integrity": "sha512-DzFtxOi+7NsFf7DBtI3BJsynR+0Yp6etH+nRPTbpWnS2pZBaSksv/JGctNwSWzbFjp0vxSqknaUylseZqMDGrA==", + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz", + "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + } + } +} diff --git a/WebApp/package.json b/WebApp/package.json new file mode 100644 index 0000000..7714e6c --- /dev/null +++ b/WebApp/package.json @@ -0,0 +1,6 @@ +{ + "dependencies": { + "@tailwindcss/cli": "^4.1.12", + "tailwindcss": "^4.1.12" + } +} diff --git a/WebApp/page_list.md b/WebApp/page_list.md new file mode 100755 index 0000000..492830b --- /dev/null +++ b/WebApp/page_list.md @@ -0,0 +1,19 @@ +## List of pages for web app: +- Network page: + - List of devices + one gate: expandable device info in vertical layout + link to device page + - Search function with filters +- Live map view: clickable devices linking to their page +- Device page: + - Full overview of device's properties and history logs + - *Can message, assign task and ping device?* +- Account page: + - Properties + - Name & password change + - 2FA + - Account deletion +- Home/Personal page: + - Assigned device & card status + - Recent messages, mentions, tasks, logs + - *Provides interface to send messages remotely through web?* +- Analytics: Displays various insights about daily work & communication like: messages sent, tasks assigned/in-progress/completed... +- Console attachment: at the bottom of any page if role is Admin diff --git a/WebApp/src/layouts/components/footer.tmpl b/WebApp/src/layouts/components/footer.tmpl new file mode 100644 index 0000000..8e2b08d --- /dev/null +++ b/WebApp/src/layouts/components/footer.tmpl @@ -0,0 +1,44 @@ +{{ define "footer" -}} + +{{- end }} diff --git a/WebApp/src/layouts/components/meta.tmpl b/WebApp/src/layouts/components/meta.tmpl new file mode 100644 index 0000000..ea47f5f --- /dev/null +++ b/WebApp/src/layouts/components/meta.tmpl @@ -0,0 +1,8 @@ +{{ define "meta" -}} +{{ .meta.Title }} + + + + +{{- end }} \ No newline at end of file diff --git a/WebApp/src/layouts/components/navbar.tmpl b/WebApp/src/layouts/components/navbar.tmpl new file mode 100644 index 0000000..9eacf70 --- /dev/null +++ b/WebApp/src/layouts/components/navbar.tmpl @@ -0,0 +1,69 @@ +{{ define "navbar" }} + + + +{{ end }} \ No newline at end of file diff --git a/WebApp/src/layouts/index.tmpl b/WebApp/src/layouts/index.tmpl new file mode 100644 index 0000000..2b1d4fe --- /dev/null +++ b/WebApp/src/layouts/index.tmpl @@ -0,0 +1,51 @@ +{{ define "layout" }} + + + + + + + + + + {{ template "meta" . }} + + + {{ template "navbar" . }} +
+ {{ template "content" . }} +
+
+ {{ template "footer" . }} +
+ + + + +{{ end }} \ No newline at end of file diff --git a/WebApp/src/layouts/pages/home.tmpl b/WebApp/src/layouts/pages/home.tmpl new file mode 100644 index 0000000..73c37e8 --- /dev/null +++ b/WebApp/src/layouts/pages/home.tmpl @@ -0,0 +1,5 @@ +{{ define "content" -}} +

+ Hello, Pagerino User! +

+{{- end }} \ No newline at end of file diff --git a/WebApp/src/layouts/pages/login.tmpl b/WebApp/src/layouts/pages/login.tmpl new file mode 100644 index 0000000..4e1cf59 --- /dev/null +++ b/WebApp/src/layouts/pages/login.tmpl @@ -0,0 +1,11 @@ +{{ define "content" -}} +
+ + + + + + + +
+{{- end }} \ No newline at end of file diff --git a/WebApp/src/layouts/styles/global.css b/WebApp/src/layouts/styles/global.css new file mode 100644 index 0000000..34efc60 --- /dev/null +++ b/WebApp/src/layouts/styles/global.css @@ -0,0 +1,79 @@ +@import "tailwindcss"; + +/* Global theme variables */ +:root { + /* Core palette */ + --color-bg: #f8f9fa; /* main background (soft white) */ + --color-bg-alt: #e9ecef; /* alternate background (slightly darker gray) */ + --color-surface: #111213; /* text surfaces or headers */ + --color-surface-alt: #1c1d1f; + + /* Accent tones */ + --color-text: #111213; /* main text (almost black) */ + --color-text-muted: #555; /* muted text (medium gray) */ + --color-text-inverse: #f8f9fa; /* for buttons on dark backgrounds */ + + /* Feedback tones */ + --color-accent: #4f46e5; /* indigo-ish */ + --color-accent-hover: #6366f1; + --color-accent-muted: #818cf8; + + --color-success: #22c55e; /* green-500 */ + --color-warning: #eab308; /* yellow-500 */ + --color-danger: #ef4444; /* red-500 */ +} + +/* Base reset / typography */ +body { + margin: 0; + font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; + background-color: var(--color-bg); + color: var(--color-text); + line-height: 1.6; +} + +/* Links */ +a { + color: var(--color-accent); + text-decoration: none; + transition: color 0.2s ease; +} +a:hover { + color: var(--color-accent-hover); + text-decoration: underline; +} + +/* Muted text */ +/* .text-muted { + color: var(--color-text-muted); +} */ + +/* Card-like containers */ +/* .card { + background-color: var(--color-bg-alt); + border-radius: 0.75rem; + padding: 1rem; + box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); +} */ + +/* Buttons */ +/* .btn { + display: inline-block; + padding: 0.5rem 1rem; + border-radius: 0.5rem; + font-weight: 500; + text-align: center; + cursor: pointer; + background-color: var(--color-accent); + color: var(--color-text); + transition: background-color 0.2s ease; +} + +.btn:hover { + background-color: var(--color-accent-hover); +} + +.btn-muted { + background-color: var(--color-bg-alt); + color: var(--color-text-muted); +} */ \ No newline at end of file diff --git a/WebApp/src/main/go.mod b/WebApp/src/main/go.mod new file mode 100644 index 0000000..5e3011d --- /dev/null +++ b/WebApp/src/main/go.mod @@ -0,0 +1,48 @@ +module pagerino-web + +go 1.23.0 + +toolchain go1.24.6 + +require ( + github.com/gin-gonic/gin v1.10.1 + github.com/joho/godotenv v1.5.1 +) + +require ( + github.com/kr/pretty v0.3.0 // indirect + github.com/rogpeppe/go-internal v1.14.1 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect +) + +require ( + github.com/bytedance/sonic v1.11.6 // indirect + github.com/bytedance/sonic/loader v0.1.1 // indirect + github.com/cloudwego/base64x v0.1.4 // indirect + github.com/cloudwego/iasm v0.2.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.20.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.2.7 // indirect + github.com/leodido/go-urn v1.4.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.2.2 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.12 // indirect + golang.org/x/arch v0.8.0 // indirect + golang.org/x/crypto v0.39.0 + golang.org/x/net v0.41.0 // indirect + golang.org/x/sys v0.33.0 // indirect + golang.org/x/text v0.26.0 // indirect + google.golang.org/grpc v1.75.0 + google.golang.org/protobuf v1.36.6 + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/WebApp/src/main/go.sum b/WebApp/src/main/go.sum new file mode 100644 index 0000000..c0dc62f --- /dev/null +++ b/WebApp/src/main/go.sum @@ -0,0 +1,132 @@ +github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= +github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= +github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= +github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU= +github.com/cloudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y= +github.com/cloudwego/base64x v0.1.4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w= +github.com/cloudwego/iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg= +github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= +github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= +github.com/gin-gonic/gin v1.10.1 h1:T0ujvqyCSqRopADpgPgiTT63DUQVSfojyME59Ei63pQ= +github.com/gin-gonic/gin v1.10.1/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8= +github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= +github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ= +github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= +github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE= +github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= +go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ= +go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I= +go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE= +go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E= +go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI= +go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg= +go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc= +go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps= +go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4= +go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= +golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw= +golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 h1:pFyd6EwwL2TqFf8emdthzeX+gZE1ElRq3iM8pui4KBY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/grpc v1.75.0 h1:+TW+dqTd2Biwe6KKfhE5JpiYIBWq865PhKGSXiivqt4= +google.golang.org/grpc v1.75.0/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ= +google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/WebApp/src/main/main.go b/WebApp/src/main/main.go new file mode 100644 index 0000000..e38425b --- /dev/null +++ b/WebApp/src/main/main.go @@ -0,0 +1,271 @@ +/* +Pagerino web application designed for management and various +views of devices and system-related data. +Author: Olek +*/ +package main + +import ( + "log" + "os" + "os/signal" + "strings" + "syscall" + "time" + + api_common "pagerino-web/pager_api/common" + api_user "pagerino-web/pager_api/user" + + "github.com/joho/godotenv" + "google.golang.org/grpc" + + "github.com/golang-jwt/jwt/v5" + "golang.org/x/crypto/bcrypt" + + "net/http" + + "github.com/gin-gonic/gin" +) + +// App objects and data needed througout the program +type AppData struct { + ExitSig chan os.Signal + ApiUserClient api_user.UserServiceClient + Timeout time.Duration +} + +func (data *AppData) FindEnv(name string) string { + val := os.Getenv(name) + if val == "" { + log.Println("Missing config value for: " + name) + data.ExitSig <- os.Interrupt + log.Fatalln("Shutting down...") + } + + return val +} + +// === Server Render Data === + +// Basic User information +type UserData struct { + Name string + ID int64 + Authorized bool +} + +// Webpage metadata +type PageMeta struct { + Title string + Description string + IconFile string +} + +// === Utilities === + +// Shortcut to get split up URL from *gin.Context +func SplitPath(ctx *gin.Context) []string { + return strings.Split(ctx.Request.URL.EscapedPath(), "/") +} + +// === Helpers === + +// GenerateToken creates a signed JWT for a user +func GenerateToken(username string) (string, error) { + expiration, err := time.ParseDuration(os.Getenv("SESSION_DURATION")) + if err != nil { + return "", err + } + + now := time.Now() + + token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.RegisteredClaims{ + Subject: username, + ExpiresAt: jwt.NewNumericDate(now.Add(expiration)), + IssuedAt: jwt.NewNumericDate(now), + Issuer: os.Getenv("APP_NAME"), + }) + return token.SignedString(os.Getenv("JWT_SECRET")) +} + +// CheckAuth aborts with 401 if JWT is invalid or not present +func CheckAuth(ctx *gin.Context) { + auth_header := ctx.GetHeader("Authorization") + if auth_header == "" { // No token -> login + ctx.Redirect(http.StatusTemporaryRedirect, "/login") + return + } + + // Expect "Bearer " + parts := strings.Split(auth_header, " ") + if len(parts) != 2 || parts[0] != "Bearer" { + ctx.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "Invalid token format"}) + return + } + + token_str := parts[1] + claims := &jwt.RegisteredClaims{} + + token, err := jwt.ParseWithClaims(token_str, claims, func(token *jwt.Token) (any, error) { + return os.Getenv("JWT_SECRET"), nil + }) + + if err != nil { + ctx.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": "Could not parse token"}) + log.Println("Failed to parse authentication token: " + token_str) + return + } + + if !token.Valid { // Token expired -> login + ctx.Redirect(http.StatusTemporaryRedirect, "/login") + return + } + + // Store username in context for handlers/templates + ctx.Set("username", claims.Subject) +} + +// === Handlers === + +// loginHandler is a handler for POST forms in "/login" +func loginPost(ctx *gin.Context, app_data *AppData) { + username := ctx.PostForm("username") + password := ctx.PostForm("password") + + db_pass, err := app_data.ApiUserClient.GetPassword(ctx, + &api_common.StrIndex{Id: &api_common.StrIndex_Name{Name: username}}, + ) + if err != nil { + ctx.AbortWithStatusJSON( + http.StatusInternalServerError, + gin.H{"error": "Could not fetch user password"}, + ) + log.Println("Failed to fetch user password from DB") + return + } + + err = bcrypt.CompareHashAndPassword([]byte(db_pass.GetPassword()), []byte(password)) + if err != nil { + ctx.AbortWithStatusJSON( + http.StatusBadRequest, + gin.H{"error": "User password does not match"}, + ) + return + } + + token, err := GenerateToken(username) + if err != nil { + log.Println(" JWT generation fail") + ctx.AbortWithStatusJSON( + http.StatusInternalServerError, + gin.H{"error": "Could not generate token"}, + ) + log.Println("Failed to generate user authentication token") + return + } + + ctx.Header("Authorization", "Bearer "+token) + ctx.Status(http.StatusAccepted) +} + +func main() { + // = Exit signal + Data := AppData{ + ExitSig: make(chan os.Signal), + } + signal.Notify(Data.ExitSig, syscall.SIGINT, syscall.SIGTERM) + + // = Load configs + godotenv.Load("./config/app_config.env", "./config/shared.env", "./config/socket_config.env") + + // = Setup logger + log.SetFlags(log.Lmsgprefix | log.LUTC | log.Lshortfile) + log.SetPrefix(Data.FindEnv("LOG_PREFIX") + " ") + + // === Router + router := gin.Default() + + // Load assets and HTML templates + router.Static("./layouts/static", "./layouts/static") + router.LoadHTMLGlob("./layouts/**/*.tmpl") + + HOME_NAME := os.Getenv("HOME_NAME") + + // Redirect to home + if HOME_NAME != "" { + router.GET("/", func(ctx *gin.Context) { + ctx.Redirect(http.StatusPermanentRedirect, "/"+HOME_NAME) + }) + } + + tmout, err := time.ParseDuration(Data.FindEnv("TIMEOUT")) + if err != nil { + log.Println("Format misconfiguration: TIMEOUT") + return + } + + Data.Timeout = tmout + + dial_opts := []grpc.DialOption{ + //grpc.WithBlock(), + grpc.WithInsecure(), + } + grpc_client, err := grpc.Dial( + "app_server:"+Data.FindEnv("SERVER_API_PORT"), + dial_opts..., + ) + if err != nil { + log.Println("Failed to connect to gRPC API") + return + } + Data.ApiUserClient = api_user.NewUserServiceClient(grpc_client) + + // Create auth group + auth_group := router.Group("/", CheckAuth) + + // Starting home page + auth_group.GET("/"+HOME_NAME, func(ctx *gin.Context) { + var title string + if HOME_NAME == "" { + title = "Home" + } else { + title = strings.ToTitle(HOME_NAME) + } + + ctx.HTML(http.StatusOK, "home.tmpl", gin.H{ + "meta": PageMeta{ + Title: title, + Description: "Pagerino system home page", + }, + }) + }) + + // Login page (escape auth handler) + router.GET("/login", func(ctx *gin.Context) { + ctx.HTML(http.StatusOK, "login.tmpl", gin.H{ + "meta": PageMeta{ + Title: "Login", + Description: "Pagerino system login page", + }, + }) + }) + + // Login attempt handler + router.POST("/login", func(ctx *gin.Context) { + loginPost(ctx, &Data) + }) + + // Run server in another thread for graceful shutdown + go func() { + if err := router.Run("localhost:" + Data.FindEnv("WEB_PORT")); err != nil && err != http.ErrServerClosed { + log.Println("HTTP Server error: " + err.Error()) + } + log.Println("HTTP server shutdown.") + + Data.ExitSig <- syscall.SIGINT + }() + + // = Graceful shutdown + <-Data.ExitSig + log.Println("Shutting down...") +} diff --git a/WebApp/src/main/pager_api/change/change.pb.go b/WebApp/src/main/pager_api/change/change.pb.go new file mode 100644 index 0000000..2eaf33e --- /dev/null +++ b/WebApp/src/main/pager_api/change/change.pb.go @@ -0,0 +1,278 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: change.proto + +package api_change + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ChageAllInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OldValue string `protobuf:"bytes,1,opt,name=old_value,json=oldValue,proto3" json:"old_value,omitempty"` + NewValue string `protobuf:"bytes,2,opt,name=new_value,json=newValue,proto3" json:"new_value,omitempty"` + TableName string `protobuf:"bytes,3,opt,name=table_name,json=tableName,proto3" json:"table_name,omitempty"` + Operation string `protobuf:"bytes,4,opt,name=operation,proto3" json:"operation,omitempty"` + LogId int32 `protobuf:"varint,5,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` +} + +func (x *ChageAllInfo) Reset() { + *x = ChageAllInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_change_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChageAllInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChageAllInfo) ProtoMessage() {} + +func (x *ChageAllInfo) ProtoReflect() protoreflect.Message { + mi := &file_change_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChageAllInfo.ProtoReflect.Descriptor instead. +func (*ChageAllInfo) Descriptor() ([]byte, []int) { + return file_change_proto_rawDescGZIP(), []int{0} +} + +func (x *ChageAllInfo) GetOldValue() string { + if x != nil { + return x.OldValue + } + return "" +} + +func (x *ChageAllInfo) GetNewValue() string { + if x != nil { + return x.NewValue + } + return "" +} + +func (x *ChageAllInfo) GetTableName() string { + if x != nil { + return x.TableName + } + return "" +} + +func (x *ChageAllInfo) GetOperation() string { + if x != nil { + return x.Operation + } + return "" +} + +func (x *ChageAllInfo) GetLogId() int32 { + if x != nil { + return x.LogId + } + return 0 +} + +type Values struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OldValue string `protobuf:"bytes,1,opt,name=old_value,json=oldValue,proto3" json:"old_value,omitempty"` + NewValue string `protobuf:"bytes,2,opt,name=new_value,json=newValue,proto3" json:"new_value,omitempty"` +} + +func (x *Values) Reset() { + *x = Values{} + if protoimpl.UnsafeEnabled { + mi := &file_change_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Values) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Values) ProtoMessage() {} + +func (x *Values) ProtoReflect() protoreflect.Message { + mi := &file_change_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Values.ProtoReflect.Descriptor instead. +func (*Values) Descriptor() ([]byte, []int) { + return file_change_proto_rawDescGZIP(), []int{1} +} + +func (x *Values) GetOldValue() string { + if x != nil { + return x.OldValue + } + return "" +} + +func (x *Values) GetNewValue() string { + if x != nil { + return x.NewValue + } + return "" +} + +var File_change_proto protoreflect.FileDescriptor + +var file_change_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x1a, + 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x01, + 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x67, 0x65, 0x41, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, + 0x0a, 0x09, 0x6f, 0x6c, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6f, 0x6c, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, + 0x65, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x49, 0x64, 0x22, 0x42, 0x0a, 0x06, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x6c, 0x64, 0x5f, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x6c, 0x64, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x65, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x65, 0x77, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x32, 0xc6, 0x01, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x3a, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x44, 0x69, 0x66, 0x66, 0x12, 0x16, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x17, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x3f, + 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x1a, 0x1d, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x67, 0x65, 0x41, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, + 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x27, 0x5a, 0x25, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_change_proto_rawDescOnce sync.Once + file_change_proto_rawDescData = file_change_proto_rawDesc +) + +func file_change_proto_rawDescGZIP() []byte { + file_change_proto_rawDescOnce.Do(func() { + file_change_proto_rawDescData = protoimpl.X.CompressGZIP(file_change_proto_rawDescData) + }) + return file_change_proto_rawDescData +} + +var file_change_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_change_proto_goTypes = []interface{}{ + (*ChageAllInfo)(nil), // 0: pagerino.change.ChageAllInfo + (*Values)(nil), // 1: pagerino.change.Values + (*common.Index)(nil), // 2: pagerino.common.Index + (*common.Meta)(nil), // 3: pagerino.common.Meta +} +var file_change_proto_depIdxs = []int32{ + 2, // 0: pagerino.change.ChangeService.GetDiff:input_type -> pagerino.common.Index + 2, // 1: pagerino.change.ChangeService.GetAll:input_type -> pagerino.common.Index + 2, // 2: pagerino.change.ChangeService.GetMeta:input_type -> pagerino.common.Index + 1, // 3: pagerino.change.ChangeService.GetDiff:output_type -> pagerino.change.Values + 0, // 4: pagerino.change.ChangeService.GetAll:output_type -> pagerino.change.ChageAllInfo + 3, // 5: pagerino.change.ChangeService.GetMeta:output_type -> pagerino.common.Meta + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_change_proto_init() } +func file_change_proto_init() { + if File_change_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_change_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChageAllInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_change_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Values); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_change_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_change_proto_goTypes, + DependencyIndexes: file_change_proto_depIdxs, + MessageInfos: file_change_proto_msgTypes, + }.Build() + File_change_proto = out.File + file_change_proto_rawDesc = nil + file_change_proto_goTypes = nil + file_change_proto_depIdxs = nil +} diff --git a/WebApp/src/main/pager_api/change/change_grpc.pb.go b/WebApp/src/main/pager_api/change/change_grpc.pb.go new file mode 100644 index 0000000..9f9edcd --- /dev/null +++ b/WebApp/src/main/pager_api/change/change_grpc.pb.go @@ -0,0 +1,178 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_change + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// ChangeServiceClient is the client API for ChangeService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type ChangeServiceClient interface { + // === DB information + GetDiff(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*Values, error) + GetAll(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*ChageAllInfo, error) + // Common + GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) +} + +type changeServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewChangeServiceClient(cc grpc.ClientConnInterface) ChangeServiceClient { + return &changeServiceClient{cc} +} + +func (c *changeServiceClient) GetDiff(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*Values, error) { + out := new(Values) + err := c.cc.Invoke(ctx, "/pagerino.change.ChangeService/GetDiff", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *changeServiceClient) GetAll(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*ChageAllInfo, error) { + out := new(ChageAllInfo) + err := c.cc.Invoke(ctx, "/pagerino.change.ChangeService/GetAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *changeServiceClient) GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.change.ChangeService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ChangeServiceServer is the server API for ChangeService service. +// All implementations must embed UnimplementedChangeServiceServer +// for forward compatibility +type ChangeServiceServer interface { + // === DB information + GetDiff(context.Context, *common.Index) (*Values, error) + GetAll(context.Context, *common.Index) (*ChageAllInfo, error) + // Common + GetMeta(context.Context, *common.Index) (*common.Meta, error) + mustEmbedUnimplementedChangeServiceServer() +} + +// UnimplementedChangeServiceServer must be embedded to have forward compatible implementations. +type UnimplementedChangeServiceServer struct { +} + +func (UnimplementedChangeServiceServer) GetDiff(context.Context, *common.Index) (*Values, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDiff not implemented") +} +func (UnimplementedChangeServiceServer) GetAll(context.Context, *common.Index) (*ChageAllInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented") +} +func (UnimplementedChangeServiceServer) GetMeta(context.Context, *common.Index) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedChangeServiceServer) mustEmbedUnimplementedChangeServiceServer() {} + +// UnsafeChangeServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ChangeServiceServer will +// result in compilation errors. +type UnsafeChangeServiceServer interface { + mustEmbedUnimplementedChangeServiceServer() +} + +func RegisterChangeServiceServer(s grpc.ServiceRegistrar, srv ChangeServiceServer) { + s.RegisterService(&ChangeService_ServiceDesc, srv) +} + +func _ChangeService_GetDiff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChangeServiceServer).GetDiff(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.change.ChangeService/GetDiff", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChangeServiceServer).GetDiff(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChangeService_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChangeServiceServer).GetAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.change.ChangeService/GetAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChangeServiceServer).GetAll(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _ChangeService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ChangeServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.change.ChangeService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ChangeServiceServer).GetMeta(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +// ChangeService_ServiceDesc is the grpc.ServiceDesc for ChangeService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ChangeService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.change.ChangeService", + HandlerType: (*ChangeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetDiff", + Handler: _ChangeService_GetDiff_Handler, + }, + { + MethodName: "GetAll", + Handler: _ChangeService_GetAll_Handler, + }, + { + MethodName: "GetMeta", + Handler: _ChangeService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "change.proto", +} diff --git a/WebApp/src/main/pager_api/common/common.pb.go b/WebApp/src/main/pager_api/common/common.pb.go new file mode 100644 index 0000000..b22546d --- /dev/null +++ b/WebApp/src/main/pager_api/common/common.pb.go @@ -0,0 +1,588 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: common.proto + +package api_common + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// For custom logic responses +type RequestCode int32 + +const ( + RequestCode_UNKNOWN RequestCode = 0 + RequestCode_OK RequestCode = 1 + RequestCode_UNAUTHORIZED RequestCode = 2 + RequestCode_NO_DATA RequestCode = 3 + RequestCode_INTERNAL_ERROR RequestCode = 4 +) + +// Enum value maps for RequestCode. +var ( + RequestCode_name = map[int32]string{ + 0: "UNKNOWN", + 1: "OK", + 2: "UNAUTHORIZED", + 3: "NO_DATA", + 4: "INTERNAL_ERROR", + } + RequestCode_value = map[string]int32{ + "UNKNOWN": 0, + "OK": 1, + "UNAUTHORIZED": 2, + "NO_DATA": 3, + "INTERNAL_ERROR": 4, + } +) + +func (x RequestCode) Enum() *RequestCode { + p := new(RequestCode) + *p = x + return p +} + +func (x RequestCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (RequestCode) Descriptor() protoreflect.EnumDescriptor { + return file_common_proto_enumTypes[0].Descriptor() +} + +func (RequestCode) Type() protoreflect.EnumType { + return &file_common_proto_enumTypes[0] +} + +func (x RequestCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use RequestCode.Descriptor instead. +func (RequestCode) EnumDescriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{0} +} + +// === DB indexing +type StrIndex struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Id: + // *StrIndex_Num + // *StrIndex_Name + Id isStrIndex_Id `protobuf_oneof:"id"` +} + +func (x *StrIndex) Reset() { + *x = StrIndex{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StrIndex) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StrIndex) ProtoMessage() {} + +func (x *StrIndex) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StrIndex.ProtoReflect.Descriptor instead. +func (*StrIndex) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{0} +} + +func (m *StrIndex) GetId() isStrIndex_Id { + if m != nil { + return m.Id + } + return nil +} + +func (x *StrIndex) GetNum() int32 { + if x, ok := x.GetId().(*StrIndex_Num); ok { + return x.Num + } + return 0 +} + +func (x *StrIndex) GetName() string { + if x, ok := x.GetId().(*StrIndex_Name); ok { + return x.Name + } + return "" +} + +type isStrIndex_Id interface { + isStrIndex_Id() +} + +type StrIndex_Num struct { + Num int32 `protobuf:"varint,1,opt,name=num,proto3,oneof"` // Database ID +} + +type StrIndex_Name struct { + Name string `protobuf:"bytes,2,opt,name=name,proto3,oneof"` // for external fields: username, euid, name... +} + +func (*StrIndex_Num) isStrIndex_Id() {} + +func (*StrIndex_Name) isStrIndex_Id() {} + +type Index struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Num int32 `protobuf:"varint,1,opt,name=num,proto3" json:"num,omitempty"` // Database ID +} + +func (x *Index) Reset() { + *x = Index{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Index) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Index) ProtoMessage() {} + +func (x *Index) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Index.ProtoReflect.Descriptor instead. +func (*Index) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{1} +} + +func (x *Index) GetNum() int32 { + if x != nil { + return x.Num + } + return 0 +} + +// === DB information +type Meta struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *Meta) Reset() { + *x = Meta{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Meta) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Meta) ProtoMessage() {} + +func (x *Meta) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Meta.ProtoReflect.Descriptor instead. +func (*Meta) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{2} +} + +func (x *Meta) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Meta) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type References struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` // 32 IDs per page from most recent + RefId []int32 `protobuf:"varint,2,rep,packed,name=ref_id,json=refId,proto3" json:"ref_id,omitempty"` +} + +func (x *References) Reset() { + *x = References{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *References) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*References) ProtoMessage() {} + +func (x *References) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use References.ProtoReflect.Descriptor instead. +func (*References) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{3} +} + +func (x *References) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *References) GetRefId() []int32 { + if x != nil { + return x.RefId + } + return nil +} + +type Reference struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RefId int32 `protobuf:"varint,1,opt,name=ref_id,json=refId,proto3" json:"ref_id,omitempty"` +} + +func (x *Reference) Reset() { + *x = Reference{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Reference) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Reference) ProtoMessage() {} + +func (x *Reference) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Reference.ProtoReflect.Descriptor instead. +func (*Reference) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{4} +} + +func (x *Reference) GetRefId() int32 { + if x != nil { + return x.RefId + } + return 0 +} + +type Activity struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + LastOnline *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=last_online,json=lastOnline,proto3" json:"last_online,omitempty"` +} + +func (x *Activity) Reset() { + *x = Activity{} + if protoimpl.UnsafeEnabled { + mi := &file_common_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Activity) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Activity) ProtoMessage() {} + +func (x *Activity) ProtoReflect() protoreflect.Message { + mi := &file_common_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Activity.ProtoReflect.Descriptor instead. +func (*Activity) Descriptor() ([]byte, []int) { + return file_common_proto_rawDescGZIP(), []int{5} +} + +func (x *Activity) GetLastOnline() *timestamppb.Timestamp { + if x != nil { + return x.LastOnline + } + return nil +} + +var File_common_proto protoreflect.FileDescriptor + +var file_common_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x3a, 0x0a, 0x08, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x03, + 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x03, 0x6e, 0x75, 0x6d, + 0x12, 0x14, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x04, 0x0a, 0x02, 0x69, 0x64, 0x22, 0x19, 0x0a, 0x05, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x6e, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x03, 0x6e, 0x75, 0x6d, 0x22, 0x51, 0x0a, 0x04, 0x4d, 0x65, 0x74, 0x61, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x37, 0x0a, 0x0a, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x15, 0x0a, 0x06, + 0x72, 0x65, 0x66, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x72, 0x65, + 0x66, 0x49, 0x64, 0x22, 0x22, 0x0a, 0x09, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x15, 0x0a, 0x06, 0x72, 0x65, 0x66, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x72, 0x65, 0x66, 0x49, 0x64, 0x22, 0x47, 0x0a, 0x08, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x69, + 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, + 0x2a, 0x55, 0x0a, 0x0b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, + 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x55, 0x4e, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, + 0x49, 0x5a, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x4e, 0x4f, 0x5f, 0x44, 0x41, 0x54, + 0x41, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x5f, + 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, 0x42, 0x27, 0x5a, 0x25, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_common_proto_rawDescOnce sync.Once + file_common_proto_rawDescData = file_common_proto_rawDesc +) + +func file_common_proto_rawDescGZIP() []byte { + file_common_proto_rawDescOnce.Do(func() { + file_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_proto_rawDescData) + }) + return file_common_proto_rawDescData +} + +var file_common_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_common_proto_goTypes = []interface{}{ + (RequestCode)(0), // 0: pagerino.common.RequestCode + (*StrIndex)(nil), // 1: pagerino.common.StrIndex + (*Index)(nil), // 2: pagerino.common.Index + (*Meta)(nil), // 3: pagerino.common.Meta + (*References)(nil), // 4: pagerino.common.References + (*Reference)(nil), // 5: pagerino.common.Reference + (*Activity)(nil), // 6: pagerino.common.Activity + (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp +} +var file_common_proto_depIdxs = []int32{ + 7, // 0: pagerino.common.Meta.created_at:type_name -> google.protobuf.Timestamp + 7, // 1: pagerino.common.Activity.last_online:type_name -> google.protobuf.Timestamp + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_common_proto_init() } +func file_common_proto_init() { + if File_common_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StrIndex); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Index); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Meta); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*References); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Reference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Activity); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_common_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*StrIndex_Num)(nil), + (*StrIndex_Name)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_common_proto_rawDesc, + NumEnums: 1, + NumMessages: 6, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_common_proto_goTypes, + DependencyIndexes: file_common_proto_depIdxs, + EnumInfos: file_common_proto_enumTypes, + MessageInfos: file_common_proto_msgTypes, + }.Build() + File_common_proto = out.File + file_common_proto_rawDesc = nil + file_common_proto_goTypes = nil + file_common_proto_depIdxs = nil +} diff --git a/WebApp/src/main/pager_api/device/device.pb.go b/WebApp/src/main/pager_api/device/device.pb.go new file mode 100644 index 0000000..b04eca9 --- /dev/null +++ b/WebApp/src/main/pager_api/device/device.pb.go @@ -0,0 +1,566 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: device.proto + +package api_device + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Charge struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Charge float32 `protobuf:"fixed32,1,opt,name=charge,proto3" json:"charge,omitempty"` +} + +func (x *Charge) Reset() { + *x = Charge{} + if protoimpl.UnsafeEnabled { + mi := &file_device_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Charge) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Charge) ProtoMessage() {} + +func (x *Charge) ProtoReflect() protoreflect.Message { + mi := &file_device_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Charge.ProtoReflect.Descriptor instead. +func (*Charge) Descriptor() ([]byte, []int) { + return file_device_proto_rawDescGZIP(), []int{0} +} + +func (x *Charge) GetCharge() float32 { + if x != nil { + return x.Charge + } + return 0 +} + +type Location struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Latitude float64 `protobuf:"fixed64,1,opt,name=latitude,proto3" json:"latitude,omitempty"` + Longitude float64 `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"` + Altitude float32 `protobuf:"fixed32,3,opt,name=altitude,proto3" json:"altitude,omitempty"` +} + +func (x *Location) Reset() { + *x = Location{} + if protoimpl.UnsafeEnabled { + mi := &file_device_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Location) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Location) ProtoMessage() {} + +func (x *Location) ProtoReflect() protoreflect.Message { + mi := &file_device_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Location.ProtoReflect.Descriptor instead. +func (*Location) Descriptor() ([]byte, []int) { + return file_device_proto_rawDescGZIP(), []int{1} +} + +func (x *Location) GetLatitude() float64 { + if x != nil { + return x.Latitude + } + return 0 +} + +func (x *Location) GetLongitude() float64 { + if x != nil { + return x.Longitude + } + return 0 +} + +func (x *Location) GetAltitude() float32 { + if x != nil { + return x.Altitude + } + return 0 +} + +type DeviceBaseInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Euid string `protobuf:"bytes,2,opt,name=euid,proto3" json:"euid,omitempty"` + InternalStatus int32 `protobuf:"zigzag32,3,opt,name=internal_status,json=internalStatus,proto3" json:"internal_status,omitempty"` + LastOnline *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_online,json=lastOnline,proto3" json:"last_online,omitempty"` +} + +func (x *DeviceBaseInfo) Reset() { + *x = DeviceBaseInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_device_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeviceBaseInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeviceBaseInfo) ProtoMessage() {} + +func (x *DeviceBaseInfo) ProtoReflect() protoreflect.Message { + mi := &file_device_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeviceBaseInfo.ProtoReflect.Descriptor instead. +func (*DeviceBaseInfo) Descriptor() ([]byte, []int) { + return file_device_proto_rawDescGZIP(), []int{2} +} + +func (x *DeviceBaseInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DeviceBaseInfo) GetEuid() string { + if x != nil { + return x.Euid + } + return "" +} + +func (x *DeviceBaseInfo) GetInternalStatus() int32 { + if x != nil { + return x.InternalStatus + } + return 0 +} + +func (x *DeviceBaseInfo) GetLastOnline() *timestamppb.Timestamp { + if x != nil { + return x.LastOnline + } + return nil +} + +type DeviceAllInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Euid string `protobuf:"bytes,2,opt,name=euid,proto3" json:"euid,omitempty"` + InternalStatus int32 `protobuf:"zigzag32,3,opt,name=internal_status,json=internalStatus,proto3" json:"internal_status,omitempty"` + NativeStatus string `protobuf:"bytes,4,opt,name=native_status,json=nativeStatus,proto3" json:"native_status,omitempty"` + LastOnline *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=last_online,json=lastOnline,proto3" json:"last_online,omitempty"` + FwVersion string `protobuf:"bytes,6,opt,name=fw_version,json=fwVersion,proto3" json:"fw_version,omitempty"` + CardIds []int32 `protobuf:"varint,7,rep,packed,name=card_ids,json=cardIds,proto3" json:"card_ids,omitempty"` + Charge float32 `protobuf:"fixed32,8,opt,name=charge,proto3" json:"charge,omitempty"` + Latitude float64 `protobuf:"fixed64,9,opt,name=latitude,proto3" json:"latitude,omitempty"` + Longitude float64 `protobuf:"fixed64,10,opt,name=longitude,proto3" json:"longitude,omitempty"` + Altitude float32 `protobuf:"fixed32,11,opt,name=altitude,proto3" json:"altitude,omitempty"` +} + +func (x *DeviceAllInfo) Reset() { + *x = DeviceAllInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_device_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeviceAllInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeviceAllInfo) ProtoMessage() {} + +func (x *DeviceAllInfo) ProtoReflect() protoreflect.Message { + mi := &file_device_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeviceAllInfo.ProtoReflect.Descriptor instead. +func (*DeviceAllInfo) Descriptor() ([]byte, []int) { + return file_device_proto_rawDescGZIP(), []int{3} +} + +func (x *DeviceAllInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *DeviceAllInfo) GetEuid() string { + if x != nil { + return x.Euid + } + return "" +} + +func (x *DeviceAllInfo) GetInternalStatus() int32 { + if x != nil { + return x.InternalStatus + } + return 0 +} + +func (x *DeviceAllInfo) GetNativeStatus() string { + if x != nil { + return x.NativeStatus + } + return "" +} + +func (x *DeviceAllInfo) GetLastOnline() *timestamppb.Timestamp { + if x != nil { + return x.LastOnline + } + return nil +} + +func (x *DeviceAllInfo) GetFwVersion() string { + if x != nil { + return x.FwVersion + } + return "" +} + +func (x *DeviceAllInfo) GetCardIds() []int32 { + if x != nil { + return x.CardIds + } + return nil +} + +func (x *DeviceAllInfo) GetCharge() float32 { + if x != nil { + return x.Charge + } + return 0 +} + +func (x *DeviceAllInfo) GetLatitude() float64 { + if x != nil { + return x.Latitude + } + return 0 +} + +func (x *DeviceAllInfo) GetLongitude() float64 { + if x != nil { + return x.Longitude + } + return 0 +} + +func (x *DeviceAllInfo) GetAltitude() float32 { + if x != nil { + return x.Altitude + } + return 0 +} + +var File_device_proto protoreflect.FileDescriptor + +var file_device_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x1a, + 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x20, + 0x0a, 0x06, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, + 0x22, 0x60, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, + 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, + 0x6c, 0x61, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, + 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x6f, 0x6e, + 0x67, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, + 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, + 0x64, 0x65, 0x22, 0x9e, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x42, 0x61, 0x73, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x75, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x75, 0x69, 0x64, 0x12, 0x27, 0x0a, + 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6f, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x6e, 0x6c, + 0x69, 0x6e, 0x65, 0x22, 0xea, 0x02, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x41, 0x6c, + 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x75, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x75, 0x69, 0x64, 0x12, 0x27, 0x0a, + 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6e, + 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, + 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x77, 0x5f, 0x76, + 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x77, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x63, 0x61, 0x72, 0x64, 0x5f, + 0x69, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x63, 0x61, 0x72, 0x64, 0x49, + 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x02, 0x52, 0x06, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, + 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x6c, 0x61, + 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, + 0x75, 0x64, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, + 0x74, 0x75, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, + 0x32, 0x95, 0x06, 0x0a, 0x0d, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x43, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x19, 0x2e, 0x70, + 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, + 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1e, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, + 0x6e, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x41, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x45, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1f, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x42, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3f, + 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x17, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, + 0x43, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x4c, 0x6f, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x47, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4e, 0x66, 0x63, 0x43, 0x61, + 0x72, 0x64, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x46, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x4b, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x74, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, + 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x73, 0x12, 0x4f, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, 0x12, 0x19, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x1a, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x07, 0x47, + 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x27, 0x5a, 0x25, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_device_proto_rawDescOnce sync.Once + file_device_proto_rawDescData = file_device_proto_rawDesc +) + +func file_device_proto_rawDescGZIP() []byte { + file_device_proto_rawDescOnce.Do(func() { + file_device_proto_rawDescData = protoimpl.X.CompressGZIP(file_device_proto_rawDescData) + }) + return file_device_proto_rawDescData +} + +var file_device_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_device_proto_goTypes = []interface{}{ + (*Charge)(nil), // 0: pagerino.device.Charge + (*Location)(nil), // 1: pagerino.device.Location + (*DeviceBaseInfo)(nil), // 2: pagerino.device.DeviceBaseInfo + (*DeviceAllInfo)(nil), // 3: pagerino.device.DeviceAllInfo + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*common.StrIndex)(nil), // 5: pagerino.common.StrIndex + (*common.References)(nil), // 6: pagerino.common.References + (*common.Activity)(nil), // 7: pagerino.common.Activity + (*common.Meta)(nil), // 8: pagerino.common.Meta +} +var file_device_proto_depIdxs = []int32{ + 4, // 0: pagerino.device.DeviceBaseInfo.last_online:type_name -> google.protobuf.Timestamp + 4, // 1: pagerino.device.DeviceAllInfo.last_online:type_name -> google.protobuf.Timestamp + 5, // 2: pagerino.device.DeviceService.GetAll:input_type -> pagerino.common.StrIndex + 5, // 3: pagerino.device.DeviceService.GetInfo:input_type -> pagerino.common.StrIndex + 5, // 4: pagerino.device.DeviceService.GetCharge:input_type -> pagerino.common.StrIndex + 5, // 5: pagerino.device.DeviceService.GetLocation:input_type -> pagerino.common.StrIndex + 5, // 6: pagerino.device.DeviceService.GetNfcCardIds:input_type -> pagerino.common.StrIndex + 5, // 7: pagerino.device.DeviceService.GetStatusIds:input_type -> pagerino.common.StrIndex + 5, // 8: pagerino.device.DeviceService.GetSentMessageIds:input_type -> pagerino.common.StrIndex + 5, // 9: pagerino.device.DeviceService.GetReceivedMessageIds:input_type -> pagerino.common.StrIndex + 5, // 10: pagerino.device.DeviceService.GetLogs:input_type -> pagerino.common.StrIndex + 5, // 11: pagerino.device.DeviceService.GetActivity:input_type -> pagerino.common.StrIndex + 5, // 12: pagerino.device.DeviceService.GetMeta:input_type -> pagerino.common.StrIndex + 3, // 13: pagerino.device.DeviceService.GetAll:output_type -> pagerino.device.DeviceAllInfo + 2, // 14: pagerino.device.DeviceService.GetInfo:output_type -> pagerino.device.DeviceBaseInfo + 0, // 15: pagerino.device.DeviceService.GetCharge:output_type -> pagerino.device.Charge + 1, // 16: pagerino.device.DeviceService.GetLocation:output_type -> pagerino.device.Location + 6, // 17: pagerino.device.DeviceService.GetNfcCardIds:output_type -> pagerino.common.References + 6, // 18: pagerino.device.DeviceService.GetStatusIds:output_type -> pagerino.common.References + 6, // 19: pagerino.device.DeviceService.GetSentMessageIds:output_type -> pagerino.common.References + 6, // 20: pagerino.device.DeviceService.GetReceivedMessageIds:output_type -> pagerino.common.References + 6, // 21: pagerino.device.DeviceService.GetLogs:output_type -> pagerino.common.References + 7, // 22: pagerino.device.DeviceService.GetActivity:output_type -> pagerino.common.Activity + 8, // 23: pagerino.device.DeviceService.GetMeta:output_type -> pagerino.common.Meta + 13, // [13:24] is the sub-list for method output_type + 2, // [2:13] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_device_proto_init() } +func file_device_proto_init() { + if File_device_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_device_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Charge); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_device_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Location); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_device_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeviceBaseInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_device_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeviceAllInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_device_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_device_proto_goTypes, + DependencyIndexes: file_device_proto_depIdxs, + MessageInfos: file_device_proto_msgTypes, + }.Build() + File_device_proto = out.File + file_device_proto_rawDesc = nil + file_device_proto_goTypes = nil + file_device_proto_depIdxs = nil +} diff --git a/WebApp/src/main/pager_api/device/device_grpc.pb.go b/WebApp/src/main/pager_api/device/device_grpc.pb.go new file mode 100644 index 0000000..3467714 --- /dev/null +++ b/WebApp/src/main/pager_api/device/device_grpc.pb.go @@ -0,0 +1,468 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_device + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// DeviceServiceClient is the client API for DeviceService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type DeviceServiceClient interface { + // === DB information + GetAll(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*DeviceAllInfo, error) + GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*DeviceBaseInfo, error) + GetCharge(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Charge, error) + GetLocation(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Location, error) + // References + GetNfcCardIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetStatusIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetSentMessageIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetReceivedMessageIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetLogs(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + // Common + GetActivity(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Activity, error) + GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) +} + +type deviceServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewDeviceServiceClient(cc grpc.ClientConnInterface) DeviceServiceClient { + return &deviceServiceClient{cc} +} + +func (c *deviceServiceClient) GetAll(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*DeviceAllInfo, error) { + out := new(DeviceAllInfo) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*DeviceBaseInfo, error) { + out := new(DeviceBaseInfo) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetCharge(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Charge, error) { + out := new(Charge) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetCharge", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetLocation(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Location, error) { + out := new(Location) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetLocation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetNfcCardIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetNfcCardIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetStatusIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetStatusIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetSentMessageIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetSentMessageIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetReceivedMessageIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetReceivedMessageIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetLogs(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetLogs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetActivity(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Activity, error) { + out := new(common.Activity) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetActivity", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *deviceServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.device.DeviceService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// DeviceServiceServer is the server API for DeviceService service. +// All implementations must embed UnimplementedDeviceServiceServer +// for forward compatibility +type DeviceServiceServer interface { + // === DB information + GetAll(context.Context, *common.StrIndex) (*DeviceAllInfo, error) + GetInfo(context.Context, *common.StrIndex) (*DeviceBaseInfo, error) + GetCharge(context.Context, *common.StrIndex) (*Charge, error) + GetLocation(context.Context, *common.StrIndex) (*Location, error) + // References + GetNfcCardIds(context.Context, *common.StrIndex) (*common.References, error) + GetStatusIds(context.Context, *common.StrIndex) (*common.References, error) + GetSentMessageIds(context.Context, *common.StrIndex) (*common.References, error) + GetReceivedMessageIds(context.Context, *common.StrIndex) (*common.References, error) + GetLogs(context.Context, *common.StrIndex) (*common.References, error) + // Common + GetActivity(context.Context, *common.StrIndex) (*common.Activity, error) + GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) + mustEmbedUnimplementedDeviceServiceServer() +} + +// UnimplementedDeviceServiceServer must be embedded to have forward compatible implementations. +type UnimplementedDeviceServiceServer struct { +} + +func (UnimplementedDeviceServiceServer) GetAll(context.Context, *common.StrIndex) (*DeviceAllInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented") +} +func (UnimplementedDeviceServiceServer) GetInfo(context.Context, *common.StrIndex) (*DeviceBaseInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedDeviceServiceServer) GetCharge(context.Context, *common.StrIndex) (*Charge, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCharge not implemented") +} +func (UnimplementedDeviceServiceServer) GetLocation(context.Context, *common.StrIndex) (*Location, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLocation not implemented") +} +func (UnimplementedDeviceServiceServer) GetNfcCardIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNfcCardIds not implemented") +} +func (UnimplementedDeviceServiceServer) GetStatusIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetStatusIds not implemented") +} +func (UnimplementedDeviceServiceServer) GetSentMessageIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSentMessageIds not implemented") +} +func (UnimplementedDeviceServiceServer) GetReceivedMessageIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetReceivedMessageIds not implemented") +} +func (UnimplementedDeviceServiceServer) GetLogs(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLogs not implemented") +} +func (UnimplementedDeviceServiceServer) GetActivity(context.Context, *common.StrIndex) (*common.Activity, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetActivity not implemented") +} +func (UnimplementedDeviceServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedDeviceServiceServer) mustEmbedUnimplementedDeviceServiceServer() {} + +// UnsafeDeviceServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to DeviceServiceServer will +// result in compilation errors. +type UnsafeDeviceServiceServer interface { + mustEmbedUnimplementedDeviceServiceServer() +} + +func RegisterDeviceServiceServer(s grpc.ServiceRegistrar, srv DeviceServiceServer) { + s.RegisterService(&DeviceService_ServiceDesc, srv) +} + +func _DeviceService_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetAll(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetInfo(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetCharge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetCharge(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetCharge", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetCharge(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetLocation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetLocation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetLocation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetLocation(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetNfcCardIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetNfcCardIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetNfcCardIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetNfcCardIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetStatusIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetStatusIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetStatusIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetStatusIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetSentMessageIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetSentMessageIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetSentMessageIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetSentMessageIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetReceivedMessageIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetReceivedMessageIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetReceivedMessageIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetReceivedMessageIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetLogs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetLogs(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetActivity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetActivity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetActivity(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _DeviceService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(DeviceServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.device.DeviceService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(DeviceServiceServer).GetMeta(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +// DeviceService_ServiceDesc is the grpc.ServiceDesc for DeviceService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var DeviceService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.device.DeviceService", + HandlerType: (*DeviceServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetAll", + Handler: _DeviceService_GetAll_Handler, + }, + { + MethodName: "GetInfo", + Handler: _DeviceService_GetInfo_Handler, + }, + { + MethodName: "GetCharge", + Handler: _DeviceService_GetCharge_Handler, + }, + { + MethodName: "GetLocation", + Handler: _DeviceService_GetLocation_Handler, + }, + { + MethodName: "GetNfcCardIds", + Handler: _DeviceService_GetNfcCardIds_Handler, + }, + { + MethodName: "GetStatusIds", + Handler: _DeviceService_GetStatusIds_Handler, + }, + { + MethodName: "GetSentMessageIds", + Handler: _DeviceService_GetSentMessageIds_Handler, + }, + { + MethodName: "GetReceivedMessageIds", + Handler: _DeviceService_GetReceivedMessageIds_Handler, + }, + { + MethodName: "GetLogs", + Handler: _DeviceService_GetLogs_Handler, + }, + { + MethodName: "GetActivity", + Handler: _DeviceService_GetActivity_Handler, + }, + { + MethodName: "GetMeta", + Handler: _DeviceService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "device.proto", +} diff --git a/WebApp/src/main/pager_api/log/log.pb.go b/WebApp/src/main/pager_api/log/log.pb.go new file mode 100644 index 0000000..002933a --- /dev/null +++ b/WebApp/src/main/pager_api/log/log.pb.go @@ -0,0 +1,81 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: log.proto + +package api_log + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +var File_log_proto protoreflect.FileDescriptor + +var file_log_proto_rawDesc = []byte{ + 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x70, 0x61, 0x67, + 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6c, 0x6f, 0x67, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x8b, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, 0x67, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x49, 0x64, 0x73, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x07, 0x47, + 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x21, 0x5a, 0x1f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, + 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6c, 0x6f, 0x67, + 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x6c, 0x6f, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var file_log_proto_goTypes = []interface{}{ + (*common.Index)(nil), // 0: pagerino.common.Index + (*common.References)(nil), // 1: pagerino.common.References + (*common.Meta)(nil), // 2: pagerino.common.Meta +} +var file_log_proto_depIdxs = []int32{ + 0, // 0: pagerino.log.LogService.GetChangeIds:input_type -> pagerino.common.Index + 0, // 1: pagerino.log.LogService.GetMeta:input_type -> pagerino.common.Index + 1, // 2: pagerino.log.LogService.GetChangeIds:output_type -> pagerino.common.References + 2, // 3: pagerino.log.LogService.GetMeta:output_type -> pagerino.common.Meta + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_log_proto_init() } +func file_log_proto_init() { + if File_log_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_log_proto_rawDesc, + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_log_proto_goTypes, + DependencyIndexes: file_log_proto_depIdxs, + }.Build() + File_log_proto = out.File + file_log_proto_rawDesc = nil + file_log_proto_goTypes = nil + file_log_proto_depIdxs = nil +} diff --git a/WebApp/src/main/pager_api/log/log_grpc.pb.go b/WebApp/src/main/pager_api/log/log_grpc.pb.go new file mode 100644 index 0000000..83739f9 --- /dev/null +++ b/WebApp/src/main/pager_api/log/log_grpc.pb.go @@ -0,0 +1,144 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_log + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// LogServiceClient is the client API for LogService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type LogServiceClient interface { + // === DB information + // References + GetChangeIds(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.References, error) + // Common + GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) +} + +type logServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewLogServiceClient(cc grpc.ClientConnInterface) LogServiceClient { + return &logServiceClient{cc} +} + +func (c *logServiceClient) GetChangeIds(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.log.LogService/GetChangeIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *logServiceClient) GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.log.LogService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LogServiceServer is the server API for LogService service. +// All implementations must embed UnimplementedLogServiceServer +// for forward compatibility +type LogServiceServer interface { + // === DB information + // References + GetChangeIds(context.Context, *common.Index) (*common.References, error) + // Common + GetMeta(context.Context, *common.Index) (*common.Meta, error) + mustEmbedUnimplementedLogServiceServer() +} + +// UnimplementedLogServiceServer must be embedded to have forward compatible implementations. +type UnimplementedLogServiceServer struct { +} + +func (UnimplementedLogServiceServer) GetChangeIds(context.Context, *common.Index) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChangeIds not implemented") +} +func (UnimplementedLogServiceServer) GetMeta(context.Context, *common.Index) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedLogServiceServer) mustEmbedUnimplementedLogServiceServer() {} + +// UnsafeLogServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to LogServiceServer will +// result in compilation errors. +type UnsafeLogServiceServer interface { + mustEmbedUnimplementedLogServiceServer() +} + +func RegisterLogServiceServer(s grpc.ServiceRegistrar, srv LogServiceServer) { + s.RegisterService(&LogService_ServiceDesc, srv) +} + +func _LogService_GetChangeIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LogServiceServer).GetChangeIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.log.LogService/GetChangeIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LogServiceServer).GetChangeIds(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _LogService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LogServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.log.LogService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LogServiceServer).GetMeta(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +// LogService_ServiceDesc is the grpc.ServiceDesc for LogService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var LogService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.log.LogService", + HandlerType: (*LogServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetChangeIds", + Handler: _LogService_GetChangeIds_Handler, + }, + { + MethodName: "GetMeta", + Handler: _LogService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "log.proto", +} diff --git a/WebApp/src/main/pager_api/message/message.pb.go b/WebApp/src/main/pager_api/message/message.pb.go new file mode 100644 index 0000000..db87644 --- /dev/null +++ b/WebApp/src/main/pager_api/message/message.pb.go @@ -0,0 +1,267 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: message.proto + +package api_message + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MessageBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SenderId int32 `protobuf:"varint,1,opt,name=sender_id,json=senderId,proto3" json:"sender_id,omitempty"` + ReceiverId int32 `protobuf:"varint,2,opt,name=receiver_id,json=receiverId,proto3" json:"receiver_id,omitempty"` + Payload string `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` +} + +func (x *MessageBasicInfo) Reset() { + *x = MessageBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_message_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MessageBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MessageBasicInfo) ProtoMessage() {} + +func (x *MessageBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_message_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MessageBasicInfo.ProtoReflect.Descriptor instead. +func (*MessageBasicInfo) Descriptor() ([]byte, []int) { + return file_message_proto_rawDescGZIP(), []int{0} +} + +func (x *MessageBasicInfo) GetSenderId() int32 { + if x != nil { + return x.SenderId + } + return 0 +} + +func (x *MessageBasicInfo) GetReceiverId() int32 { + if x != nil { + return x.ReceiverId + } + return 0 +} + +func (x *MessageBasicInfo) GetPayload() string { + if x != nil { + return x.Payload + } + return "" +} + +func (x *MessageBasicInfo) GetCreatedAt() *timestamppb.Timestamp { + if x != nil { + return x.CreatedAt + } + return nil +} + +type Payload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` +} + +func (x *Payload) Reset() { + *x = Payload{} + if protoimpl.UnsafeEnabled { + mi := &file_message_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Payload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Payload) ProtoMessage() {} + +func (x *Payload) ProtoReflect() protoreflect.Message { + mi := &file_message_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Payload.ProtoReflect.Descriptor instead. +func (*Payload) Descriptor() ([]byte, []int) { + return file_message_proto_rawDescGZIP(), []int{1} +} + +func (x *Payload) GetPayload() string { + if x != nil { + return x.Payload + } + return "" +} + +var File_message_proto protoreflect.FileDescriptor + +var file_message_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x10, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xa5, 0x01, 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x61, 0x73, 0x69, + 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x39, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x23, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, + 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x32, 0xd2, 0x01, + 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x45, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x1a, 0x22, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x61, + 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x19, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, + 0x65, 0x74, 0x61, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, + 0x74, 0x61, 0x42, 0x29, 0x5a, 0x27, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, + 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_proto_rawDescOnce sync.Once + file_message_proto_rawDescData = file_message_proto_rawDesc +) + +func file_message_proto_rawDescGZIP() []byte { + file_message_proto_rawDescOnce.Do(func() { + file_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_proto_rawDescData) + }) + return file_message_proto_rawDescData +} + +var file_message_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_message_proto_goTypes = []interface{}{ + (*MessageBasicInfo)(nil), // 0: pagerino.message.MessageBasicInfo + (*Payload)(nil), // 1: pagerino.message.Payload + (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp + (*common.Index)(nil), // 3: pagerino.common.Index + (*common.Meta)(nil), // 4: pagerino.common.Meta +} +var file_message_proto_depIdxs = []int32{ + 2, // 0: pagerino.message.MessageBasicInfo.created_at:type_name -> google.protobuf.Timestamp + 3, // 1: pagerino.message.MessageService.GetInfo:input_type -> pagerino.common.Index + 3, // 2: pagerino.message.MessageService.GetPayload:input_type -> pagerino.common.Index + 3, // 3: pagerino.message.MessageService.GetMeta:input_type -> pagerino.common.Index + 0, // 4: pagerino.message.MessageService.GetInfo:output_type -> pagerino.message.MessageBasicInfo + 1, // 5: pagerino.message.MessageService.GetPayload:output_type -> pagerino.message.Payload + 4, // 6: pagerino.message.MessageService.GetMeta:output_type -> pagerino.common.Meta + 4, // [4:7] is the sub-list for method output_type + 1, // [1:4] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_message_proto_init() } +func file_message_proto_init() { + if File_message_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MessageBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Payload); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_message_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_message_proto_goTypes, + DependencyIndexes: file_message_proto_depIdxs, + MessageInfos: file_message_proto_msgTypes, + }.Build() + File_message_proto = out.File + file_message_proto_rawDesc = nil + file_message_proto_goTypes = nil + file_message_proto_depIdxs = nil +} diff --git a/WebApp/src/main/pager_api/message/message_grpc.pb.go b/WebApp/src/main/pager_api/message/message_grpc.pb.go new file mode 100644 index 0000000..b43c471 --- /dev/null +++ b/WebApp/src/main/pager_api/message/message_grpc.pb.go @@ -0,0 +1,178 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_message + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// MessageServiceClient is the client API for MessageService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MessageServiceClient interface { + // === DB information + GetInfo(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*MessageBasicInfo, error) + GetPayload(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*Payload, error) + // Common + GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) +} + +type messageServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMessageServiceClient(cc grpc.ClientConnInterface) MessageServiceClient { + return &messageServiceClient{cc} +} + +func (c *messageServiceClient) GetInfo(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*MessageBasicInfo, error) { + out := new(MessageBasicInfo) + err := c.cc.Invoke(ctx, "/pagerino.message.MessageService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageServiceClient) GetPayload(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*Payload, error) { + out := new(Payload) + err := c.cc.Invoke(ctx, "/pagerino.message.MessageService/GetPayload", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *messageServiceClient) GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.message.MessageService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MessageServiceServer is the server API for MessageService service. +// All implementations must embed UnimplementedMessageServiceServer +// for forward compatibility +type MessageServiceServer interface { + // === DB information + GetInfo(context.Context, *common.Index) (*MessageBasicInfo, error) + GetPayload(context.Context, *common.Index) (*Payload, error) + // Common + GetMeta(context.Context, *common.Index) (*common.Meta, error) + mustEmbedUnimplementedMessageServiceServer() +} + +// UnimplementedMessageServiceServer must be embedded to have forward compatible implementations. +type UnimplementedMessageServiceServer struct { +} + +func (UnimplementedMessageServiceServer) GetInfo(context.Context, *common.Index) (*MessageBasicInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedMessageServiceServer) GetPayload(context.Context, *common.Index) (*Payload, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPayload not implemented") +} +func (UnimplementedMessageServiceServer) GetMeta(context.Context, *common.Index) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedMessageServiceServer) mustEmbedUnimplementedMessageServiceServer() {} + +// UnsafeMessageServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MessageServiceServer will +// result in compilation errors. +type UnsafeMessageServiceServer interface { + mustEmbedUnimplementedMessageServiceServer() +} + +func RegisterMessageServiceServer(s grpc.ServiceRegistrar, srv MessageServiceServer) { + s.RegisterService(&MessageService_ServiceDesc, srv) +} + +func _MessageService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.message.MessageService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageServiceServer).GetInfo(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageService_GetPayload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageServiceServer).GetPayload(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.message.MessageService/GetPayload", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageServiceServer).GetPayload(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _MessageService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MessageServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.message.MessageService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MessageServiceServer).GetMeta(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +// MessageService_ServiceDesc is the grpc.ServiceDesc for MessageService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MessageService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.message.MessageService", + HandlerType: (*MessageServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _MessageService_GetInfo_Handler, + }, + { + MethodName: "GetPayload", + Handler: _MessageService_GetPayload_Handler, + }, + { + MethodName: "GetMeta", + Handler: _MessageService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "message.proto", +} diff --git a/WebApp/src/main/pager_api/nfccard/nfccard.pb.go b/WebApp/src/main/pager_api/nfccard/nfccard.pb.go new file mode 100644 index 0000000..c055bcc --- /dev/null +++ b/WebApp/src/main/pager_api/nfccard/nfccard.pb.go @@ -0,0 +1,168 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: nfccard.proto + +package api_nfccard + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type NfcCardBaseInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` +} + +func (x *NfcCardBaseInfo) Reset() { + *x = NfcCardBaseInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_nfccard_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NfcCardBaseInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NfcCardBaseInfo) ProtoMessage() {} + +func (x *NfcCardBaseInfo) ProtoReflect() protoreflect.Message { + mi := &file_nfccard_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use NfcCardBaseInfo.ProtoReflect.Descriptor instead. +func (*NfcCardBaseInfo) Descriptor() ([]byte, []int) { + return file_nfccard_proto_rawDescGZIP(), []int{0} +} + +func (x *NfcCardBaseInfo) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +var File_nfccard_proto protoreflect.FileDescriptor + +var file_nfccard_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x6e, 0x66, 0x63, 0x63, 0x61, 0x72, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x11, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6e, 0x66, 0x63, 0x5f, 0x63, 0x61, + 0x72, 0x64, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x23, 0x0a, 0x0f, 0x4e, 0x66, 0x63, 0x43, 0x61, 0x72, 0x64, 0x42, 0x61, 0x73, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x75, 0x69, 0x64, 0x32, 0xd4, 0x01, 0x0a, 0x0e, 0x4e, 0x66, 0x63, 0x43, 0x61, 0x72, + 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x22, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x6e, 0x66, 0x63, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x2e, + 0x4e, 0x66, 0x63, 0x43, 0x61, 0x72, 0x64, 0x42, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, + 0x41, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x16, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x38, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x16, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x29, 0x5a, 0x27, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x6e, 0x66, 0x63, 0x63, 0x61, 0x72, 0x64, 0x3b, 0x61, 0x70, 0x69, 0x5f, + 0x6e, 0x66, 0x63, 0x63, 0x61, 0x72, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_nfccard_proto_rawDescOnce sync.Once + file_nfccard_proto_rawDescData = file_nfccard_proto_rawDesc +) + +func file_nfccard_proto_rawDescGZIP() []byte { + file_nfccard_proto_rawDescOnce.Do(func() { + file_nfccard_proto_rawDescData = protoimpl.X.CompressGZIP(file_nfccard_proto_rawDescData) + }) + return file_nfccard_proto_rawDescData +} + +var file_nfccard_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_nfccard_proto_goTypes = []interface{}{ + (*NfcCardBaseInfo)(nil), // 0: pagerino.nfc_card.NfcCardBaseInfo + (*common.Index)(nil), // 1: pagerino.common.Index + (*common.Reference)(nil), // 2: pagerino.common.Reference + (*common.Meta)(nil), // 3: pagerino.common.Meta +} +var file_nfccard_proto_depIdxs = []int32{ + 1, // 0: pagerino.nfc_card.NfcCardService.GetInfo:input_type -> pagerino.common.Index + 1, // 1: pagerino.nfc_card.NfcCardService.GetDeviceId:input_type -> pagerino.common.Index + 1, // 2: pagerino.nfc_card.NfcCardService.GetMeta:input_type -> pagerino.common.Index + 0, // 3: pagerino.nfc_card.NfcCardService.GetInfo:output_type -> pagerino.nfc_card.NfcCardBaseInfo + 2, // 4: pagerino.nfc_card.NfcCardService.GetDeviceId:output_type -> pagerino.common.Reference + 3, // 5: pagerino.nfc_card.NfcCardService.GetMeta:output_type -> pagerino.common.Meta + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_nfccard_proto_init() } +func file_nfccard_proto_init() { + if File_nfccard_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_nfccard_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NfcCardBaseInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_nfccard_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_nfccard_proto_goTypes, + DependencyIndexes: file_nfccard_proto_depIdxs, + MessageInfos: file_nfccard_proto_msgTypes, + }.Build() + File_nfccard_proto = out.File + file_nfccard_proto_rawDesc = nil + file_nfccard_proto_goTypes = nil + file_nfccard_proto_depIdxs = nil +} diff --git a/WebApp/src/main/pager_api/nfccard/nfccard_grpc.pb.go b/WebApp/src/main/pager_api/nfccard/nfccard_grpc.pb.go new file mode 100644 index 0000000..eb0bade --- /dev/null +++ b/WebApp/src/main/pager_api/nfccard/nfccard_grpc.pb.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_nfccard + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// NfcCardServiceClient is the client API for NfcCardService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type NfcCardServiceClient interface { + // === DB information + GetInfo(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*NfcCardBaseInfo, error) + // References + GetDeviceId(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Reference, error) + // Common + GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) +} + +type nfcCardServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewNfcCardServiceClient(cc grpc.ClientConnInterface) NfcCardServiceClient { + return &nfcCardServiceClient{cc} +} + +func (c *nfcCardServiceClient) GetInfo(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*NfcCardBaseInfo, error) { + out := new(NfcCardBaseInfo) + err := c.cc.Invoke(ctx, "/pagerino.nfc_card.NfcCardService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nfcCardServiceClient) GetDeviceId(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Reference, error) { + out := new(common.Reference) + err := c.cc.Invoke(ctx, "/pagerino.nfc_card.NfcCardService/GetDeviceId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *nfcCardServiceClient) GetMeta(ctx context.Context, in *common.Index, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.nfc_card.NfcCardService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// NfcCardServiceServer is the server API for NfcCardService service. +// All implementations must embed UnimplementedNfcCardServiceServer +// for forward compatibility +type NfcCardServiceServer interface { + // === DB information + GetInfo(context.Context, *common.Index) (*NfcCardBaseInfo, error) + // References + GetDeviceId(context.Context, *common.Index) (*common.Reference, error) + // Common + GetMeta(context.Context, *common.Index) (*common.Meta, error) + mustEmbedUnimplementedNfcCardServiceServer() +} + +// UnimplementedNfcCardServiceServer must be embedded to have forward compatible implementations. +type UnimplementedNfcCardServiceServer struct { +} + +func (UnimplementedNfcCardServiceServer) GetInfo(context.Context, *common.Index) (*NfcCardBaseInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedNfcCardServiceServer) GetDeviceId(context.Context, *common.Index) (*common.Reference, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDeviceId not implemented") +} +func (UnimplementedNfcCardServiceServer) GetMeta(context.Context, *common.Index) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedNfcCardServiceServer) mustEmbedUnimplementedNfcCardServiceServer() {} + +// UnsafeNfcCardServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to NfcCardServiceServer will +// result in compilation errors. +type UnsafeNfcCardServiceServer interface { + mustEmbedUnimplementedNfcCardServiceServer() +} + +func RegisterNfcCardServiceServer(s grpc.ServiceRegistrar, srv NfcCardServiceServer) { + s.RegisterService(&NfcCardService_ServiceDesc, srv) +} + +func _NfcCardService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NfcCardServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.nfc_card.NfcCardService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NfcCardServiceServer).GetInfo(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _NfcCardService_GetDeviceId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NfcCardServiceServer).GetDeviceId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.nfc_card.NfcCardService/GetDeviceId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NfcCardServiceServer).GetDeviceId(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +func _NfcCardService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.Index) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NfcCardServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.nfc_card.NfcCardService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NfcCardServiceServer).GetMeta(ctx, req.(*common.Index)) + } + return interceptor(ctx, in, info, handler) +} + +// NfcCardService_ServiceDesc is the grpc.ServiceDesc for NfcCardService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var NfcCardService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.nfc_card.NfcCardService", + HandlerType: (*NfcCardServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _NfcCardService_GetInfo_Handler, + }, + { + MethodName: "GetDeviceId", + Handler: _NfcCardService_GetDeviceId_Handler, + }, + { + MethodName: "GetMeta", + Handler: _NfcCardService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "nfccard.proto", +} diff --git a/WebApp/src/main/pager_api/permission/permission.pb.go b/WebApp/src/main/pager_api/permission/permission.pb.go new file mode 100644 index 0000000..a728f8e --- /dev/null +++ b/WebApp/src/main/pager_api/permission/permission.pb.go @@ -0,0 +1,181 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: permission.proto + +package api_permission + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type PermissionBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *PermissionBasicInfo) Reset() { + *x = PermissionBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_permission_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PermissionBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PermissionBasicInfo) ProtoMessage() {} + +func (x *PermissionBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_permission_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PermissionBasicInfo.ProtoReflect.Descriptor instead. +func (*PermissionBasicInfo) Descriptor() ([]byte, []int) { + return file_permission_proto_rawDescGZIP(), []int{0} +} + +func (x *PermissionBasicInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PermissionBasicInfo) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +var File_permission_proto protoreflect.FileDescriptor + +var file_permission_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x13, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x65, 0x72, + 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4b, 0x0a, 0x13, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x32, 0xe6, 0x01, 0x0a, 0x11, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x28, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x42, + 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, + 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x3b, + 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x2f, 0x5a, 0x2d, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x3b, 0x61, 0x70, + 0x69, 0x5f, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_permission_proto_rawDescOnce sync.Once + file_permission_proto_rawDescData = file_permission_proto_rawDesc +) + +func file_permission_proto_rawDescGZIP() []byte { + file_permission_proto_rawDescOnce.Do(func() { + file_permission_proto_rawDescData = protoimpl.X.CompressGZIP(file_permission_proto_rawDescData) + }) + return file_permission_proto_rawDescData +} + +var file_permission_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_permission_proto_goTypes = []interface{}{ + (*PermissionBasicInfo)(nil), // 0: pagerino.permission.PermissionBasicInfo + (*common.StrIndex)(nil), // 1: pagerino.common.StrIndex + (*common.References)(nil), // 2: pagerino.common.References + (*common.Meta)(nil), // 3: pagerino.common.Meta +} +var file_permission_proto_depIdxs = []int32{ + 1, // 0: pagerino.permission.PermissionService.GetInfo:input_type -> pagerino.common.StrIndex + 1, // 1: pagerino.permission.PermissionService.GetRoleIds:input_type -> pagerino.common.StrIndex + 1, // 2: pagerino.permission.PermissionService.GetMeta:input_type -> pagerino.common.StrIndex + 0, // 3: pagerino.permission.PermissionService.GetInfo:output_type -> pagerino.permission.PermissionBasicInfo + 2, // 4: pagerino.permission.PermissionService.GetRoleIds:output_type -> pagerino.common.References + 3, // 5: pagerino.permission.PermissionService.GetMeta:output_type -> pagerino.common.Meta + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_permission_proto_init() } +func file_permission_proto_init() { + if File_permission_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_permission_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PermissionBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_permission_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_permission_proto_goTypes, + DependencyIndexes: file_permission_proto_depIdxs, + MessageInfos: file_permission_proto_msgTypes, + }.Build() + File_permission_proto = out.File + file_permission_proto_rawDesc = nil + file_permission_proto_goTypes = nil + file_permission_proto_depIdxs = nil +} diff --git a/WebApp/src/main/pager_api/permission/permission_grpc.pb.go b/WebApp/src/main/pager_api/permission/permission_grpc.pb.go new file mode 100644 index 0000000..ec3370a --- /dev/null +++ b/WebApp/src/main/pager_api/permission/permission_grpc.pb.go @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_permission + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// PermissionServiceClient is the client API for PermissionService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type PermissionServiceClient interface { + // === DB information + GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*PermissionBasicInfo, error) + // References + GetRoleIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + // Common + GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) +} + +type permissionServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPermissionServiceClient(cc grpc.ClientConnInterface) PermissionServiceClient { + return &permissionServiceClient{cc} +} + +func (c *permissionServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*PermissionBasicInfo, error) { + out := new(PermissionBasicInfo) + err := c.cc.Invoke(ctx, "/pagerino.permission.PermissionService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *permissionServiceClient) GetRoleIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.permission.PermissionService/GetRoleIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *permissionServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.permission.PermissionService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PermissionServiceServer is the server API for PermissionService service. +// All implementations must embed UnimplementedPermissionServiceServer +// for forward compatibility +type PermissionServiceServer interface { + // === DB information + GetInfo(context.Context, *common.StrIndex) (*PermissionBasicInfo, error) + // References + GetRoleIds(context.Context, *common.StrIndex) (*common.References, error) + // Common + GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) + mustEmbedUnimplementedPermissionServiceServer() +} + +// UnimplementedPermissionServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPermissionServiceServer struct { +} + +func (UnimplementedPermissionServiceServer) GetInfo(context.Context, *common.StrIndex) (*PermissionBasicInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedPermissionServiceServer) GetRoleIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRoleIds not implemented") +} +func (UnimplementedPermissionServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedPermissionServiceServer) mustEmbedUnimplementedPermissionServiceServer() {} + +// UnsafePermissionServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PermissionServiceServer will +// result in compilation errors. +type UnsafePermissionServiceServer interface { + mustEmbedUnimplementedPermissionServiceServer() +} + +func RegisterPermissionServiceServer(s grpc.ServiceRegistrar, srv PermissionServiceServer) { + s.RegisterService(&PermissionService_ServiceDesc, srv) +} + +func _PermissionService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PermissionServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.permission.PermissionService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PermissionServiceServer).GetInfo(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _PermissionService_GetRoleIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PermissionServiceServer).GetRoleIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.permission.PermissionService/GetRoleIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PermissionServiceServer).GetRoleIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _PermissionService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PermissionServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.permission.PermissionService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PermissionServiceServer).GetMeta(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +// PermissionService_ServiceDesc is the grpc.ServiceDesc for PermissionService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var PermissionService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.permission.PermissionService", + HandlerType: (*PermissionServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _PermissionService_GetInfo_Handler, + }, + { + MethodName: "GetRoleIds", + Handler: _PermissionService_GetRoleIds_Handler, + }, + { + MethodName: "GetMeta", + Handler: _PermissionService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "permission.proto", +} diff --git a/WebApp/src/main/pager_api/role/role.pb.go b/WebApp/src/main/pager_api/role/role.pb.go new file mode 100644 index 0000000..09aa284 --- /dev/null +++ b/WebApp/src/main/pager_api/role/role.pb.go @@ -0,0 +1,184 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: role.proto + +package api_role + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + common "server/app_comm/api/common" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type RoleBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` +} + +func (x *RoleBasicInfo) Reset() { + *x = RoleBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_role_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RoleBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleBasicInfo) ProtoMessage() {} + +func (x *RoleBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_role_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RoleBasicInfo.ProtoReflect.Descriptor instead. +func (*RoleBasicInfo) Descriptor() ([]byte, []int) { + return file_role_proto_rawDescGZIP(), []int{0} +} + +func (x *RoleBasicInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RoleBasicInfo) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +var File_role_proto protoreflect.FileDescriptor + +var file_role_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x1a, 0x0c, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x0d, 0x52, 0x6f, 0x6c, + 0x65, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, + 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x32, 0xa0, 0x02, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x42, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x61, 0x73, 0x69, 0x63, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4a, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x50, 0x65, 0x72, 0x6d, 0x69, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, + 0x12, 0x44, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x12, 0x19, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, + 0x61, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, + 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, + 0x65, 0x74, 0x61, 0x42, 0x23, 0x5a, 0x21, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, + 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x3b, + 0x61, 0x70, 0x69, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_role_proto_rawDescOnce sync.Once + file_role_proto_rawDescData = file_role_proto_rawDesc +) + +func file_role_proto_rawDescGZIP() []byte { + file_role_proto_rawDescOnce.Do(func() { + file_role_proto_rawDescData = protoimpl.X.CompressGZIP(file_role_proto_rawDescData) + }) + return file_role_proto_rawDescData +} + +var file_role_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_role_proto_goTypes = []interface{}{ + (*RoleBasicInfo)(nil), // 0: pagerino.role.RoleBasicInfo + (*common.StrIndex)(nil), // 1: pagerino.common.StrIndex + (*common.References)(nil), // 2: pagerino.common.References + (*common.Meta)(nil), // 3: pagerino.common.Meta +} +var file_role_proto_depIdxs = []int32{ + 1, // 0: pagerino.role.RoleService.GetInfo:input_type -> pagerino.common.StrIndex + 1, // 1: pagerino.role.RoleService.GetPermissionIds:input_type -> pagerino.common.StrIndex + 1, // 2: pagerino.role.RoleService.GetUserIds:input_type -> pagerino.common.StrIndex + 1, // 3: pagerino.role.RoleService.GetMeta:input_type -> pagerino.common.StrIndex + 0, // 4: pagerino.role.RoleService.GetInfo:output_type -> pagerino.role.RoleBasicInfo + 2, // 5: pagerino.role.RoleService.GetPermissionIds:output_type -> pagerino.common.References + 2, // 6: pagerino.role.RoleService.GetUserIds:output_type -> pagerino.common.References + 3, // 7: pagerino.role.RoleService.GetMeta:output_type -> pagerino.common.Meta + 4, // [4:8] is the sub-list for method output_type + 0, // [0:4] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_role_proto_init() } +func file_role_proto_init() { + if File_role_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_role_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RoleBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_role_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_role_proto_goTypes, + DependencyIndexes: file_role_proto_depIdxs, + MessageInfos: file_role_proto_msgTypes, + }.Build() + File_role_proto = out.File + file_role_proto_rawDesc = nil + file_role_proto_goTypes = nil + file_role_proto_depIdxs = nil +} diff --git a/WebApp/src/main/pager_api/role/role_grpc.pb.go b/WebApp/src/main/pager_api/role/role_grpc.pb.go new file mode 100644 index 0000000..b5bf872 --- /dev/null +++ b/WebApp/src/main/pager_api/role/role_grpc.pb.go @@ -0,0 +1,216 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_role + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + common "server/app_comm/api/common" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// RoleServiceClient is the client API for RoleService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RoleServiceClient interface { + // === DB information + GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*RoleBasicInfo, error) + // References + GetPermissionIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetUserIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + // Common + GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) +} + +type roleServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewRoleServiceClient(cc grpc.ClientConnInterface) RoleServiceClient { + return &roleServiceClient{cc} +} + +func (c *roleServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*RoleBasicInfo, error) { + out := new(RoleBasicInfo) + err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) GetPermissionIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetPermissionIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) GetUserIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetUserIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *roleServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.role.RoleService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RoleServiceServer is the server API for RoleService service. +// All implementations must embed UnimplementedRoleServiceServer +// for forward compatibility +type RoleServiceServer interface { + // === DB information + GetInfo(context.Context, *common.StrIndex) (*RoleBasicInfo, error) + // References + GetPermissionIds(context.Context, *common.StrIndex) (*common.References, error) + GetUserIds(context.Context, *common.StrIndex) (*common.References, error) + // Common + GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) + mustEmbedUnimplementedRoleServiceServer() +} + +// UnimplementedRoleServiceServer must be embedded to have forward compatible implementations. +type UnimplementedRoleServiceServer struct { +} + +func (UnimplementedRoleServiceServer) GetInfo(context.Context, *common.StrIndex) (*RoleBasicInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedRoleServiceServer) GetPermissionIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPermissionIds not implemented") +} +func (UnimplementedRoleServiceServer) GetUserIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserIds not implemented") +} +func (UnimplementedRoleServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedRoleServiceServer) mustEmbedUnimplementedRoleServiceServer() {} + +// UnsafeRoleServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RoleServiceServer will +// result in compilation errors. +type UnsafeRoleServiceServer interface { + mustEmbedUnimplementedRoleServiceServer() +} + +func RegisterRoleServiceServer(s grpc.ServiceRegistrar, srv RoleServiceServer) { + s.RegisterService(&RoleService_ServiceDesc, srv) +} + +func _RoleService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.role.RoleService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetInfo(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_GetPermissionIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetPermissionIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.role.RoleService/GetPermissionIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetPermissionIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_GetUserIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetUserIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.role.RoleService/GetUserIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetUserIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _RoleService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RoleServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.role.RoleService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RoleServiceServer).GetMeta(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +// RoleService_ServiceDesc is the grpc.ServiceDesc for RoleService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RoleService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.role.RoleService", + HandlerType: (*RoleServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _RoleService_GetInfo_Handler, + }, + { + MethodName: "GetPermissionIds", + Handler: _RoleService_GetPermissionIds_Handler, + }, + { + MethodName: "GetUserIds", + Handler: _RoleService_GetUserIds_Handler, + }, + { + MethodName: "GetMeta", + Handler: _RoleService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "role.proto", +} diff --git a/WebApp/src/main/pager_api/status/status.pb.go b/WebApp/src/main/pager_api/status/status.pb.go new file mode 100644 index 0000000..60286b9 --- /dev/null +++ b/WebApp/src/main/pager_api/status/status.pb.go @@ -0,0 +1,182 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: status.proto + +package api_status + +import ( + common "pagerino-web/pager_api/common" + reflect "reflect" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type StatusBasicInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InternalStatus int32 `protobuf:"zigzag32,1,opt,name=internal_status,json=internalStatus,proto3" json:"internal_status,omitempty"` + NativeStatus string `protobuf:"bytes,2,opt,name=native_status,json=nativeStatus,proto3" json:"native_status,omitempty"` +} + +func (x *StatusBasicInfo) Reset() { + *x = StatusBasicInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_status_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StatusBasicInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatusBasicInfo) ProtoMessage() {} + +func (x *StatusBasicInfo) ProtoReflect() protoreflect.Message { + mi := &file_status_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatusBasicInfo.ProtoReflect.Descriptor instead. +func (*StatusBasicInfo) Descriptor() ([]byte, []int) { + return file_status_proto_rawDescGZIP(), []int{0} +} + +func (x *StatusBasicInfo) GetInternalStatus() int32 { + if x != nil { + return x.InternalStatus + } + return 0 +} + +func (x *StatusBasicInfo) GetNativeStatus() string { + if x != nil { + return x.NativeStatus + } + return "" +} + +var File_status_proto protoreflect.FileDescriptor + +var file_status_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x1a, + 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5f, 0x0a, + 0x0f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x11, 0x52, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x6e, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xda, + 0x01, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x46, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, + 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x20, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, + 0x61, 0x73, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, + 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x3b, + 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, + 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, + 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x27, 0x5a, 0x25, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_status_proto_rawDescOnce sync.Once + file_status_proto_rawDescData = file_status_proto_rawDesc +) + +func file_status_proto_rawDescGZIP() []byte { + file_status_proto_rawDescOnce.Do(func() { + file_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_status_proto_rawDescData) + }) + return file_status_proto_rawDescData +} + +var file_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_status_proto_goTypes = []interface{}{ + (*StatusBasicInfo)(nil), // 0: pagerino.status.StatusBasicInfo + (*common.StrIndex)(nil), // 1: pagerino.common.StrIndex + (*common.Reference)(nil), // 2: pagerino.common.Reference + (*common.Meta)(nil), // 3: pagerino.common.Meta +} +var file_status_proto_depIdxs = []int32{ + 1, // 0: pagerino.status.StatusService.GetInfo:input_type -> pagerino.common.StrIndex + 1, // 1: pagerino.status.StatusService.GetDeviceId:input_type -> pagerino.common.StrIndex + 1, // 2: pagerino.status.StatusService.GetMeta:input_type -> pagerino.common.StrIndex + 0, // 3: pagerino.status.StatusService.GetInfo:output_type -> pagerino.status.StatusBasicInfo + 2, // 4: pagerino.status.StatusService.GetDeviceId:output_type -> pagerino.common.Reference + 3, // 5: pagerino.status.StatusService.GetMeta:output_type -> pagerino.common.Meta + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_status_proto_init() } +func file_status_proto_init() { + if File_status_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StatusBasicInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_status_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_status_proto_goTypes, + DependencyIndexes: file_status_proto_depIdxs, + MessageInfos: file_status_proto_msgTypes, + }.Build() + File_status_proto = out.File + file_status_proto_rawDesc = nil + file_status_proto_goTypes = nil + file_status_proto_depIdxs = nil +} diff --git a/WebApp/src/main/pager_api/status/status_grpc.pb.go b/WebApp/src/main/pager_api/status/status_grpc.pb.go new file mode 100644 index 0000000..9542b91 --- /dev/null +++ b/WebApp/src/main/pager_api/status/status_grpc.pb.go @@ -0,0 +1,181 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_status + +import ( + context "context" + common "pagerino-web/pager_api/common" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// StatusServiceClient is the client API for StatusService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type StatusServiceClient interface { + // === DB information + GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*StatusBasicInfo, error) + // References + GetDeviceId(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Reference, error) + // Common + GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) +} + +type statusServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewStatusServiceClient(cc grpc.ClientConnInterface) StatusServiceClient { + return &statusServiceClient{cc} +} + +func (c *statusServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*StatusBasicInfo, error) { + out := new(StatusBasicInfo) + err := c.cc.Invoke(ctx, "/pagerino.status.StatusService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *statusServiceClient) GetDeviceId(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Reference, error) { + out := new(common.Reference) + err := c.cc.Invoke(ctx, "/pagerino.status.StatusService/GetDeviceId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *statusServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.status.StatusService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// StatusServiceServer is the server API for StatusService service. +// All implementations must embed UnimplementedStatusServiceServer +// for forward compatibility +type StatusServiceServer interface { + // === DB information + GetInfo(context.Context, *common.StrIndex) (*StatusBasicInfo, error) + // References + GetDeviceId(context.Context, *common.StrIndex) (*common.Reference, error) + // Common + GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) + mustEmbedUnimplementedStatusServiceServer() +} + +// UnimplementedStatusServiceServer must be embedded to have forward compatible implementations. +type UnimplementedStatusServiceServer struct { +} + +func (UnimplementedStatusServiceServer) GetInfo(context.Context, *common.StrIndex) (*StatusBasicInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedStatusServiceServer) GetDeviceId(context.Context, *common.StrIndex) (*common.Reference, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDeviceId not implemented") +} +func (UnimplementedStatusServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedStatusServiceServer) mustEmbedUnimplementedStatusServiceServer() {} + +// UnsafeStatusServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to StatusServiceServer will +// result in compilation errors. +type UnsafeStatusServiceServer interface { + mustEmbedUnimplementedStatusServiceServer() +} + +func RegisterStatusServiceServer(s grpc.ServiceRegistrar, srv StatusServiceServer) { + s.RegisterService(&StatusService_ServiceDesc, srv) +} + +func _StatusService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StatusServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.status.StatusService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StatusServiceServer).GetInfo(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _StatusService_GetDeviceId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StatusServiceServer).GetDeviceId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.status.StatusService/GetDeviceId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StatusServiceServer).GetDeviceId(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _StatusService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StatusServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.status.StatusService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StatusServiceServer).GetMeta(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +// StatusService_ServiceDesc is the grpc.ServiceDesc for StatusService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var StatusService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.status.StatusService", + HandlerType: (*StatusServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetInfo", + Handler: _StatusService_GetInfo_Handler, + }, + { + MethodName: "GetDeviceId", + Handler: _StatusService_GetDeviceId_Handler, + }, + { + MethodName: "GetMeta", + Handler: _StatusService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "status.proto", +} diff --git a/WebApp/src/main/pager_api/user/user.pb.go b/WebApp/src/main/pager_api/user/user.pb.go new file mode 100644 index 0000000..298bc41 --- /dev/null +++ b/WebApp/src/main/pager_api/user/user.pb.go @@ -0,0 +1,386 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0-devel +// protoc v3.14.0 +// source: user.proto + +package api_user + +import ( + common "pagerino-web/pager_api/common" + reflect "reflect" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Password struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *Password) Reset() { + *x = Password{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Password) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Password) ProtoMessage() {} + +func (x *Password) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Password.ProtoReflect.Descriptor instead. +func (*Password) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{0} +} + +func (x *Password) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type UserAllInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + RoleId int32 `protobuf:"varint,3,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` + LastOnline *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_online,json=lastOnline,proto3" json:"last_online,omitempty"` +} + +func (x *UserAllInfo) Reset() { + *x = UserAllInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserAllInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserAllInfo) ProtoMessage() {} + +func (x *UserAllInfo) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserAllInfo.ProtoReflect.Descriptor instead. +func (*UserAllInfo) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{1} +} + +func (x *UserAllInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UserAllInfo) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *UserAllInfo) GetRoleId() int32 { + if x != nil { + return x.RoleId + } + return 0 +} + +func (x *UserAllInfo) GetLastOnline() *timestamppb.Timestamp { + if x != nil { + return x.LastOnline + } + return nil +} + +type UserBaseInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + RoleId int32 `protobuf:"varint,2,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` + LastOnline *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=last_online,json=lastOnline,proto3" json:"last_online,omitempty"` +} + +func (x *UserBaseInfo) Reset() { + *x = UserBaseInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserBaseInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserBaseInfo) ProtoMessage() {} + +func (x *UserBaseInfo) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UserBaseInfo.ProtoReflect.Descriptor instead. +func (*UserBaseInfo) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{2} +} + +func (x *UserBaseInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UserBaseInfo) GetRoleId() int32 { + if x != nil { + return x.RoleId + } + return 0 +} + +func (x *UserBaseInfo) GetLastOnline() *timestamppb.Timestamp { + if x != nil { + return x.LastOnline + } + return nil +} + +var File_user_proto protoreflect.FileDescriptor + +var file_user_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x26, 0x0a, 0x08, 0x50, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, + 0x61, 0x73, 0x74, 0x5f, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, + 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x78, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, + 0x42, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x17, 0x0a, 0x07, + 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, + 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6f, 0x6e, + 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x4f, 0x6e, 0x6c, 0x69, + 0x6e, 0x65, 0x32, 0xa5, 0x04, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x06, 0x47, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x12, 0x19, 0x2e, 0x70, + 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, + 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, + 0x6e, 0x6f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x41, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, + 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, + 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, + 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x41, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x50, 0x61, 0x73, + 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x1a, 0x17, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, + 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, + 0x78, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x46, 0x0a, + 0x0c, 0x47, 0x65, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x73, 0x12, 0x19, 0x2e, + 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, + 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, 0x66, 0x65, 0x72, + 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x41, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4c, 0x6f, 0x67, 0x73, + 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x1a, 0x1b, 0x2e, 0x70, 0x61, + 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x52, 0x65, + 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x43, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x41, + 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, + 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, 0x64, + 0x65, 0x78, 0x1a, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, + 0x07, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x72, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x1a, 0x15, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x72, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x42, 0x23, 0x5a, 0x21, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x3b, 0x61, 0x70, 0x69, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_proto_rawDescOnce sync.Once + file_user_proto_rawDescData = file_user_proto_rawDesc +) + +func file_user_proto_rawDescGZIP() []byte { + file_user_proto_rawDescOnce.Do(func() { + file_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_proto_rawDescData) + }) + return file_user_proto_rawDescData +} + +var file_user_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_user_proto_goTypes = []interface{}{ + (*Password)(nil), // 0: pagerino.user.Password + (*UserAllInfo)(nil), // 1: pagerino.user.UserAllInfo + (*UserBaseInfo)(nil), // 2: pagerino.user.UserBaseInfo + (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp + (*common.StrIndex)(nil), // 4: pagerino.common.StrIndex + (*common.Reference)(nil), // 5: pagerino.common.Reference + (*common.References)(nil), // 6: pagerino.common.References + (*common.Activity)(nil), // 7: pagerino.common.Activity + (*common.Meta)(nil), // 8: pagerino.common.Meta +} +var file_user_proto_depIdxs = []int32{ + 3, // 0: pagerino.user.UserAllInfo.last_online:type_name -> google.protobuf.Timestamp + 3, // 1: pagerino.user.UserBaseInfo.last_online:type_name -> google.protobuf.Timestamp + 4, // 2: pagerino.user.UserService.GetAll:input_type -> pagerino.common.StrIndex + 4, // 3: pagerino.user.UserService.GetInfo:input_type -> pagerino.common.StrIndex + 4, // 4: pagerino.user.UserService.GetPassword:input_type -> pagerino.common.StrIndex + 4, // 5: pagerino.user.UserService.GetRoleId:input_type -> pagerino.common.StrIndex + 4, // 6: pagerino.user.UserService.GetDeviceIds:input_type -> pagerino.common.StrIndex + 4, // 7: pagerino.user.UserService.GetLogs:input_type -> pagerino.common.StrIndex + 4, // 8: pagerino.user.UserService.GetActivity:input_type -> pagerino.common.StrIndex + 4, // 9: pagerino.user.UserService.GetMeta:input_type -> pagerino.common.StrIndex + 1, // 10: pagerino.user.UserService.GetAll:output_type -> pagerino.user.UserAllInfo + 2, // 11: pagerino.user.UserService.GetInfo:output_type -> pagerino.user.UserBaseInfo + 0, // 12: pagerino.user.UserService.GetPassword:output_type -> pagerino.user.Password + 5, // 13: pagerino.user.UserService.GetRoleId:output_type -> pagerino.common.Reference + 6, // 14: pagerino.user.UserService.GetDeviceIds:output_type -> pagerino.common.References + 6, // 15: pagerino.user.UserService.GetLogs:output_type -> pagerino.common.References + 7, // 16: pagerino.user.UserService.GetActivity:output_type -> pagerino.common.Activity + 8, // 17: pagerino.user.UserService.GetMeta:output_type -> pagerino.common.Meta + 10, // [10:18] is the sub-list for method output_type + 2, // [2:10] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_user_proto_init() } +func file_user_proto_init() { + if File_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Password); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserAllInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserBaseInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_proto_goTypes, + DependencyIndexes: file_user_proto_depIdxs, + MessageInfos: file_user_proto_msgTypes, + }.Build() + File_user_proto = out.File + file_user_proto_rawDesc = nil + file_user_proto_goTypes = nil + file_user_proto_depIdxs = nil +} diff --git a/WebApp/src/main/pager_api/user/user_grpc.pb.go b/WebApp/src/main/pager_api/user/user_grpc.pb.go new file mode 100644 index 0000000..c742e47 --- /dev/null +++ b/WebApp/src/main/pager_api/user/user_grpc.pb.go @@ -0,0 +1,361 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package api_user + +import ( + context "context" + common "pagerino-web/pager_api/common" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// UserServiceClient is the client API for UserService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserServiceClient interface { + // === DB information + GetAll(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*UserAllInfo, error) + GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*UserBaseInfo, error) + GetPassword(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Password, error) + // References + GetRoleId(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Reference, error) + GetDeviceIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + GetLogs(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) + // Common + GetActivity(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Activity, error) + GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) GetAll(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*UserAllInfo, error) { + out := new(UserAllInfo) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetInfo(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*UserBaseInfo, error) { + out := new(UserBaseInfo) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetPassword(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*Password, error) { + out := new(Password) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetPassword", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetRoleId(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Reference, error) { + out := new(common.Reference) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetRoleId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetDeviceIds(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetDeviceIds", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetLogs(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.References, error) { + out := new(common.References) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetLogs", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetActivity(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Activity, error) { + out := new(common.Activity) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetActivity", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) GetMeta(ctx context.Context, in *common.StrIndex, opts ...grpc.CallOption) (*common.Meta, error) { + out := new(common.Meta) + err := c.cc.Invoke(ctx, "/pagerino.user.UserService/GetMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations must embed UnimplementedUserServiceServer +// for forward compatibility +type UserServiceServer interface { + // === DB information + GetAll(context.Context, *common.StrIndex) (*UserAllInfo, error) + GetInfo(context.Context, *common.StrIndex) (*UserBaseInfo, error) + GetPassword(context.Context, *common.StrIndex) (*Password, error) + // References + GetRoleId(context.Context, *common.StrIndex) (*common.Reference, error) + GetDeviceIds(context.Context, *common.StrIndex) (*common.References, error) + GetLogs(context.Context, *common.StrIndex) (*common.References, error) + // Common + GetActivity(context.Context, *common.StrIndex) (*common.Activity, error) + GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) + mustEmbedUnimplementedUserServiceServer() +} + +// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserServiceServer struct { +} + +func (UnimplementedUserServiceServer) GetAll(context.Context, *common.StrIndex) (*UserAllInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented") +} +func (UnimplementedUserServiceServer) GetInfo(context.Context, *common.StrIndex) (*UserBaseInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") +} +func (UnimplementedUserServiceServer) GetPassword(context.Context, *common.StrIndex) (*Password, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPassword not implemented") +} +func (UnimplementedUserServiceServer) GetRoleId(context.Context, *common.StrIndex) (*common.Reference, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRoleId not implemented") +} +func (UnimplementedUserServiceServer) GetDeviceIds(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDeviceIds not implemented") +} +func (UnimplementedUserServiceServer) GetLogs(context.Context, *common.StrIndex) (*common.References, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetLogs not implemented") +} +func (UnimplementedUserServiceServer) GetActivity(context.Context, *common.StrIndex) (*common.Activity, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetActivity not implemented") +} +func (UnimplementedUserServiceServer) GetMeta(context.Context, *common.StrIndex) (*common.Meta, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMeta not implemented") +} +func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + s.RegisterService(&UserService_ServiceDesc, srv) +} + +func _UserService_GetAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetAll(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetInfo(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetPassword", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetPassword(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetRoleId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetRoleId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetRoleId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetRoleId(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetDeviceIds_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetDeviceIds(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetDeviceIds", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetDeviceIds(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetLogs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetLogs(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetLogs", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetLogs(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetActivity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetActivity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetActivity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetActivity(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_GetMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(common.StrIndex) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).GetMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pagerino.user.UserService/GetMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).GetMeta(ctx, req.(*common.StrIndex)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pagerino.user.UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetAll", + Handler: _UserService_GetAll_Handler, + }, + { + MethodName: "GetInfo", + Handler: _UserService_GetInfo_Handler, + }, + { + MethodName: "GetPassword", + Handler: _UserService_GetPassword_Handler, + }, + { + MethodName: "GetRoleId", + Handler: _UserService_GetRoleId_Handler, + }, + { + MethodName: "GetDeviceIds", + Handler: _UserService_GetDeviceIds_Handler, + }, + { + MethodName: "GetLogs", + Handler: _UserService_GetLogs_Handler, + }, + { + MethodName: "GetActivity", + Handler: _UserService_GetActivity_Handler, + }, + { + MethodName: "GetMeta", + Handler: _UserService_GetMeta_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user.proto", +} diff --git a/WebApp/tarball.tar.gz b/WebApp/tarball.tar.gz new file mode 100644 index 0000000..ab4d609 Binary files /dev/null and b/WebApp/tarball.tar.gz differ