mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-02-06 18:59:13 +00:00
Initial commit.
This commit is contained in:
commit
96fe672fc7
7
.docker-compose/postgresql/initdb/0001-init_chirpstack.sh
Executable file
7
.docker-compose/postgresql/initdb/0001-init_chirpstack.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
|
||||
create role chirpstack with login password 'chirpstack';
|
||||
create database chirpstack with owner chirpstack;
|
||||
EOSQL
|
7
.docker-compose/postgresql/initdb/0002-chirpstack_extensions.sh
Executable file
7
.docker-compose/postgresql/initdb/0002-chirpstack_extensions.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="chirpstack" <<-EOSQL
|
||||
create extension pg_trgm;
|
||||
create extension hstore;
|
||||
EOSQL
|
7
.docker-compose/postgresql/initdb/0003-init_chirpstack_integration.sh
Executable file
7
.docker-compose/postgresql/initdb/0003-init_chirpstack_integration.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
|
||||
create role chirpstack_integration with login password 'chirpstack_integration';
|
||||
create database chirpstack_integration with owner chirpstack_integration;
|
||||
EOSQL
|
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="chirpstack_integration" <<-EOSQL
|
||||
create extension hstore;
|
||||
EOSQL
|
7
.docker-compose/postgresql/initdb/0005-init_chirpstack_test.sh
Executable file
7
.docker-compose/postgresql/initdb/0005-init_chirpstack_test.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
|
||||
create role chirpstack_test with login password 'chirpstack_test';
|
||||
create database chirpstack_test with owner chirpstack_test;
|
||||
EOSQL
|
7
.docker-compose/postgresql/initdb/0006-chirpstack_test_extensions.sh
Executable file
7
.docker-compose/postgresql/initdb/0006-chirpstack_test_extensions.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname="chirpstack_test" <<-EOSQL
|
||||
create extension pg_trgm;
|
||||
create extension hstore;
|
||||
EOSQL
|
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@ -0,0 +1,4 @@
|
||||
.git
|
||||
**/target
|
||||
**/node_modules
|
||||
Dockerfile
|
35
.github/workflows/main.yml
vendored
Normal file
35
.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
-
|
||||
name: Cargo cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
.cargo/registry/index/
|
||||
.cargo/registry/cache/
|
||||
.cargo/git/db/
|
||||
target/
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
||||
|
||||
-
|
||||
name: Build UI
|
||||
run: make build-ui
|
||||
|
||||
-
|
||||
name: Run tests
|
||||
run: make test
|
19
.gitignore
vendored
Normal file
19
.gitignore
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# hidden files
|
||||
.*
|
||||
|
||||
# Log files
|
||||
*.log
|
||||
|
||||
# Rust target directory
|
||||
**/target
|
||||
|
||||
# Certificates
|
||||
/chirpstack/configuration/certs
|
||||
/chirpstack/configuration/private_*.toml
|
||||
|
||||
# UI
|
||||
/ui/node_modules
|
||||
/ui/build
|
||||
|
||||
# API
|
||||
/api/js/node_modules
|
4303
Cargo.lock
generated
Normal file
4303
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
15
Cargo.toml
Normal file
15
Cargo.toml
Normal file
@ -0,0 +1,15 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"chirpstack",
|
||||
"lrwn",
|
||||
"backend",
|
||||
"api/rust",
|
||||
]
|
||||
|
||||
[profile.release]
|
||||
opt-level = 'z'
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
|
||||
#[patch.crates-io]
|
||||
#quick-js = { path = "../quickjs-rs" }
|
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
FROM rust:1.59.0-alpine as development
|
||||
|
||||
ENV PROJECT_PATH=/chirpstack
|
||||
|
||||
# See: https://github.com/diesel-rs/diesel/issues/700
|
||||
ENV RUSTFLAGS="-C target-feature=-crt-static"
|
||||
|
||||
RUN apk --no-cache add \
|
||||
make cmake build-base clang perl protobuf libpq-dev \
|
||||
nodejs npm yarn
|
||||
|
||||
RUN rustup component add rustfmt
|
||||
|
||||
RUN mkdir -p $PROJECT_PATH
|
||||
COPY . $PROJECT_PATH
|
||||
|
||||
RUN cd $PROJECT_PATH/ui && yarn install && yarn build
|
||||
RUN cd $PROJECT_PATH/chirpstack && cargo build --release
|
||||
|
||||
FROM alpine:3.15.0 as production
|
||||
|
||||
run apk --no-cache add ca-certificates tzdata libpq
|
||||
COPY --from=development /chirpstack/target/release/chirpstack /usr/bin/chirpstack
|
||||
COPY --from=development /chirpstack/chirpstack/configuration/* /etc/chirpstack/
|
||||
USER nobody:nogroup
|
||||
ENTRYPOINT ["/usr/bin/chirpstack"]
|
31
Dockerfile-devel
Normal file
31
Dockerfile-devel
Normal file
@ -0,0 +1,31 @@
|
||||
FROM rust:1.59.0-buster
|
||||
|
||||
ENV PROJECT_PATH=/chirpstack
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
make \
|
||||
cmake \
|
||||
git \
|
||||
bash \
|
||||
screen \
|
||||
postgresql-client \
|
||||
mosquitto-clients \
|
||||
redis-tools \
|
||||
rpm \
|
||||
clang \
|
||||
gcc-arm-linux-gnueabi \
|
||||
g++-arm-linux-gnueabi \
|
||||
gcc-arm-linux-gnueabihf \
|
||||
g++-arm-linux-gnueabihf \
|
||||
gcc-aarch64-linux-gnu \
|
||||
g++-aarch64-linux-gnu \
|
||||
&& apt-get clean
|
||||
|
||||
RUN rustup component add rustfmt clippy
|
||||
RUN cargo install diesel_cli --no-default-features --features postgres
|
||||
RUN cargo install cargo-deb
|
||||
RUN cargo install cargo-rpm
|
||||
|
||||
RUN mkdir -p $PROJECT_PATH
|
||||
WORKDIR $PROJECT_PATH/chirpstack
|
22
LICENSE
Normal file
22
LICENSE
Normal file
@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2022 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.
|
||||
|
34
Makefile
Normal file
34
Makefile
Normal file
@ -0,0 +1,34 @@
|
||||
.PHONY: build-development build-release build-ui devshell devshell-ui test test-server update-images
|
||||
|
||||
# Builds a debug / development binary.
|
||||
build-debug: build-ui
|
||||
docker-compose run --rm chirpstack make debug
|
||||
|
||||
build-release: build-ui
|
||||
docker-compose run --rm chirpstack make release
|
||||
|
||||
# Builds the UI.
|
||||
build-ui:
|
||||
docker-compose run --rm chirpstack-ui make build
|
||||
|
||||
# Enters the devshell for ChirpStack development.
|
||||
devshell:
|
||||
docker-compose run --rm --service-ports chirpstack bash
|
||||
|
||||
# Enters the devshell for ChirpStack UI development.
|
||||
devshell-ui:
|
||||
docker-compose run --rm --service-ports chirpstack-ui bash
|
||||
|
||||
# Runs the tests
|
||||
test:
|
||||
docker-compose run --rm chirpstack make test
|
||||
docker-compose run --rm chirpstack make test-lrwn
|
||||
|
||||
# Starts the ChirpStack server (for testing only).
|
||||
test-server: build-ui
|
||||
docker-compose run --rm --service-ports chirpstack make test-server
|
||||
|
||||
# Update the Docker development images
|
||||
update-images:
|
||||
docker-compose build chirpstack
|
||||
docker-compose build chirpstack-ui
|
31
README.md
Normal file
31
README.md
Normal file
@ -0,0 +1,31 @@
|
||||
# ChirpStack open-source LoRaWAN Network Server
|
||||
|
||||

|
||||
|
||||
ChirpStack is an open-source LoRaWAN Network Server, part of the
|
||||
[ChirpStack](https://www.chirpstack.io/) project.
|
||||
|
||||
**Note:** this repository contains the source of what is going to be
|
||||
ChirpStack v4. This release merges the ChirpStack Network Server and
|
||||
ChirpStack Application Server components into a single service, making
|
||||
it a lot easier to setup a multi-region ChirpStack instance. This is
|
||||
still work in progress.
|
||||
|
||||
Please refer to the forum announcement for background information:
|
||||
https://forum.chirpstack.io/t/changes-coming-to-chirpstack/13101
|
||||
|
||||
## Testing / building from source
|
||||
|
||||
To build ChirpStack from source, run the following command:
|
||||
|
||||
```bash
|
||||
make test-server
|
||||
```
|
||||
|
||||
Note: this requires a Linux environment With Docker and Docker Compose
|
||||
setup. Pre-compiled (test) binaries will be provided soon.
|
||||
|
||||
## License
|
||||
|
||||
ChirpStack Network Server is distributed under the MIT license. See also
|
||||
[LICENSE](https://github.com/brocaar/chirpstack/blob/master/LICENSE).
|
9
api/Dockerfile-go
Normal file
9
api/Dockerfile-go
Normal file
@ -0,0 +1,9 @@
|
||||
FROM golang:1.18-alpine
|
||||
|
||||
ENV PROJECT_PATH=/chirpstack/api
|
||||
RUN apk add --no-cache make git bash protobuf protobuf-dev
|
||||
|
||||
RUN git clone https://github.com/googleapis/googleapis.git /googleapis
|
||||
|
||||
RUN mkdir -p $PROJECT_PATH
|
||||
WORKDIR $PROJECT_PATH
|
12
api/Dockerfile-grpc-web
Normal file
12
api/Dockerfile-grpc-web
Normal file
@ -0,0 +1,12 @@
|
||||
FROM alpine:3
|
||||
|
||||
ENV PROJECT_PATH=/chirpstack/api
|
||||
RUN apk add --no-cache protobuf protobuf-dev make bash git
|
||||
|
||||
RUN git clone https://github.com/googleapis/googleapis.git /googleapis
|
||||
|
||||
ADD https://github.com/grpc/grpc-web/releases/download/1.2.1/protoc-gen-grpc-web-1.2.1-linux-x86_64 /usr/bin/protoc-gen-grpc-web
|
||||
RUN chmod +x /usr/bin/protoc-gen-grpc-web
|
||||
|
||||
RUN mkdir -p $PROJECT_PATH
|
||||
WORKDIR $PROJECT_PATH
|
9
api/Dockerfile-js
Normal file
9
api/Dockerfile-js
Normal file
@ -0,0 +1,9 @@
|
||||
FROM node:12
|
||||
|
||||
ENV PROJECT_PATH=/chirpstack/api
|
||||
RUN apt update && apt install -y protobuf-compiler libprotobuf-dev git bash
|
||||
|
||||
RUN git clone https://github.com/googleapis/googleapis.git /googleapis
|
||||
|
||||
RUN mkdir -p $PROJECT_PATH
|
||||
WORKDIR $PROJECT_PATH
|
9
api/Dockerfile-python
Normal file
9
api/Dockerfile-python
Normal file
@ -0,0 +1,9 @@
|
||||
FROM python:3.8
|
||||
|
||||
ENV PROJECT_PATH=/chirpstack/api
|
||||
|
||||
RUN git clone https://github.com/protocolbuffers/protobuf.git /protobuf
|
||||
RUN git clone https://github.com/googleapis/googleapis.git /googleapis
|
||||
|
||||
RUN mkdir -p PROJECT_PATH
|
||||
WORKDIR $PROJECT_PATH
|
13
api/Dockerfile-rust
Normal file
13
api/Dockerfile-rust
Normal file
@ -0,0 +1,13 @@
|
||||
FROM rust:1.56
|
||||
|
||||
ENV PROJECT_PATH=/chirpstack/api
|
||||
RUN apt-get update && \
|
||||
apt-get install -y make git bash && \
|
||||
apt-get clean
|
||||
|
||||
RUN git clone https://github.com/googleapis/googleapis.git /googleapis
|
||||
|
||||
RUN rustup component add rustfmt
|
||||
|
||||
RUN mkdir -p $PROJECT_PATH
|
||||
WORKDIR $PROJECT_PATH
|
13
api/Makefile
Normal file
13
api/Makefile
Normal file
@ -0,0 +1,13 @@
|
||||
.PHONY: rust grpc-web go
|
||||
|
||||
all:
|
||||
docker-compose up
|
||||
|
||||
rust:
|
||||
docker-compose run --rm chirpstack-api-rust
|
||||
|
||||
grpc-web:
|
||||
docker-compose run --rm chirpstack-api-grpc-web
|
||||
|
||||
go:
|
||||
docker-compose run --rm chirpstack-api-go
|
45
api/docker-compose.yml
Normal file
45
api/docker-compose.yml
Normal file
@ -0,0 +1,45 @@
|
||||
version: "2"
|
||||
services:
|
||||
chirpstack-api-rust:
|
||||
environment:
|
||||
- VERSION=4.0.0
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-rust
|
||||
command: bash -c "cd rust && make all"
|
||||
volumes:
|
||||
- ./:/chirpstack/api
|
||||
chirpstack-api-go:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-go
|
||||
command: bash -c "cd go && make all"
|
||||
volumes:
|
||||
- ./:/chirpstack/api
|
||||
chirpstack-api-grpc-web:
|
||||
environment:
|
||||
- VERSION=4.0.0
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-grpc-web
|
||||
command: bash -c "cd grpc-web && make all"
|
||||
volumes:
|
||||
- ./:/chirpstack/api
|
||||
chirpstack-api-js:
|
||||
environment:
|
||||
- VERSION=4.0.0
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-js
|
||||
command: bash -c "cd js && make all"
|
||||
volumes:
|
||||
- ./:/chirpstack/api
|
||||
chirpstack-api-python:
|
||||
environment:
|
||||
- VERSION=4.0.0
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile-python
|
||||
command: bash -c "cd js && make all"
|
||||
volumes:
|
||||
- ./:/chirpstack/api
|
33
api/go/Makefile
Normal file
33
api/go/Makefile
Normal file
@ -0,0 +1,33 @@
|
||||
.PHONY: requirements common gw api integration meta
|
||||
|
||||
PROTOC_ARGS := -I=/googleapis -I=../proto --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative
|
||||
|
||||
all: requirements common gw api integration meta
|
||||
|
||||
requirements:
|
||||
go mod download
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go
|
||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc
|
||||
|
||||
common:
|
||||
protoc ${PROTOC_ARGS} common/common.proto
|
||||
|
||||
gw:
|
||||
protoc ${PROTOC_ARGS} gw/gw.proto
|
||||
|
||||
api:
|
||||
protoc ${PROTOC_ARGS} api/internal.proto
|
||||
protoc ${PROTOC_ARGS} api/user.proto
|
||||
protoc ${PROTOC_ARGS} api/tenant.proto
|
||||
protoc ${PROTOC_ARGS} api/application.proto
|
||||
protoc ${PROTOC_ARGS} api/device_profile.proto
|
||||
protoc ${PROTOC_ARGS} api/device.proto
|
||||
protoc ${PROTOC_ARGS} api/gateway.proto
|
||||
protoc ${PROTOC_ARGS} api/frame_log.proto
|
||||
protoc ${PROTOC_ARGS} api/multicast_group.proto
|
||||
|
||||
integration:
|
||||
protoc ${PROTOC_ARGS} integration/integration.proto
|
||||
|
||||
meta:
|
||||
protoc ${PROTOC_ARGS} meta/meta.proto
|
6082
api/go/api/application.pb.go
Normal file
6082
api/go/api/application.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
1704
api/go/api/application_grpc.pb.go
Normal file
1704
api/go/api/application_grpc.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
3059
api/go/api/device.pb.go
Normal file
3059
api/go/api/device.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
754
api/go/api/device_grpc.pb.go
Normal file
754
api/go/api/device_grpc.pb.go
Normal file
@ -0,0 +1,754 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.18.1
|
||||
// source: api/device.proto
|
||||
|
||||
package v4
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// 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 {
|
||||
// Create the given device.
|
||||
Create(ctx context.Context, in *CreateDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Get returns the device for the given DevEUI.
|
||||
Get(ctx context.Context, in *GetDeviceRequest, opts ...grpc.CallOption) (*GetDeviceResponse, error)
|
||||
// Update the given device.
|
||||
Update(ctx context.Context, in *UpdateDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Delete the device with the given DevEUI.
|
||||
Delete(ctx context.Context, in *DeleteDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Get the list of devices.
|
||||
List(ctx context.Context, in *ListDevicesRequest, opts ...grpc.CallOption) (*ListDevicesResponse, error)
|
||||
// Create the given device-keys.
|
||||
CreateKeys(ctx context.Context, in *CreateDeviceKeysRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Get the device-keys for the given DevEUI.
|
||||
GetKeys(ctx context.Context, in *GetDeviceKeysRequest, opts ...grpc.CallOption) (*GetDeviceKeysResponse, error)
|
||||
// Update the given device-keys.
|
||||
UpdateKeys(ctx context.Context, in *UpdateDeviceKeysRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Delete the device-keys for the given DevEUI.
|
||||
DeleteKeys(ctx context.Context, in *DeleteDeviceKeysRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// FlushDevNonces flushes the OTAA device nonces.
|
||||
FlushDevNonces(ctx context.Context, in *FlushDevNoncesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Activate (re)activates the device with the given parameters (for ABP or for importing OTAA activations).
|
||||
Activate(ctx context.Context, in *ActivateDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Deactivate de-activates the device.
|
||||
Deactivate(ctx context.Context, in *DeactivateDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// GetActivation returns the current activation details of the device (OTAA or ABP).
|
||||
GetActivation(ctx context.Context, in *GetDeviceActivationRequest, opts ...grpc.CallOption) (*GetDeviceActivationResponse, error)
|
||||
// GetRandomDevAddr returns a random DevAddr taking the NwkID prefix into account.
|
||||
GetRandomDevAddr(ctx context.Context, in *GetRandomDevAddrRequest, opts ...grpc.CallOption) (*GetRandomDevAddrResponse, error)
|
||||
// GetStats returns the device stats.
|
||||
GetStats(ctx context.Context, in *GetDeviceStatsRequest, opts ...grpc.CallOption) (*GetDeviceStatsResponse, error)
|
||||
// Enqueue adds the given item to the downlink queue.
|
||||
Enqueue(ctx context.Context, in *EnqueueDeviceQueueItemRequest, opts ...grpc.CallOption) (*EnqueueDeviceQueueItemResponse, error)
|
||||
// FlushQueue flushes the downlink device-queue.
|
||||
FlushQueue(ctx context.Context, in *FlushDeviceQueueRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// GetQueue returns the downlink device-queue.
|
||||
GetQueue(ctx context.Context, in *GetDeviceQueueItemsRequest, opts ...grpc.CallOption) (*GetDeviceQueueItemsResponse, error)
|
||||
}
|
||||
|
||||
type deviceServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDeviceServiceClient(cc grpc.ClientConnInterface) DeviceServiceClient {
|
||||
return &deviceServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) Create(ctx context.Context, in *CreateDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/Create", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) Get(ctx context.Context, in *GetDeviceRequest, opts ...grpc.CallOption) (*GetDeviceResponse, error) {
|
||||
out := new(GetDeviceResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/Get", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) Update(ctx context.Context, in *UpdateDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/Update", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) Delete(ctx context.Context, in *DeleteDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/Delete", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) List(ctx context.Context, in *ListDevicesRequest, opts ...grpc.CallOption) (*ListDevicesResponse, error) {
|
||||
out := new(ListDevicesResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/List", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) CreateKeys(ctx context.Context, in *CreateDeviceKeysRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/CreateKeys", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) GetKeys(ctx context.Context, in *GetDeviceKeysRequest, opts ...grpc.CallOption) (*GetDeviceKeysResponse, error) {
|
||||
out := new(GetDeviceKeysResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/GetKeys", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) UpdateKeys(ctx context.Context, in *UpdateDeviceKeysRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/UpdateKeys", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) DeleteKeys(ctx context.Context, in *DeleteDeviceKeysRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/DeleteKeys", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) FlushDevNonces(ctx context.Context, in *FlushDevNoncesRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/FlushDevNonces", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) Activate(ctx context.Context, in *ActivateDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/Activate", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) Deactivate(ctx context.Context, in *DeactivateDeviceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/Deactivate", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) GetActivation(ctx context.Context, in *GetDeviceActivationRequest, opts ...grpc.CallOption) (*GetDeviceActivationResponse, error) {
|
||||
out := new(GetDeviceActivationResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/GetActivation", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) GetRandomDevAddr(ctx context.Context, in *GetRandomDevAddrRequest, opts ...grpc.CallOption) (*GetRandomDevAddrResponse, error) {
|
||||
out := new(GetRandomDevAddrResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/GetRandomDevAddr", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) GetStats(ctx context.Context, in *GetDeviceStatsRequest, opts ...grpc.CallOption) (*GetDeviceStatsResponse, error) {
|
||||
out := new(GetDeviceStatsResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/GetStats", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) Enqueue(ctx context.Context, in *EnqueueDeviceQueueItemRequest, opts ...grpc.CallOption) (*EnqueueDeviceQueueItemResponse, error) {
|
||||
out := new(EnqueueDeviceQueueItemResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/Enqueue", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) FlushQueue(ctx context.Context, in *FlushDeviceQueueRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/FlushQueue", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceServiceClient) GetQueue(ctx context.Context, in *GetDeviceQueueItemsRequest, opts ...grpc.CallOption) (*GetDeviceQueueItemsResponse, error) {
|
||||
out := new(GetDeviceQueueItemsResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceService/GetQueue", 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 {
|
||||
// Create the given device.
|
||||
Create(context.Context, *CreateDeviceRequest) (*emptypb.Empty, error)
|
||||
// Get returns the device for the given DevEUI.
|
||||
Get(context.Context, *GetDeviceRequest) (*GetDeviceResponse, error)
|
||||
// Update the given device.
|
||||
Update(context.Context, *UpdateDeviceRequest) (*emptypb.Empty, error)
|
||||
// Delete the device with the given DevEUI.
|
||||
Delete(context.Context, *DeleteDeviceRequest) (*emptypb.Empty, error)
|
||||
// Get the list of devices.
|
||||
List(context.Context, *ListDevicesRequest) (*ListDevicesResponse, error)
|
||||
// Create the given device-keys.
|
||||
CreateKeys(context.Context, *CreateDeviceKeysRequest) (*emptypb.Empty, error)
|
||||
// Get the device-keys for the given DevEUI.
|
||||
GetKeys(context.Context, *GetDeviceKeysRequest) (*GetDeviceKeysResponse, error)
|
||||
// Update the given device-keys.
|
||||
UpdateKeys(context.Context, *UpdateDeviceKeysRequest) (*emptypb.Empty, error)
|
||||
// Delete the device-keys for the given DevEUI.
|
||||
DeleteKeys(context.Context, *DeleteDeviceKeysRequest) (*emptypb.Empty, error)
|
||||
// FlushDevNonces flushes the OTAA device nonces.
|
||||
FlushDevNonces(context.Context, *FlushDevNoncesRequest) (*emptypb.Empty, error)
|
||||
// Activate (re)activates the device with the given parameters (for ABP or for importing OTAA activations).
|
||||
Activate(context.Context, *ActivateDeviceRequest) (*emptypb.Empty, error)
|
||||
// Deactivate de-activates the device.
|
||||
Deactivate(context.Context, *DeactivateDeviceRequest) (*emptypb.Empty, error)
|
||||
// GetActivation returns the current activation details of the device (OTAA or ABP).
|
||||
GetActivation(context.Context, *GetDeviceActivationRequest) (*GetDeviceActivationResponse, error)
|
||||
// GetRandomDevAddr returns a random DevAddr taking the NwkID prefix into account.
|
||||
GetRandomDevAddr(context.Context, *GetRandomDevAddrRequest) (*GetRandomDevAddrResponse, error)
|
||||
// GetStats returns the device stats.
|
||||
GetStats(context.Context, *GetDeviceStatsRequest) (*GetDeviceStatsResponse, error)
|
||||
// Enqueue adds the given item to the downlink queue.
|
||||
Enqueue(context.Context, *EnqueueDeviceQueueItemRequest) (*EnqueueDeviceQueueItemResponse, error)
|
||||
// FlushQueue flushes the downlink device-queue.
|
||||
FlushQueue(context.Context, *FlushDeviceQueueRequest) (*emptypb.Empty, error)
|
||||
// GetQueue returns the downlink device-queue.
|
||||
GetQueue(context.Context, *GetDeviceQueueItemsRequest) (*GetDeviceQueueItemsResponse, error)
|
||||
mustEmbedUnimplementedDeviceServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedDeviceServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedDeviceServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedDeviceServiceServer) Create(context.Context, *CreateDeviceRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) Get(context.Context, *GetDeviceRequest) (*GetDeviceResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) Update(context.Context, *UpdateDeviceRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) Delete(context.Context, *DeleteDeviceRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) List(context.Context, *ListDevicesRequest) (*ListDevicesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) CreateKeys(context.Context, *CreateDeviceKeysRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateKeys not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) GetKeys(context.Context, *GetDeviceKeysRequest) (*GetDeviceKeysResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetKeys not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) UpdateKeys(context.Context, *UpdateDeviceKeysRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateKeys not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) DeleteKeys(context.Context, *DeleteDeviceKeysRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteKeys not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) FlushDevNonces(context.Context, *FlushDevNoncesRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FlushDevNonces not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) Activate(context.Context, *ActivateDeviceRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Activate not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) Deactivate(context.Context, *DeactivateDeviceRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Deactivate not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) GetActivation(context.Context, *GetDeviceActivationRequest) (*GetDeviceActivationResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetActivation not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) GetRandomDevAddr(context.Context, *GetRandomDevAddrRequest) (*GetRandomDevAddrResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetRandomDevAddr not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) GetStats(context.Context, *GetDeviceStatsRequest) (*GetDeviceStatsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetStats not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) Enqueue(context.Context, *EnqueueDeviceQueueItemRequest) (*EnqueueDeviceQueueItemResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Enqueue not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) FlushQueue(context.Context, *FlushDeviceQueueRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FlushQueue not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceServiceServer) GetQueue(context.Context, *GetDeviceQueueItemsRequest) (*GetDeviceQueueItemsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetQueue 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_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateDeviceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).Create(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/Create",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).Create(ctx, req.(*CreateDeviceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetDeviceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).Get(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/Get",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).Get(ctx, req.(*GetDeviceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateDeviceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).Update(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/Update",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).Update(ctx, req.(*UpdateDeviceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteDeviceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).Delete(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/Delete",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).Delete(ctx, req.(*DeleteDeviceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListDevicesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).List(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/List",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).List(ctx, req.(*ListDevicesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_CreateKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateDeviceKeysRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).CreateKeys(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/CreateKeys",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).CreateKeys(ctx, req.(*CreateDeviceKeysRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_GetKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetDeviceKeysRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).GetKeys(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/GetKeys",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).GetKeys(ctx, req.(*GetDeviceKeysRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_UpdateKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateDeviceKeysRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).UpdateKeys(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/UpdateKeys",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).UpdateKeys(ctx, req.(*UpdateDeviceKeysRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_DeleteKeys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteDeviceKeysRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).DeleteKeys(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/DeleteKeys",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).DeleteKeys(ctx, req.(*DeleteDeviceKeysRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_FlushDevNonces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FlushDevNoncesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).FlushDevNonces(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/FlushDevNonces",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).FlushDevNonces(ctx, req.(*FlushDevNoncesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_Activate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ActivateDeviceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).Activate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/Activate",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).Activate(ctx, req.(*ActivateDeviceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_Deactivate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeactivateDeviceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).Deactivate(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/Deactivate",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).Deactivate(ctx, req.(*DeactivateDeviceRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_GetActivation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetDeviceActivationRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).GetActivation(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/GetActivation",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).GetActivation(ctx, req.(*GetDeviceActivationRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_GetRandomDevAddr_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetRandomDevAddrRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).GetRandomDevAddr(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/GetRandomDevAddr",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).GetRandomDevAddr(ctx, req.(*GetRandomDevAddrRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_GetStats_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetDeviceStatsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).GetStats(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/GetStats",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).GetStats(ctx, req.(*GetDeviceStatsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_Enqueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EnqueueDeviceQueueItemRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).Enqueue(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/Enqueue",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).Enqueue(ctx, req.(*EnqueueDeviceQueueItemRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_FlushQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FlushDeviceQueueRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).FlushQueue(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/FlushQueue",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).FlushQueue(ctx, req.(*FlushDeviceQueueRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _DeviceService_GetQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetDeviceQueueItemsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DeviceServiceServer).GetQueue(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/api.DeviceService/GetQueue",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DeviceServiceServer).GetQueue(ctx, req.(*GetDeviceQueueItemsRequest))
|
||||
}
|
||||
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: "api.DeviceService",
|
||||
HandlerType: (*DeviceServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "Create",
|
||||
Handler: _DeviceService_Create_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Get",
|
||||
Handler: _DeviceService_Get_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Update",
|
||||
Handler: _DeviceService_Update_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Delete",
|
||||
Handler: _DeviceService_Delete_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "List",
|
||||
Handler: _DeviceService_List_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateKeys",
|
||||
Handler: _DeviceService_CreateKeys_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetKeys",
|
||||
Handler: _DeviceService_GetKeys_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateKeys",
|
||||
Handler: _DeviceService_UpdateKeys_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteKeys",
|
||||
Handler: _DeviceService_DeleteKeys_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FlushDevNonces",
|
||||
Handler: _DeviceService_FlushDevNonces_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Activate",
|
||||
Handler: _DeviceService_Activate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Deactivate",
|
||||
Handler: _DeviceService_Deactivate_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetActivation",
|
||||
Handler: _DeviceService_GetActivation_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRandomDevAddr",
|
||||
Handler: _DeviceService_GetRandomDevAddr_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetStats",
|
||||
Handler: _DeviceService_GetStats_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "Enqueue",
|
||||
Handler: _DeviceService_Enqueue_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FlushQueue",
|
||||
Handler: _DeviceService_FlushQueue_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetQueue",
|
||||
Handler: _DeviceService_GetQueue_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/device.proto",
|
||||
}
|
1487
api/go/api/device_profile.pb.go
Normal file
1487
api/go/api/device_profile.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
298
api/go/api/device_profile_grpc.pb.go
Normal file
298
api/go/api/device_profile_grpc.pb.go
Normal file
@ -0,0 +1,298 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.18.1
|
||||
// source: api/device_profile.proto
|
||||
|
||||
package v4
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
)
|
||||
|
||||
// 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
|
||||
|
||||
// DeviceProfileServiceClient is the client API for DeviceProfileService 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 DeviceProfileServiceClient interface {
|
||||
// Create the given device-profile.
|
||||
Create(ctx context.Context, in *CreateDeviceProfileRequest, opts ...grpc.CallOption) (*CreateDeviceProfileResponse, error)
|
||||
// Get the device-profile for the given ID.
|
||||
Get(ctx context.Context, in *GetDeviceProfileRequest, opts ...grpc.CallOption) (*GetDeviceProfileResponse, error)
|
||||
// Update the given device-profile.
|
||||
Update(ctx context.Context, in *UpdateDeviceProfileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// Delete the device-profile with the given ID.
|
||||
Delete(ctx context.Context, in *DeleteDeviceProfileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
|
||||
// List the available device-profiles.
|
||||
List(ctx context.Context, in *ListDeviceProfilesRequest, opts ...grpc.CallOption) (*ListDeviceProfilesResponse, error)
|
||||
// List available ADR algorithms.
|
||||
ListAdrAlgorithms(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListDeviceProfileAdrAlgorithmsResponse, error)
|
||||
}
|
||||
|
||||
type deviceProfileServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDeviceProfileServiceClient(cc grpc.ClientConnInterface) DeviceProfileServiceClient {
|
||||
return &deviceProfileServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *deviceProfileServiceClient) Create(ctx context.Context, in *CreateDeviceProfileRequest, opts ...grpc.CallOption) (*CreateDeviceProfileResponse, error) {
|
||||
out := new(CreateDeviceProfileResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceProfileService/Create", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceProfileServiceClient) Get(ctx context.Context, in *GetDeviceProfileRequest, opts ...grpc.CallOption) (*GetDeviceProfileResponse, error) {
|
||||
out := new(GetDeviceProfileResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceProfileService/Get", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceProfileServiceClient) Update(ctx context.Context, in *UpdateDeviceProfileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceProfileService/Update", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceProfileServiceClient) Delete(ctx context.Context, in *DeleteDeviceProfileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
|
||||
out := new(emptypb.Empty)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceProfileService/Delete", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceProfileServiceClient) List(ctx context.Context, in *ListDeviceProfilesRequest, opts ...grpc.CallOption) (*ListDeviceProfilesResponse, error) {
|
||||
out := new(ListDeviceProfilesResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceProfileService/List", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *deviceProfileServiceClient) ListAdrAlgorithms(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListDeviceProfileAdrAlgorithmsResponse, error) {
|
||||
out := new(ListDeviceProfileAdrAlgorithmsResponse)
|
||||
err := c.cc.Invoke(ctx, "/api.DeviceProfileService/ListAdrAlgorithms", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// DeviceProfileServiceServer is the server API for DeviceProfileService service.
|
||||
// All implementations must embed UnimplementedDeviceProfileServiceServer
|
||||
// for forward compatibility
|
||||
type DeviceProfileServiceServer interface {
|
||||
// Create the given device-profile.
|
||||
Create(context.Context, *CreateDeviceProfileRequest) (*CreateDeviceProfileResponse, error)
|
||||
// Get the device-profile for the given ID.
|
||||
Get(context.Context, *GetDeviceProfileRequest) (*GetDeviceProfileResponse, error)
|
||||
// Update the given device-profile.
|
||||
Update(context.Context, *UpdateDeviceProfileRequest) (*emptypb.Empty, error)
|
||||
// Delete the device-profile with the given ID.
|
||||
Delete(context.Context, *DeleteDeviceProfileRequest) (*emptypb.Empty, error)
|
||||
// List the available device-profiles.
|
||||
List(context.Context, *ListDeviceProfilesRequest) (*ListDeviceProfilesResponse, error)
|
||||
// List available ADR algorithms.
|
||||
ListAdrAlgorithms(context.Context, *emptypb.Empty) (*ListDeviceProfileAdrAlgorithmsResponse, error)
|
||||
mustEmbedUnimplementedDeviceProfileServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedDeviceProfileServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedDeviceProfileServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedDeviceProfileServiceServer) Create(context.Context, *CreateDeviceProfileRequest) (*CreateDeviceProfileResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceProfileServiceServer) Get(context.Context, *GetDeviceProfileRequest) (*GetDeviceProfileResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceProfileServiceServer) Update(context.Context, *UpdateDeviceProfileRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceProfileServiceServer) Delete(context.Context, *DeleteDeviceProfileRequest) (*emptypb.Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceProfileServiceServer) List(context.Context, *ListDeviceProfilesRequest) (*ListDeviceProfilesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceProfileServiceServer) ListAdrAlgorithms(context.Context, *emptypb.Empty) (*ListDeviceProfileAdrAlgorithmsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListAdrAlgorithms not implemented")
|
||||
}
|
||||
func (UnimplementedDeviceProfileServiceServer) mustEmbedUnimplementedDeviceProfileServiceServer() {}
|
||||
|
||||
// UnsafeDeviceProfileServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DeviceProfileServiceServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeDeviceProfileServiceServer interface {
|
||||
mustEmbedUnimplementedDeviceProfileServiceServer()
|
||||
}
|
||||
|
||||
func RegisterDeviceProfileServiceServer(s grpc.ServiceRegistrar, srv DeviceProfileServiceServer) {
|
||||