Attempt 1
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
WebApp/node_modules
|
||||||
34
AppServer/.env
Executable file
34
AppServer/.env
Executable file
@@ -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
|
||||||
31
AppServer/Dockerfile
Executable file
31
AppServer/Dockerfile
Executable file
@@ -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"]
|
||||||
40
AppServer/Makefile
Normal file
40
AppServer/Makefile
Normal file
@@ -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
|
||||||
61
AppServer/README.md
Executable file
61
AppServer/README.md
Executable file
@@ -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*
|
||||||
|
|
||||||
30
AppServer/certs/ca.pem
Normal file
30
AppServer/certs/ca.pem
Normal file
@@ -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-----
|
||||||
28
AppServer/certs/client.key
Normal file
28
AppServer/certs/client.key
Normal file
@@ -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-----
|
||||||
25
AppServer/certs/client.pem
Normal file
25
AppServer/certs/client.pem
Normal file
@@ -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-----
|
||||||
39
AppServer/docker-compose.yml
Normal file
39
AppServer/docker-compose.yml
Normal file
@@ -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
|
||||||
|
|
||||||
122
AppServer/init.sql
Executable file
122
AppServer/init.sql
Executable file
@@ -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)
|
||||||
|
);
|
||||||
3
AppServer/postgresql.conf
Executable file
3
AppServer/postgresql.conf
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
log_connections = on
|
||||||
|
log_destination = 'stderr'
|
||||||
|
listen_addresses='*'
|
||||||
180
AppServer/src/api.go
Normal file
180
AppServer/src/api.go
Normal file
@@ -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
|
||||||
278
AppServer/src/app_comm/api/change/change.pb.go
Normal file
278
AppServer/src/app_comm/api/change/change.pb.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
178
AppServer/src/app_comm/api/change/change_grpc.pb.go
Normal file
178
AppServer/src/app_comm/api/change/change_grpc.pb.go
Normal file
@@ -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",
|
||||||
|
}
|
||||||
588
AppServer/src/app_comm/api/common/common.pb.go
Normal file
588
AppServer/src/app_comm/api/common/common.pb.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
566
AppServer/src/app_comm/api/device/device.pb.go
Normal file
566
AppServer/src/app_comm/api/device/device.pb.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
468
AppServer/src/app_comm/api/device/device_grpc.pb.go
Normal file
468
AppServer/src/app_comm/api/device/device_grpc.pb.go
Normal file
@@ -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",
|
||||||
|
}
|
||||||
81
AppServer/src/app_comm/api/log/log.pb.go
Normal file
81
AppServer/src/app_comm/api/log/log.pb.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
144
AppServer/src/app_comm/api/log/log_grpc.pb.go
Normal file
144
AppServer/src/app_comm/api/log/log_grpc.pb.go
Normal file
@@ -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",
|
||||||
|
}
|
||||||
267
AppServer/src/app_comm/api/message/message.pb.go
Normal file
267
AppServer/src/app_comm/api/message/message.pb.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
178
AppServer/src/app_comm/api/message/message_grpc.pb.go
Normal file
178
AppServer/src/app_comm/api/message/message_grpc.pb.go
Normal file
@@ -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",
|
||||||
|
}
|
||||||
168
AppServer/src/app_comm/api/nfccard/nfccard.pb.go
Normal file
168
AppServer/src/app_comm/api/nfccard/nfccard.pb.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
180
AppServer/src/app_comm/api/nfccard/nfccard_grpc.pb.go
Normal file
180
AppServer/src/app_comm/api/nfccard/nfccard_grpc.pb.go
Normal file
@@ -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",
|
||||||
|
}
|
||||||
181
AppServer/src/app_comm/api/permission/permission.pb.go
Normal file
181
AppServer/src/app_comm/api/permission/permission.pb.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
180
AppServer/src/app_comm/api/permission/permission_grpc.pb.go
Normal file
180
AppServer/src/app_comm/api/permission/permission_grpc.pb.go
Normal file
@@ -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",
|
||||||
|
}
|
||||||
184
AppServer/src/app_comm/api/role/role.pb.go
Normal file
184
AppServer/src/app_comm/api/role/role.pb.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
216
AppServer/src/app_comm/api/role/role_grpc.pb.go
Normal file
216
AppServer/src/app_comm/api/role/role_grpc.pb.go
Normal file
@@ -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",
|
||||||
|
}
|
||||||
180
AppServer/src/app_comm/api/status/status.pb.go
Normal file
180
AppServer/src/app_comm/api/status/status.pb.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
180
AppServer/src/app_comm/api/status/status_grpc.pb.go
Normal file
180
AppServer/src/app_comm/api/status/status_grpc.pb.go
Normal file
@@ -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",
|
||||||
|
}
|
||||||
384
AppServer/src/app_comm/api/user/user.pb.go
Normal file
384
AppServer/src/app_comm/api/user/user.pb.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
360
AppServer/src/app_comm/api/user/user_grpc.pb.go
Normal file
360
AppServer/src/app_comm/api/user/user_grpc.pb.go
Normal file
@@ -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",
|
||||||
|
}
|
||||||
30
AppServer/src/app_comm/proto/change.proto
Normal file
30
AppServer/src/app_comm/proto/change.proto
Normal file
@@ -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);
|
||||||
|
}
|
||||||
47
AppServer/src/app_comm/proto/common.proto
Normal file
47
AppServer/src/app_comm/proto/common.proto
Normal file
@@ -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;
|
||||||
|
}
|
||||||
65
AppServer/src/app_comm/proto/device.proto
Normal file
65
AppServer/src/app_comm/proto/device.proto
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
16
AppServer/src/app_comm/proto/log.proto
Normal file
16
AppServer/src/app_comm/proto/log.proto
Normal file
@@ -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);
|
||||||
|
}
|
||||||
29
AppServer/src/app_comm/proto/message.proto
Normal file
29
AppServer/src/app_comm/proto/message.proto
Normal file
@@ -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);
|
||||||
|
}
|
||||||
24
AppServer/src/app_comm/proto/nfccard.proto
Normal file
24
AppServer/src/app_comm/proto/nfccard.proto
Normal file
@@ -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);
|
||||||
|
}
|
||||||
24
AppServer/src/app_comm/proto/permission.proto
Normal file
24
AppServer/src/app_comm/proto/permission.proto
Normal file
@@ -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);
|
||||||
|
}
|
||||||
25
AppServer/src/app_comm/proto/role.proto
Normal file
25
AppServer/src/app_comm/proto/role.proto
Normal file
@@ -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);
|
||||||
|
}
|
||||||
26
AppServer/src/app_comm/proto/status.proto
Normal file
26
AppServer/src/app_comm/proto/status.proto
Normal file
@@ -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);
|
||||||
|
}
|
||||||
43
AppServer/src/app_comm/proto/user.proto
Normal file
43
AppServer/src/app_comm/proto/user.proto
Normal file
@@ -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);
|
||||||
|
}
|
||||||
28
AppServer/src/go.mod
Executable file
28
AppServer/src/go.mod
Executable file
@@ -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
|
||||||
|
)
|
||||||
70
AppServer/src/go.sum
Executable file
70
AppServer/src/go.sum
Executable file
@@ -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=
|
||||||
439
AppServer/src/main.go
Executable file
439
AppServer/src/main.go
Executable file
@@ -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.")
|
||||||
|
}
|
||||||
312
AppServer/src/serder/serder.go
Normal file
312
AppServer/src/serder/serder.go
Normal file
@@ -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
|
||||||
|
}
|
||||||
BIN
AppServer/tarball.tar.gz
Normal file
BIN
AppServer/tarball.tar.gz
Normal file
Binary file not shown.
22
Chirpstack_v4/LICENSE
Normal file
22
Chirpstack_v4/LICENSE
Normal file
@@ -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.
|
||||||
|
|
||||||
5
Chirpstack_v4/Makefile
Normal file
5
Chirpstack_v4/Makefile
Normal file
@@ -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'
|
||||||
99
Chirpstack_v4/README.md
Normal file
99
Chirpstack_v4/README.md
Normal file
@@ -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.
|
||||||
52
Chirpstack_v4/certs/ca.key
Normal file
52
Chirpstack_v4/certs/ca.key
Normal file
@@ -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-----
|
||||||
30
Chirpstack_v4/certs/ca.pem
Normal file
30
Chirpstack_v4/certs/ca.pem
Normal file
@@ -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-----
|
||||||
41
Chirpstack_v4/certs/cert-gen.sh
Executable file
41
Chirpstack_v4/certs/cert-gen.sh
Executable file
@@ -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 <<EOF
|
||||||
|
basicConstraints=CA:FALSE
|
||||||
|
keyUsage = digitalSignature, keyEncipherment
|
||||||
|
extendedKeyUsage = serverAuth
|
||||||
|
subjectAltName = DNS:mosquitto
|
||||||
|
EOF
|
||||||
|
|
||||||
|
openssl x509 -req -in server.csr -CA ca.pem -CAkey ca.key -CAcreateserial \
|
||||||
|
-out server.pem -days "$EXPIRY_DURATION" -sha256 -extfile server_ext.cnf
|
||||||
|
|
||||||
|
# 3. Client cert (ChirpStack + Gateway Bridge) v3
|
||||||
|
openssl genrsa -out client.key 2048
|
||||||
|
openssl req -new -key client.key -out client.csr -subj "/CN=chirpstack"
|
||||||
|
|
||||||
|
cat >client_ext.cnf <<EOF
|
||||||
|
basicConstraints=CA:FALSE
|
||||||
|
keyUsage = digitalSignature, keyEncipherment
|
||||||
|
extendedKeyUsage = clientAuth
|
||||||
|
EOF
|
||||||
|
|
||||||
|
openssl x509 -req -in client.csr -CA ca.pem -CAkey ca.key -CAcreateserial \
|
||||||
|
-out client.pem -days "$EXPIRY_DURATION" -sha256 -extfile client_ext.cnf
|
||||||
|
|
||||||
|
# 4. Allow docker to read files
|
||||||
|
sudo chmod 644 *.pem
|
||||||
|
sudo chmod 644 *.key
|
||||||
|
sudo chmod 644 *.csr
|
||||||
15
Chirpstack_v4/certs/client.csr
Normal file
15
Chirpstack_v4/certs/client.csr
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
-----BEGIN CERTIFICATE REQUEST-----
|
||||||
|
MIICWjCCAUICAQAwFTETMBEGA1UEAwwKY2hpcnBzdGFjazCCASIwDQYJKoZIhvcN
|
||||||
|
AQEBBQADggEPADCCAQoCggEBANHis8iB4W6S09ApGHYMuFQjgi8D5Fg68iOVBEA5
|
||||||
|
rBeJBh79EzB0KwS6Xfo2x2P7pFC2wA0heBip1Em3zH6l3OYx5zOz11Ilwkxk+3de
|
||||||
|
cwx5bmVX4x656HOpxWfXGo1h8/ycvsRQaClcfm3rxsTzGozz97+4jBfTjpYYPZ2p
|
||||||
|
sf5YGx4l7KjZmj2ZL2MQJW/bSHUPPGXcDq28cH68HEeBlf1fbZXSxbmnag/b0KaM
|
||||||
|
bQRMpHOdcoKHS50w6JN+QYvgdDkxMCVc0podw7mkujDyoYSEbTr+zwD7ZNqEC94Z
|
||||||
|
/V1t3OuPZeVpf4WBxgGB4w4teWgWCGDvsHULQ0gVvl1iTWcCAwEAAaAAMA0GCSqG
|
||||||
|
SIb3DQEBCwUAA4IBAQB3ywp1iJKIJFT8ilgzi6Q0mmwJEJUuUfBBYRjy+mULf5hO
|
||||||
|
o5ClclLKf5Cn5q+NCF+6KILyeUcJbhOauOyxfHlNZFGKnB1mR0boWDJVB+GF3fTZ
|
||||||
|
C49IBIdyNdeGAAgqZjjVUaC9mRALeHIwbIqC3Z9aMDlj5HCn5v9cbCHkKzfDtkb4
|
||||||
|
BabkaRq04qTPA0yeIPX9+amPi8GpEuCPjbCi2Aa19LrOGvAMCPIrNGM4DnB5ixBA
|
||||||
|
1XUjrnt9ZF34i5Lp6RCAb1uadEeUka//fC8Lnkf69dW3GIa+yWHk2Zdo+IbihIHH
|
||||||
|
A7/IinhUmgwDndZUtX3dCj7SdyrNmq7DryfCoTcc
|
||||||
|
-----END CERTIFICATE REQUEST-----
|
||||||
28
Chirpstack_v4/certs/client.key
Normal file
28
Chirpstack_v4/certs/client.key
Normal file
@@ -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-----
|
||||||
25
Chirpstack_v4/certs/client.pem
Normal file
25
Chirpstack_v4/certs/client.pem
Normal file
@@ -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-----
|
||||||
3
Chirpstack_v4/certs/client_ext.cnf
Normal file
3
Chirpstack_v4/certs/client_ext.cnf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
basicConstraints=CA:FALSE
|
||||||
|
keyUsage = digitalSignature, keyEncipherment
|
||||||
|
extendedKeyUsage = clientAuth
|
||||||
15
Chirpstack_v4/certs/server.csr
Normal file
15
Chirpstack_v4/certs/server.csr
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
-----BEGIN CERTIFICATE REQUEST-----
|
||||||
|
MIICWTCCAUECAQAwFDESMBAGA1UEAwwJbW9zcXVpdHRvMIIBIjANBgkqhkiG9w0B
|
||||||
|
AQEFAAOCAQ8AMIIBCgKCAQEAmxCLzZmmHiBWjya0IqWYiZ1n9EUF+Fs9Uss/ZbPx
|
||||||
|
Sp3EfzpWIxMFVVH72+p/G3Zq3m3G51W6+bxnMH4fjrr5imFhQcHX2ngSaKO2x0eg
|
||||||
|
P9Bs83Ar3kglsyVmMAv9OL0WiqrOMMpSAe8xuy19TtWWZ4vvzA64aNeKWaUemQAP
|
||||||
|
R9q8YXesXUqpq/gNg7Yeed6lmdlj4CoVnbzP3U2A3jt+9cCJBFdP4bKbA4dnpw/O
|
||||||
|
8OiK2O+D7CzDPJ/j4iJODKs5ly7rvWITL7UfhY58pXjrmx9g41VvhRz20M5edOud
|
||||||
|
qHbuch6JWshFutoTaKlxa18C8Ovv8IhpOv8Gvi5RWrl10wIDAQABoAAwDQYJKoZI
|
||||||
|
hvcNAQELBQADggEBAHR2fcf9Rtgx+mScPhBlPQeoSY0niAmV1XVdbP3EGDQTMNPA
|
||||||
|
QwqafEIpbzqUlBXA9q3MnQa1ccrg+uUU5CFqCNi9eZQ4gSh/ftt4RBAl9jDeeudI
|
||||||
|
OXpt3QuBzXjydI1iRIcFBmTLhl+owJ6da/CHMVmfh9Gx2Ti24VFxzvsOkxYK8OB4
|
||||||
|
zbvwfUY4JpIgx1W2dTapHFVCtWSQmikZKDx5QxO/iaEeecRfW0+N+x68z286jFNN
|
||||||
|
lX7QlBAhkWqMmldZ7Caj6VE213OmqNkPNmhIiakdkVVa+YGA5Vcug/OkMb+OcpwQ
|
||||||
|
wWK7BKE3dZqRNyaANVtM6+VczMSx5ykeN2z19O4=
|
||||||
|
-----END CERTIFICATE REQUEST-----
|
||||||
28
Chirpstack_v4/certs/server.key
Normal file
28
Chirpstack_v4/certs/server.key
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
-----BEGIN PRIVATE KEY-----
|
||||||
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCbEIvNmaYeIFaP
|
||||||
|
JrQipZiJnWf0RQX4Wz1Syz9ls/FKncR/OlYjEwVVUfvb6n8bdmrebcbnVbr5vGcw
|
||||||
|
fh+OuvmKYWFBwdfaeBJoo7bHR6A/0GzzcCveSCWzJWYwC/04vRaKqs4wylIB7zG7
|
||||||
|
LX1O1ZZni+/MDrho14pZpR6ZAA9H2rxhd6xdSqmr+A2Dth553qWZ2WPgKhWdvM/d
|
||||||
|
TYDeO371wIkEV0/hspsDh2enD87w6IrY74PsLMM8n+PiIk4MqzmXLuu9YhMvtR+F
|
||||||
|
jnyleOubH2DjVW+FHPbQzl50652odu5yHolayEW62hNoqXFrXwLw6+/wiGk6/wa+
|
||||||
|
LlFauXXTAgMBAAECggEAAXRSpbbEpYgLDrKWSxOQie5wlnrutDTdTUM9x1D9oRqm
|
||||||
|
nc8Hk+nG6jmTlrdCb6BZFJwYbcArw8eHIMqLOOBpcci5pPn90RobKmjAugWSVU3L
|
||||||
|
SbE8aLlz//hx93LtzxsS/tXX4H/m3TRASVX0BvIRPJTXj3f0bP2+Wc30zeKHOB+N
|
||||||
|
U3FnKvWGU44DHw3X3mPx9eOTR/uelYMUyW3wlXUp6O4I0MoArMyYZnFS139ViC/p
|
||||||
|
oRrbo4wTSUfnSb1VDlOfR16KFPx5jp5A5PvIe3otJuY1QjFZ5Qtd5cCXBzwRYzeT
|
||||||
|
At7ZCcdtFiLl13bsgZ31QIadcXpNYxSwCe4MAz7/YQKBgQDRHjdoNlhE2BbvWuR8
|
||||||
|
HxV0ksQeQ/LBAXVYSGQA1fWs8d/j3O/Ogkb5dK1IXT069p1cMEoJSSx672dsG32J
|
||||||
|
aMgrxey7xFz/IGyvvcud7Go1QPDE/8jtOaeCbgPv1XWOXfVb/yB0ukWRE3a9sCZt
|
||||||
|
KDZtC7mjRSfVvhb3YBGGWNILYwKBgQC91BNu1SsrG+kd4PJ8bHQJNIh5YTEf/YWk
|
||||||
|
XUiyAb86cgujwe0QrD/HEMi3T2JKKMcnvBluM9UFtrJrtUTiiiR7ZONYiRVdLmrp
|
||||||
|
sRZlKNrn2S3EdncFJbyZAJHXp7v2x7V0U7F6vqVtSunERRdkGno8a/GpPi34QwCE
|
||||||
|
S15AiwJO0QKBgBeHfNh+9OOaJMp9waOto65gLSzynEfXMCrkykvFx0TUWkq7O0hT
|
||||||
|
JEVBOZYg15jg0sfirxHoZ9bVRR/G4BMr9Qnn1UEzUPtr3I7Rni2AwlqHmg+wcB0x
|
||||||
|
FYX5dvvvWrDQJaFaTX6UzusJ85xYS5qQob8XSKX0TA0ivFbNOmuRZuDdAoGBALJD
|
||||||
|
++/kXgLA1j3J5s4z5xBR9ivOuxxor904ATGxdEzFluq1DhTPPaGKwINtGEe+XbCR
|
||||||
|
82vLXyxbcti1RThdNH9wshONwLNeCObm97oOEO0Txeguu/zogGFK6KsWCO1qhJv2
|
||||||
|
kMBNUvr9E+TOYXYPa2VclXgzPWZcPZr/UEbahFNRAoGAH9uSNBT3u7cuPyaMcg+W
|
||||||
|
kyDuHDXcbtPqv4BSrUbODmV5poxysAVOdREzw9dT+D8kZkD9co4onpIg4dhz86GD
|
||||||
|
/WD3S8oyQzHmCKIrux5bXIHff0geJIoQzTceY+WmC5H/D40TiajErdZNTHwMxppS
|
||||||
|
Zok5p2eRnLMJDstwk0qpu8E=
|
||||||
|
-----END PRIVATE KEY-----
|
||||||
25
Chirpstack_v4/certs/server.pem
Normal file
25
Chirpstack_v4/certs/server.pem
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIEQTCCAimgAwIBAgIUMIy443s38yzVr3X2mT9sq5KHepwwDQYJKoZIhvcNAQEL
|
||||||
|
BQAwGDEWMBQGA1UEAwwNQ2hpcnBTdGFjay1DQTAeFw0yNTA5MDYyMjUwMzlaFw0y
|
||||||
|
NjA5MDYyMjUwMzlaMBQxEjAQBgNVBAMMCW1vc3F1aXR0bzCCASIwDQYJKoZIhvcN
|
||||||
|
AQEBBQADggEPADCCAQoCggEBAJsQi82Zph4gVo8mtCKlmImdZ/RFBfhbPVLLP2Wz
|
||||||
|
8UqdxH86ViMTBVVR+9vqfxt2at5txudVuvm8ZzB+H466+YphYUHB19p4EmijtsdH
|
||||||
|
oD/QbPNwK95IJbMlZjAL/Ti9FoqqzjDKUgHvMbstfU7VlmeL78wOuGjXilmlHpkA
|
||||||
|
D0favGF3rF1Kqav4DYO2HnnepZnZY+AqFZ28z91NgN47fvXAiQRXT+GymwOHZ6cP
|
||||||
|
zvDoitjvg+wswzyf4+IiTgyrOZcu671iEy+1H4WOfKV465sfYONVb4Uc9tDOXnTr
|
||||||
|
nah27nIeiVrIRbraE2ipcWtfAvDr7/CIaTr/Br4uUVq5ddMCAwEAAaOBhjCBgzAJ
|
||||||
|
BgNVHRMEAjAAMAsGA1UdDwQEAwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAUBgNV
|
||||||
|
HREEDTALggltb3NxdWl0dG8wHQYDVR0OBBYEFA83paA4LWbOxnVa4FaOE5sT5KUK
|
||||||
|
MB8GA1UdIwQYMBaAFBWDUH7IG6eRzQT1TZWddhkjNxQCMA0GCSqGSIb3DQEBCwUA
|
||||||
|
A4ICAQCdqV9BPu7UKQgqmfty9txnO5Go4JxNx5zuABby1uGNdYD/zOD0UaROluB+
|
||||||
|
e7vRrdOcIf4nGa4j8LwAdZjr7i95v80mW0ZN11P4jhWSTSK3+SGbi+a9vznaIof0
|
||||||
|
o6D4XTY6T6DV2fv5D+jM5OHJGeQgKD175/Y7TNjCdbdLld3iujo4JwUnK4FQpite
|
||||||
|
sEBv/Aq8UjMtLlZGYt5gYd79nTxOQXsKl7xq/Tyngro+8bTxA34k3fPy2EloosJV
|
||||||
|
b4btP88TsWeeR74KihNLU3jLdtAzVhj7bdIx25zsLtk6rBvhIrazTY4lanVSydmK
|
||||||
|
ytdoH4fhiCLWvda4IU921Py732nei4PRjxgywGlWy9xukFHH+kcRLBelFig8qc/u
|
||||||
|
joYeh/LdhHoqYEPwC3K/SDNA1f/gbt7U31RUBds2viwZxpbYn1jdynnS+bvFgDaY
|
||||||
|
7qdQ2Vx1U9Y6c4Qz/+a6XOTZQA89TRYF8QOGlGTwQLFRdAgtAw38JqvhTgFr7MHi
|
||||||
|
RzWlsfy+05JUnVJ64NY1dOigyNiC20v1A+Isn+Sy9i4V0o/h4ujAFERcg5PiJFHx
|
||||||
|
3SZwnPblx2lQJNMkQK2FeXUeZchKIGnIhTHFwIn27MkkrRWcs4o+sZoaZkVVEEtt
|
||||||
|
I4Lve5ecAyxG1eJtsRJ5GitgEA4SvdEo6/wxuDIVYBeZYrx04Q==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
4
Chirpstack_v4/certs/server_ext.cnf
Normal file
4
Chirpstack_v4/certs/server_ext.cnf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
basicConstraints=CA:FALSE
|
||||||
|
keyUsage = digitalSignature, keyEncipherment
|
||||||
|
extendedKeyUsage = serverAuth
|
||||||
|
subjectAltName = DNS:mosquitto
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="as923/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="as923/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="as923/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AS923"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
923200000,
|
||||||
|
923400000,
|
||||||
|
923600000,
|
||||||
|
923800000,
|
||||||
|
924000000,
|
||||||
|
924200000,
|
||||||
|
924400000,
|
||||||
|
924600000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=924500000
|
||||||
|
bandwidth=250000
|
||||||
|
spreading_factor=7
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="as923_2/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="as923_2/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="as923_2/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AS923"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
921400000,
|
||||||
|
921600000,
|
||||||
|
921800000,
|
||||||
|
922000000,
|
||||||
|
922200000,
|
||||||
|
922400000,
|
||||||
|
922600000,
|
||||||
|
922800000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=922700000
|
||||||
|
bandwidth=250000
|
||||||
|
spreading_factor=7
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="as923_3/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="as923_3/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="as923_3/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AS923"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
916600000,
|
||||||
|
916800000,
|
||||||
|
917000000,
|
||||||
|
917200000,
|
||||||
|
917400000,
|
||||||
|
917600000,
|
||||||
|
917800000,
|
||||||
|
918000000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=917900000
|
||||||
|
bandwidth=250000
|
||||||
|
spreading_factor=7
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="as923_4/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="as923_4/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="as923_4/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AS923"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
917300000,
|
||||||
|
917500000,
|
||||||
|
917700000,
|
||||||
|
917900000,
|
||||||
|
918100000,
|
||||||
|
918300000,
|
||||||
|
918500000,
|
||||||
|
918700000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=918600000
|
||||||
|
bandwidth=250000
|
||||||
|
spreading_factor=7
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="au915_0/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="au915_0/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="au915_0/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AU915"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
915200000,
|
||||||
|
915400000,
|
||||||
|
915600000,
|
||||||
|
915800000,
|
||||||
|
916000000,
|
||||||
|
916200000,
|
||||||
|
916400000,
|
||||||
|
916600000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=915900000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="au915_1/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="au915_1/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="au915_1/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AU915"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
916800000,
|
||||||
|
917000000,
|
||||||
|
917200000,
|
||||||
|
917400000,
|
||||||
|
917600000,
|
||||||
|
917800000,
|
||||||
|
918000000,
|
||||||
|
918200000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=917500000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="au915_2/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="au915_2/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="au915_2/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AU915"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
918400000,
|
||||||
|
918600000,
|
||||||
|
918800000,
|
||||||
|
919000000,
|
||||||
|
919200000,
|
||||||
|
919400000,
|
||||||
|
919600000,
|
||||||
|
919800000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=919100000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="au915_3/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="au915_3/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="au915_3/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AU915"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
920000000,
|
||||||
|
920200000,
|
||||||
|
920400000,
|
||||||
|
920600000,
|
||||||
|
920800000,
|
||||||
|
921000000,
|
||||||
|
921200000,
|
||||||
|
921400000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=920700000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="au915_4/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="au915_4/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="au915_4/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AU915"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
921600000,
|
||||||
|
921800000,
|
||||||
|
922000000,
|
||||||
|
922200000,
|
||||||
|
922400000,
|
||||||
|
922600000,
|
||||||
|
922800000,
|
||||||
|
923000000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=922300000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="au915_5/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="au915_5/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="au915_5/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AU915"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
923200000,
|
||||||
|
923400000,
|
||||||
|
923600000,
|
||||||
|
923800000,
|
||||||
|
924000000,
|
||||||
|
924200000,
|
||||||
|
924400000,
|
||||||
|
924600000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=923900000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="au915_6/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="au915_6/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="au915_6/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AU915"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
924800000,
|
||||||
|
925000000,
|
||||||
|
925200000,
|
||||||
|
925400000,
|
||||||
|
925600000,
|
||||||
|
925800000,
|
||||||
|
926000000,
|
||||||
|
926200000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=925500000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="au915_7/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="au915_7/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="au915_7/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="AU915"
|
||||||
|
frequency_min=915000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
926400000,
|
||||||
|
926600000,
|
||||||
|
926800000,
|
||||||
|
927000000,
|
||||||
|
927200000,
|
||||||
|
927400000,
|
||||||
|
927600000,
|
||||||
|
927800000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=927100000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_0/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_0/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_0/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
470300000,
|
||||||
|
470500000,
|
||||||
|
470700000,
|
||||||
|
470900000,
|
||||||
|
471100000,
|
||||||
|
471300000,
|
||||||
|
471500000,
|
||||||
|
471700000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_1/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_1/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_1/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
471900000,
|
||||||
|
472100000,
|
||||||
|
472300000,
|
||||||
|
472500000,
|
||||||
|
472700000,
|
||||||
|
472900000,
|
||||||
|
473100000,
|
||||||
|
473300000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_10/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_10/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_10/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
486300000,
|
||||||
|
486500000,
|
||||||
|
486700000,
|
||||||
|
486900000,
|
||||||
|
487100000,
|
||||||
|
487300000,
|
||||||
|
487500000,
|
||||||
|
487700000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_11/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_11/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_11/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
487900000,
|
||||||
|
488100000,
|
||||||
|
488300000,
|
||||||
|
488500000,
|
||||||
|
488700000,
|
||||||
|
488900000,
|
||||||
|
489100000,
|
||||||
|
489300000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_2/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_2/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_2/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
473500000,
|
||||||
|
473700000,
|
||||||
|
473900000,
|
||||||
|
474100000,
|
||||||
|
474300000,
|
||||||
|
474500000,
|
||||||
|
474700000,
|
||||||
|
474900000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_3/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_3/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_3/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
475100000,
|
||||||
|
475300000,
|
||||||
|
475500000,
|
||||||
|
475700000,
|
||||||
|
475900000,
|
||||||
|
476100000,
|
||||||
|
476300000,
|
||||||
|
476500000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_4/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_4/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_4/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
476700000,
|
||||||
|
476900000,
|
||||||
|
477100000,
|
||||||
|
477300000,
|
||||||
|
477500000,
|
||||||
|
477700000,
|
||||||
|
477900000,
|
||||||
|
478100000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_5/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_5/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_5/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
478300000,
|
||||||
|
478500000,
|
||||||
|
478700000,
|
||||||
|
478900000,
|
||||||
|
479100000,
|
||||||
|
479300000,
|
||||||
|
479500000,
|
||||||
|
479700000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_6/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_6/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_6/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
479900000,
|
||||||
|
480100000,
|
||||||
|
480300000,
|
||||||
|
480500000,
|
||||||
|
480700000,
|
||||||
|
480900000,
|
||||||
|
481100000,
|
||||||
|
481300000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_7/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_7/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_7/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
481500000,
|
||||||
|
481700000,
|
||||||
|
481900000,
|
||||||
|
482100000,
|
||||||
|
482300000,
|
||||||
|
482500000,
|
||||||
|
482700000,
|
||||||
|
482900000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_8/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_8/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_8/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
483100000,
|
||||||
|
483300000,
|
||||||
|
483500000,
|
||||||
|
483700000,
|
||||||
|
483900000,
|
||||||
|
484100000,
|
||||||
|
484300000,
|
||||||
|
484500000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="cn470_9/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="cn470_9/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="cn470_9/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="CN470"
|
||||||
|
frequency_min=470000000
|
||||||
|
frequency_max=510000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
484700000,
|
||||||
|
484900000,
|
||||||
|
485100000,
|
||||||
|
485300000,
|
||||||
|
485500000,
|
||||||
|
485700000,
|
||||||
|
485900000,
|
||||||
|
486100000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="eu433/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="eu433/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="eu433/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="EU433"
|
||||||
|
frequency_min=433050000
|
||||||
|
frequency_max=434900000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
433175000,
|
||||||
|
433375000,
|
||||||
|
433575000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["ssl://mosquitto:8883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="eu868/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="eu868/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="eu868/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
|
||||||
|
region="EU868"
|
||||||
|
frequency_min=863000000
|
||||||
|
frequency_max=870000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
868100000,
|
||||||
|
868300000,
|
||||||
|
868500000,
|
||||||
|
867100000,
|
||||||
|
867300000,
|
||||||
|
867500000,
|
||||||
|
867700000,
|
||||||
|
867900000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=868300000
|
||||||
|
bandwidth=250000
|
||||||
|
spreading_factor=7
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.fsk]
|
||||||
|
frequency=868800000
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["ssl://mosquitto:8883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="in865/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="in865/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="in865/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
ca_cert=""
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
|
||||||
|
region="IN865"
|
||||||
|
frequency_min=865000000
|
||||||
|
frequency_max=867000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
865062500,
|
||||||
|
865402500,
|
||||||
|
865985000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="kr920/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="kr920/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="kr920/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="KR920"
|
||||||
|
frequency_min=920900000
|
||||||
|
frequency_max=923300000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
922100000,
|
||||||
|
922300000,
|
||||||
|
922500000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="ru864/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="ru864/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="ru864/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="RU864"
|
||||||
|
frequency_min=863000000
|
||||||
|
frequency_max=870000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
868900000,
|
||||||
|
869100000,
|
||||||
|
]
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="us915_0/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="us915_0/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="us915_0/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="US915"
|
||||||
|
frequency_min=923000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
902300000,
|
||||||
|
902500000,
|
||||||
|
902700000,
|
||||||
|
902900000,
|
||||||
|
903100000,
|
||||||
|
903300000,
|
||||||
|
903500000,
|
||||||
|
903700000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=903000000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="us915_1/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="us915_1/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="us915_1/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="US915"
|
||||||
|
frequency_min=923000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
903900000,
|
||||||
|
904100000,
|
||||||
|
904300000,
|
||||||
|
904500000,
|
||||||
|
904700000,
|
||||||
|
904900000,
|
||||||
|
905100000,
|
||||||
|
905300000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=904600000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="us915_2/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="us915_2/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="us915_2/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="US915"
|
||||||
|
frequency_min=923000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
905500000,
|
||||||
|
905700000,
|
||||||
|
905900000,
|
||||||
|
906100000,
|
||||||
|
906300000,
|
||||||
|
906500000,
|
||||||
|
906700000,
|
||||||
|
906900000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=906200000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="us915_3/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="us915_3/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="us915_3/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="US915"
|
||||||
|
frequency_min=923000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
907100000,
|
||||||
|
907300000,
|
||||||
|
907500000,
|
||||||
|
907700000,
|
||||||
|
907900000,
|
||||||
|
908100000,
|
||||||
|
908300000,
|
||||||
|
908500000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=907800000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="us915_4/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="us915_4/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="us915_4/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="US915"
|
||||||
|
frequency_min=923000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
908700000,
|
||||||
|
908900000,
|
||||||
|
909100000,
|
||||||
|
909300000,
|
||||||
|
909500000,
|
||||||
|
909700000,
|
||||||
|
909900000,
|
||||||
|
910100000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=909400000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="us915_5/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="us915_5/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="us915_5/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="US915"
|
||||||
|
frequency_min=923000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
910300000,
|
||||||
|
910500000,
|
||||||
|
910700000,
|
||||||
|
910900000,
|
||||||
|
911100000,
|
||||||
|
911300000,
|
||||||
|
911500000,
|
||||||
|
911700000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=911000000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="us915_6/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="us915_6/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="us915_6/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="US915"
|
||||||
|
frequency_min=923000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
911900000,
|
||||||
|
912100000,
|
||||||
|
912300000,
|
||||||
|
912500000,
|
||||||
|
912700000,
|
||||||
|
912900000,
|
||||||
|
913100000,
|
||||||
|
913300000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=912600000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["tcp://mosquitto:1883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
[integration.mqtt]
|
||||||
|
event_topic_template="us915_7/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
|
||||||
|
state_topic_template="us915_7/gateway/{{ .GatewayID }}/state/{{ .StateType }}"
|
||||||
|
command_topic_template="us915_7/gateway/{{ .GatewayID }}/command/#"
|
||||||
|
|
||||||
|
[backend]
|
||||||
|
type="basic_station"
|
||||||
|
|
||||||
|
[backend.basic_station]
|
||||||
|
bind=":3001"
|
||||||
|
tls_cert=""
|
||||||
|
tls_key=""
|
||||||
|
ca_cert=""
|
||||||
|
|
||||||
|
region="US915"
|
||||||
|
frequency_min=923000000
|
||||||
|
frequency_max=928000000
|
||||||
|
|
||||||
|
|
||||||
|
[[backend.basic_station.concentrators]]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.multi_sf]
|
||||||
|
frequencies=[
|
||||||
|
913500000,
|
||||||
|
913700000,
|
||||||
|
913900000,
|
||||||
|
914100000,
|
||||||
|
914300000,
|
||||||
|
914500000,
|
||||||
|
914700000,
|
||||||
|
914900000,
|
||||||
|
]
|
||||||
|
|
||||||
|
[backend.basic_station.concentrators.lora_std]
|
||||||
|
frequency=914200000
|
||||||
|
bandwidth=500000
|
||||||
|
spreading_factor=8
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# See https://www.chirpstack.io/gateway-bridge/install/config/ for a full
|
||||||
|
# configuration example and documentation.
|
||||||
|
|
||||||
|
# [integration.mqtt.auth.generic]
|
||||||
|
# servers=["tcp://mosquitto:1883"]
|
||||||
|
# username=""
|
||||||
|
# password=""
|
||||||
|
|
||||||
|
# Gateway backend configuration.
|
||||||
|
[backend]
|
||||||
|
|
||||||
|
# Backend type.
|
||||||
|
#
|
||||||
|
# Valid options are:
|
||||||
|
# * semtech_udp
|
||||||
|
# * concentratord
|
||||||
|
# * basic_station
|
||||||
|
type="semtech_udp"
|
||||||
|
|
||||||
|
|
||||||
|
# Semtech UDP packet-forwarder backend.
|
||||||
|
[backend.semtech_udp]
|
||||||
|
|
||||||
|
# ip:port to bind the UDP listener to
|
||||||
|
#
|
||||||
|
# Example: 0.0.0.0:1700 to listen on port 1700 for all network interfaces.
|
||||||
|
# This is the listener to which the packet-forwarder forwards its data
|
||||||
|
# so make sure the 'serv_port_up' and 'serv_port_down' from your
|
||||||
|
# packet-forwarder matches this port.
|
||||||
|
udp_bind = "0.0.0.0:1700"
|
||||||
|
|
||||||
|
# Fake RX timestamp.
|
||||||
|
#
|
||||||
|
# Fake the RX time when the gateway does not have GPS, in which case
|
||||||
|
# the time would otherwise be unset.
|
||||||
|
fake_rx_time=false
|
||||||
|
|
||||||
|
|
||||||
|
[integration.mqtt.auth.generic]
|
||||||
|
servers=["ssl://mosquitto:8883"]
|
||||||
|
username=""
|
||||||
|
password=""
|
||||||
|
|
||||||
|
ca_cert="/etc/chirpstack-gateway-bridge/certs/ca.pem"
|
||||||
|
tls_cert="/etc/chirpstack-gateway-bridge/certs/client.pem"
|
||||||
|
tls_key="/etc/chirpstack-gateway-bridge/certs/client.key"
|
||||||
204
Chirpstack_v4/configuration/chirpstack/chirpstack.toml
Normal file
204
Chirpstack_v4/configuration/chirpstack/chirpstack.toml
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
# Logging.
|
||||||
|
[logging]
|
||||||
|
|
||||||
|
# Log level.
|
||||||
|
#
|
||||||
|
# Options are: trace, debug, info, warn error.
|
||||||
|
level="info"
|
||||||
|
|
||||||
|
|
||||||
|
# PostgreSQL configuration.
|
||||||
|
[postgresql]
|
||||||
|
|
||||||
|
# PostgreSQL DSN.
|
||||||
|
#
|
||||||
|
# Format example: postgres://<USERNAME>:<PASSWORD>@<HOSTNAME>/<DATABASE>?sslmode=<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"
|
||||||
|
|
||||||
204
Chirpstack_v4/configuration/chirpstack/region_as923.toml
Normal file
204
Chirpstack_v4/configuration/chirpstack/region_as923.toml
Normal file
@@ -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
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user