Synchronize changes from the kubeedge/staging directory on 2025.2.10

Signed-off-by: wbc6080 <wangbincheng4@huawei.com>
This commit is contained in:
wbc6080 2025-02-10 20:48:23 +08:00
parent 96009b7561
commit a408ea0341
9 changed files with 50 additions and 4585 deletions

View File

@ -1,20 +0,0 @@
FROM golang:1.20.10-alpine3.18 AS builder
WORKDIR /build
ENV GO111MODULE=on \
GOPROXY=https://goproxy.cn,direct
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o main cmd/main.go
FROM ubuntu:18.04
RUN mkdir -p kubeedge
COPY --from=builder /build/main kubeedge/
COPY ./config.yaml kubeedge/
WORKDIR kubeedge

View File

@ -21,6 +21,7 @@ import (
"time"
"k8s.io/klog/v2"
"github.com/kubeedge/Template/driver"
"github.com/kubeedge/mapper-framework/pkg/common"
)

View File

@ -1,6 +1,8 @@
module github.com/kubeedge/Template
go 1.21
go 1.22.0
toolchain go1.23.2
require (
github.com/eclipse/paho.mqtt.golang v1.2.0
@ -13,9 +15,10 @@ require (
github.com/taosdata/driver-go/v3 v3.5.1
go.opentelemetry.io/otel v1.23.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.23.0
go.opentelemetry.io/otel/metric v1.23.0
go.opentelemetry.io/otel/sdk v1.23.0
go.opentelemetry.io/otel/sdk/metric v1.23.0
k8s.io/klog/v2 v2.110.1
k8s.io/klog/v2 v2.120.1
)
require (
@ -37,7 +40,6 @@ require (
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/oapi-codegen/runtime v1.0.0 // indirect
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace // indirect
go.opentelemetry.io/otel/metric v1.23.0 // indirect
go.opentelemetry.io/otel/trace v1.23.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
golang.org/x/net v0.30.0 // indirect

View File

@ -18,7 +18,6 @@ github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7j
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
@ -65,8 +64,8 @@ github.com/oapi-codegen/runtime v1.0.0 h1:P4rqFX5fMFWqRzY9M/3YF9+aPSPPB06IzP2P7o
github.com/oapi-codegen/runtime v1.0.0/go.mod h1:LmCUMQuPB4M/nLXilQXhHw+BLZdDb18B34OO356yJ/A=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk=
github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
@ -121,5 +120,5 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
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=
k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0=
k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=

25
go.mod
View File

@ -1,6 +1,8 @@
module github.com/kubeedge/mapper-framework
go 1.22
go 1.22.0
toolchain go1.23.2
require (
github.com/avast/retry-go v3.0.0+incompatible
@ -8,21 +10,22 @@ require (
github.com/gorilla/mux v1.8.0
github.com/kubeedge/api v0.0.0
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace
golang.org/x/net v0.23.0 // indirect
golang.org/x/net v0.25.0 // indirect
google.golang.org/grpc v1.63.0
google.golang.org/protobuf v1.33.0
google.golang.org/protobuf v1.35.2
gopkg.in/yaml.v2 v2.4.0
k8s.io/klog/v2 v2.110.1
k8s.io/klog/v2 v2.120.1
)
require (
github.com/go-logr/logr v1.4.1 // indirect
github.com/kr/pretty v0.1.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
replace github.com/kubeedge/api => ../api

46
go.sum
View File

@ -1,45 +1,51 @@
github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0=
github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
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/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
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.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace h1:9PNP1jnUjRhfmGMlkXHjYPishpcw4jpSt/V/xYY3FMA=
github.com/spf13/pflag v1.0.6-0.20210604193023-d5e0c0615ace/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY=
google.golang.org/grpc v1.63.0 h1:WjKe+dnvABXyPJMD7KDNLxtoGk5tgk+YFWN6cBWjZE8=
google.golang.org/grpc v1.63.0/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0=
k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=

File diff suppressed because it is too large Load Diff

View File

@ -1,395 +0,0 @@
/*
Copyright 2023 The KubeEdge Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// To regenerate api.pb.go run hack/generate-dmi.sh
syntax = "proto3";
//option go_package = "path;name";
option go_package = "./;v1beta1";
package v1beta1;
import "google/protobuf/any.proto";
// DeviceManagerService defines the public APIS for remote device management.
// The server is implemented by the module of device manager in edgecore
// and the client is implemented by the device mapper for upstreaming.
// The mapper should register itself to the device manager when it is online
// to get the list of devices. And then the mapper can report the device status to the device manager.
service DeviceManagerService {
// MapperRegister registers the information of the mapper to device manager
// when the mapper is online. Device manager returns the list of devices and device models which
// this mapper should manage.
rpc MapperRegister(MapperRegisterRequest) returns (MapperRegisterResponse) {}
// ReportDeviceStatus reports the status of devices to device manager.
// When the mapper collects some properties of a device, it can make them a map of device twins
// and report it to the device manager through the interface of ReportDeviceStatus.
rpc ReportDeviceStatus(ReportDeviceStatusRequest) returns (ReportDeviceStatusResponse) {}
}
// DeviceMapperService defines the public APIS for remote device management.
// The server is implemented by the device mapper
// and the client is implemented by the module of device manager in edgecore for downstreaming.
// The device manager can manage the device life cycle through these interfaces provided by DeviceMapperService.
// When device manager gets a message of device management from cloudcore, it should call the corresponding grpc interface
// to make the mapper maintain the list of device information.
service DeviceMapperService {
// RegisterDevice registers a device to the device mapper.
// Device manager registers a device instance with the information of device
// to the mapper through the interface of RegisterDevice.
// When the mapper gets the request of register with device information,
// it should add the device to the device list and connect to the real physical device via the specific protocol.
rpc RegisterDevice(RegisterDeviceRequest) returns (RegisterDeviceResponse) {}
// RemoveDevice unregisters a device to the device mapper.
// Device manager unregisters a device instance with the name of device
// to the mapper through the interface of RemoveDevice.
// When the mapper gets the request of unregister with device name,
// it should remove the device from the device list and disconnect to the real physical device.
rpc RemoveDevice(RemoveDeviceRequest) returns (RemoveDeviceResponse) {}
// UpdateDevice updates a device to the device mapper
// Device manager updates the information of a device used by the mapper
// through the interface of UpdateDevice.
// The information of a device includes the meta data and the status data of a device.
// When the mapper gets the request of updating with the information of a device,
// it should update the device of the device list and connect to the real physical device via the updated information.
rpc UpdateDevice(UpdateDeviceRequest) returns (UpdateDeviceResponse) {}
// CreateDeviceModel creates a device model to the device mapper.
// Device manager sends the information of device model to the mapper
// through the interface of CreateDeviceModel.
// When the mapper gets the request of creating with the information of device model,
// it should create a new device model to the list of device models.
rpc CreateDeviceModel(CreateDeviceModelRequest) returns (CreateDeviceModelResponse) {}
// RemoveDeviceModel remove a device model to the device mapper.
// Device manager sends the name of device model to the mapper
// through the interface of RemoveDeviceModel.
// When the mapper gets the request of removing with the name of device model,
// it should remove the device model to the list of device models.
rpc RemoveDeviceModel(RemoveDeviceModelRequest) returns (RemoveDeviceModelResponse) {}
// UpdateDeviceModel update a device model to the device mapper.
// Device manager sends the information of device model to the mapper
// through the interface of UpdateDeviceModel.
// When the mapper gets the request of updating with the information of device model,
// it should update the device model to the list of device models.
rpc UpdateDeviceModel(UpdateDeviceModelRequest) returns (UpdateDeviceModelResponse) {}
// GetDevice get the information of a device from the device mapper.
// Device sends the request of querying device information with the device name to the mapper
// through the interface of GetDevice.
// When the mapper gets the request of querying with the device name,
// it should return the device information.
rpc GetDevice(GetDeviceRequest) returns (GetDeviceResponse) {}
}
message MapperRegisterRequest {
// The flag to show how device manager returns.
// True means device manager should return the device list in the response.
// False means device manager should just return nothing.
bool withData = 1;
// Mapper information to be registered to the device manager.
MapperInfo mapper = 2;
}
message MapperRegisterResponse {
// List of device models which the mapper maintains.
repeated DeviceModel modelList = 1;
// List of devices which the mapper maintains.
repeated Device deviceList = 2;
}
// DeviceModel specifies the information of a device model.
message DeviceModel {
// Name of a device model.
string name = 1;
// Specification of a device model.
DeviceModelSpec spec = 2;
}
// DeviceModelSpec is the specification of a device model.
message DeviceModelSpec {
// The properties provided by the device of this device model.
repeated ModelProperty properties = 1;
// The commands executed by the device of this device model.
repeated DeviceCommand commands = 2;
}
// ModelProperty is the property of a device.
message ModelProperty {
// The name of this property.
string name = 1;
// The description of this property.
string description = 2;
// The specific type of this property.
string type = 3;
// The access mode of this property, ReadOnly or ReadWrite.
string accessMode = 4;
// The minimum value of this property.
string minimum = 5;
// The maximum value of this property.
string maximum = 6;
// The unit of this property.
string unit = 7;
}
// DeviceCommond is the description of a command which the device supports.
message DeviceCommand {
// Name of the command.
string name = 1;
// Url of the command to access.
string url = 2;
// Method of the command.
string method = 3;
// Status code list which the command can return.
repeated string status_code = 4;
// Parameter list which the command carries.
repeated string parameters = 5;
// Response examples of the command.
bytes response = 6;
}
// Device is the description of a device instance.
message Device {
// Name of the device.
string name = 1;
// Specification of the device.
DeviceSpec spec = 2;
// Status of the device.
DeviceStatus status = 3;
}
// DeviceSpec is the specification of the device.
message DeviceSpec {
// The device model which the device references.
string deviceModelReference = 1;
// The specific config of the protocol to access to the device.
ProtocolConfig protocol = 2;
// List of properties which describe the device properties.
repeated DeviceProperty properties = 3;
}
// DeviceProperty describes the specifics all the properties of the device.
message DeviceProperty {
// The device property name to be accessed. It must be unique.
string name = 1;
// the desired value of the property configured by device manager.
TwinProperty desired = 2;
// Visitors are intended to be consumed by device mappers which connect to devices
// and collect data / perform actions on the device.
VisitorConfig visitors = 3;
// Define how frequent mapper will report the value.
int64 reportCycle = 4;
// Define how frequent mapper will collect from device.
int64 collectCycle = 5;
// whether be reported to the cloud
bool reportToCloud = 6;
// PushMethod represents the protocol used to push data,
PushMethod pushMethod = 7;
}
// ProtocolConfig is the specific config of the protocol to access to the device.
message ProtocolConfig {
// the name of the customized protocol.
string protocolName = 1;
// the config data of the customized protocol.
CustomizedValue configData = 2;
}
// the visitor to collect the properties of the device of customized protocol.
message VisitorConfig {
// the name of the customized protocol.
string protocolName = 1;
// the config data of the customized protocol.
CustomizedValue configData = 2;
}
// CustomizedValue is the customized value for developers.
message CustomizedValue {
// data is the customized value and it can be any form.
map<string, google.protobuf.Any> data = 1;
}
message PushMethod {
PushMethodHTTP http = 1;
PushMethodMQTT mqtt = 2;
DBMethod dbMethod = 3;
}
message PushMethodHTTP {
string hostname = 1;
int64 port = 2;
string requestpath = 3;
int64 timeout = 4;
}
message PushMethodMQTT {
// broker address, like mqtt://127.0.0.1:1883
string address = 1;
// publish topic for mqtt
string topic = 2;
// qos of mqtt publish param
int32 qos = 3;
// Is the message retained
bool retained = 4;
}
message DBMethod{
// the config of database .
DBMethodInfluxdb2 influxdb2 = 1;
DBMethodRedis redis = 2;
DBMethodTDEngine tdengine = 3;
}
message DBMethodInfluxdb2{
// the config of influx database.
Influxdb2ClientConfig influxdb2ClientConfig = 1;
Influxdb2DataConfig influxdb2DataConfig = 2;
}
message Influxdb2DataConfig{
// data config when push data to influx
string measurement = 1;
map<string, string> tag = 2;
string fieldKey = 3;
}
message Influxdb2ClientConfig{
// influx database url
string url = 1;
// usr org in influx database
string org = 2;
// usr bucket in influx database
string bucket = 3;
}
message DBMethodRedis{
// data config when push data to redis
RedisClientConfig redisClientConfig = 1;
}
message RedisClientConfig{
// redis address
string addr = 1;
// number of redis db
int32 db = 2;
// number of redis poolsize
int32 poolsize = 3;
// number of redis minidleconns
int32 minIdleConns =4;
}
message DBMethodTDEngine{
// data config when push data to tdengine
TDEngineClientConfig tdEngineClientConfig = 1;
}
message TDEngineClientConfig{
// tdengine address,like 127.0.0.1:6041
string addr = 1;
// tdengine database name
string dbname = 2;
}
// MapperInfo is the information of mapper.
message MapperInfo {
// name of the mapper.
string name = 1;
// version of the mapper.
string version = 2;
// api version of the mapper.
string api_version = 3;
// the protocol of the mapper.
string protocol = 4;
// the address of the mapper. it is a unix domain socket of grpc.
bytes address = 5;
// the state of the mapper.
string state = 6;
}
message ReportDeviceStatusRequest {
string deviceName = 1;
DeviceStatus reportedDevice = 2;
}
// DeviceStatus is the status of the device.
message DeviceStatus {
// the device twins of the device.
repeated Twin twins = 1;
}
// Twin is the digital model of a device. It contains a series of properties.
message Twin {
// the name of the property.
string propertyName = 1;
// the observedDesired value of the property configured by mapper.
TwinProperty observedDesired = 2;
// the reported value of the property from the real device.
TwinProperty reported = 3;
}
// TwinProperty is the specification of the property.
message TwinProperty {
// the value of the property.
string value = 1;
// the metadata to describe this property.
map<string, string> metadata = 2;
}
message ReportDeviceStatusResponse {}
message RegisterDeviceRequest {
Device device = 1;
}
message RegisterDeviceResponse {
string deviceName = 1;
}
message CreateDeviceModelRequest {
DeviceModel model = 1;
}
message CreateDeviceModelResponse {
string deviceModelName = 1;
}
message RemoveDeviceRequest {
string deviceName = 1;
}
message RemoveDeviceResponse {}
message RemoveDeviceModelRequest {
string modelName = 1;
}
message RemoveDeviceModelResponse {}
message UpdateDeviceRequest {
Device device = 1;
}
message UpdateDeviceResponse {}
message UpdateDeviceModelRequest {
DeviceModel model = 1;
}
message UpdateDeviceModelResponse {}
message GetDeviceRequest {
string deviceName = 1;
}
message GetDeviceResponse {
Device device = 1;
}

View File

@ -1,559 +0,0 @@
//
//Copyright 2023 The KubeEdge Authors.
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
// To regenerate api.pb.go run hack/generate-dmi.sh
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc v3.20.3
// source: api.proto
package v1beta1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
DeviceManagerService_MapperRegister_FullMethodName = "/v1beta1.DeviceManagerService/MapperRegister"
DeviceManagerService_ReportDeviceStatus_FullMethodName = "/v1beta1.DeviceManagerService/ReportDeviceStatus"
)
// DeviceManagerServiceClient is the client API for DeviceManagerService 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 DeviceManagerServiceClient interface {
// MapperRegister registers the information of the mapper to device manager
// when the mapper is online. Device manager returns the list of devices and device models which
// this mapper should manage.
MapperRegister(ctx context.Context, in *MapperRegisterRequest, opts ...grpc.CallOption) (*MapperRegisterResponse, error)
// ReportDeviceStatus reports the status of devices to device manager.
// When the mapper collects some properties of a device, it can make them a map of device twins
// and report it to the device manager through the interface of ReportDeviceStatus.
ReportDeviceStatus(ctx context.Context, in *ReportDeviceStatusRequest, opts ...grpc.CallOption) (*ReportDeviceStatusResponse, error)
}
type deviceManagerServiceClient struct {
cc grpc.ClientConnInterface
}
func NewDeviceManagerServiceClient(cc grpc.ClientConnInterface) DeviceManagerServiceClient {
return &deviceManagerServiceClient{cc}
}
func (c *deviceManagerServiceClient) MapperRegister(ctx context.Context, in *MapperRegisterRequest, opts ...grpc.CallOption) (*MapperRegisterResponse, error) {
out := new(MapperRegisterResponse)
err := c.cc.Invoke(ctx, DeviceManagerService_MapperRegister_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceManagerServiceClient) ReportDeviceStatus(ctx context.Context, in *ReportDeviceStatusRequest, opts ...grpc.CallOption) (*ReportDeviceStatusResponse, error) {
out := new(ReportDeviceStatusResponse)
err := c.cc.Invoke(ctx, DeviceManagerService_ReportDeviceStatus_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// DeviceManagerServiceServer is the server API for DeviceManagerService service.
// All implementations must embed UnimplementedDeviceManagerServiceServer
// for forward compatibility
type DeviceManagerServiceServer interface {
// MapperRegister registers the information of the mapper to device manager
// when the mapper is online. Device manager returns the list of devices and device models which
// this mapper should manage.
MapperRegister(context.Context, *MapperRegisterRequest) (*MapperRegisterResponse, error)
// ReportDeviceStatus reports the status of devices to device manager.
// When the mapper collects some properties of a device, it can make them a map of device twins
// and report it to the device manager through the interface of ReportDeviceStatus.
ReportDeviceStatus(context.Context, *ReportDeviceStatusRequest) (*ReportDeviceStatusResponse, error)
mustEmbedUnimplementedDeviceManagerServiceServer()
}
// UnimplementedDeviceManagerServiceServer must be embedded to have forward compatible implementations.
type UnimplementedDeviceManagerServiceServer struct {
}
func (UnimplementedDeviceManagerServiceServer) MapperRegister(context.Context, *MapperRegisterRequest) (*MapperRegisterResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method MapperRegister not implemented")
}
func (UnimplementedDeviceManagerServiceServer) ReportDeviceStatus(context.Context, *ReportDeviceStatusRequest) (*ReportDeviceStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReportDeviceStatus not implemented")
}
func (UnimplementedDeviceManagerServiceServer) mustEmbedUnimplementedDeviceManagerServiceServer() {}
// UnsafeDeviceManagerServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DeviceManagerServiceServer will
// result in compilation errors.
type UnsafeDeviceManagerServiceServer interface {
mustEmbedUnimplementedDeviceManagerServiceServer()
}
func RegisterDeviceManagerServiceServer(s grpc.ServiceRegistrar, srv DeviceManagerServiceServer) {
s.RegisterService(&DeviceManagerService_ServiceDesc, srv)
}
func _DeviceManagerService_MapperRegister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MapperRegisterRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceManagerServiceServer).MapperRegister(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceManagerService_MapperRegister_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceManagerServiceServer).MapperRegister(ctx, req.(*MapperRegisterRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceManagerService_ReportDeviceStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReportDeviceStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceManagerServiceServer).ReportDeviceStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceManagerService_ReportDeviceStatus_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceManagerServiceServer).ReportDeviceStatus(ctx, req.(*ReportDeviceStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
// DeviceManagerService_ServiceDesc is the grpc.ServiceDesc for DeviceManagerService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DeviceManagerService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "v1beta1.DeviceManagerService",
HandlerType: (*DeviceManagerServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "MapperRegister",
Handler: _DeviceManagerService_MapperRegister_Handler,
},
{
MethodName: "ReportDeviceStatus",
Handler: _DeviceManagerService_ReportDeviceStatus_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api.proto",
}
const (
DeviceMapperService_RegisterDevice_FullMethodName = "/v1beta1.DeviceMapperService/RegisterDevice"
DeviceMapperService_RemoveDevice_FullMethodName = "/v1beta1.DeviceMapperService/RemoveDevice"
DeviceMapperService_UpdateDevice_FullMethodName = "/v1beta1.DeviceMapperService/UpdateDevice"
DeviceMapperService_CreateDeviceModel_FullMethodName = "/v1beta1.DeviceMapperService/CreateDeviceModel"
DeviceMapperService_RemoveDeviceModel_FullMethodName = "/v1beta1.DeviceMapperService/RemoveDeviceModel"
DeviceMapperService_UpdateDeviceModel_FullMethodName = "/v1beta1.DeviceMapperService/UpdateDeviceModel"
DeviceMapperService_GetDevice_FullMethodName = "/v1beta1.DeviceMapperService/GetDevice"
)
// DeviceMapperServiceClient is the client API for DeviceMapperService 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 DeviceMapperServiceClient interface {
// RegisterDevice registers a device to the device mapper.
// Device manager registers a device instance with the information of device
// to the mapper through the interface of RegisterDevice.
// When the mapper gets the request of register with device information,
// it should add the device to the device list and connect to the real physical device via the specific protocol.
RegisterDevice(ctx context.Context, in *RegisterDeviceRequest, opts ...grpc.CallOption) (*RegisterDeviceResponse, error)
// RemoveDevice unregisters a device to the device mapper.
// Device manager unregisters a device instance with the name of device
// to the mapper through the interface of RemoveDevice.
// When the mapper gets the request of unregister with device name,
// it should remove the device from the device list and disconnect to the real physical device.
RemoveDevice(ctx context.Context, in *RemoveDeviceRequest, opts ...grpc.CallOption) (*RemoveDeviceResponse, error)
// UpdateDevice updates a device to the device mapper
// Device manager updates the information of a device used by the mapper
// through the interface of UpdateDevice.
// The information of a device includes the meta data and the status data of a device.
// When the mapper gets the request of updating with the information of a device,
// it should update the device of the device list and connect to the real physical device via the updated information.
UpdateDevice(ctx context.Context, in *UpdateDeviceRequest, opts ...grpc.CallOption) (*UpdateDeviceResponse, error)
// CreateDeviceModel creates a device model to the device mapper.
// Device manager sends the information of device model to the mapper
// through the interface of CreateDeviceModel.
// When the mapper gets the request of creating with the information of device model,
// it should create a new device model to the list of device models.
CreateDeviceModel(ctx context.Context, in *CreateDeviceModelRequest, opts ...grpc.CallOption) (*CreateDeviceModelResponse, error)
// RemoveDeviceModel remove a device model to the device mapper.
// Device manager sends the name of device model to the mapper
// through the interface of RemoveDeviceModel.
// When the mapper gets the request of removing with the name of device model,
// it should remove the device model to the list of device models.
RemoveDeviceModel(ctx context.Context, in *RemoveDeviceModelRequest, opts ...grpc.CallOption) (*RemoveDeviceModelResponse, error)
// UpdateDeviceModel update a device model to the device mapper.
// Device manager sends the information of device model to the mapper
// through the interface of UpdateDeviceModel.
// When the mapper gets the request of updating with the information of device model,
// it should update the device model to the list of device models.
UpdateDeviceModel(ctx context.Context, in *UpdateDeviceModelRequest, opts ...grpc.CallOption) (*UpdateDeviceModelResponse, error)
// GetDevice get the information of a device from the device mapper.
// Device sends the request of querying device information with the device name to the mapper
// through the interface of GetDevice.
// When the mapper gets the request of querying with the device name,
// it should return the device information.
GetDevice(ctx context.Context, in *GetDeviceRequest, opts ...grpc.CallOption) (*GetDeviceResponse, error)
}
type deviceMapperServiceClient struct {
cc grpc.ClientConnInterface
}
func NewDeviceMapperServiceClient(cc grpc.ClientConnInterface) DeviceMapperServiceClient {
return &deviceMapperServiceClient{cc}
}
func (c *deviceMapperServiceClient) RegisterDevice(ctx context.Context, in *RegisterDeviceRequest, opts ...grpc.CallOption) (*RegisterDeviceResponse, error) {
out := new(RegisterDeviceResponse)
err := c.cc.Invoke(ctx, DeviceMapperService_RegisterDevice_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceMapperServiceClient) RemoveDevice(ctx context.Context, in *RemoveDeviceRequest, opts ...grpc.CallOption) (*RemoveDeviceResponse, error) {
out := new(RemoveDeviceResponse)
err := c.cc.Invoke(ctx, DeviceMapperService_RemoveDevice_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceMapperServiceClient) UpdateDevice(ctx context.Context, in *UpdateDeviceRequest, opts ...grpc.CallOption) (*UpdateDeviceResponse, error) {
out := new(UpdateDeviceResponse)
err := c.cc.Invoke(ctx, DeviceMapperService_UpdateDevice_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceMapperServiceClient) CreateDeviceModel(ctx context.Context, in *CreateDeviceModelRequest, opts ...grpc.CallOption) (*CreateDeviceModelResponse, error) {
out := new(CreateDeviceModelResponse)
err := c.cc.Invoke(ctx, DeviceMapperService_CreateDeviceModel_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceMapperServiceClient) RemoveDeviceModel(ctx context.Context, in *RemoveDeviceModelRequest, opts ...grpc.CallOption) (*RemoveDeviceModelResponse, error) {
out := new(RemoveDeviceModelResponse)
err := c.cc.Invoke(ctx, DeviceMapperService_RemoveDeviceModel_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceMapperServiceClient) UpdateDeviceModel(ctx context.Context, in *UpdateDeviceModelRequest, opts ...grpc.CallOption) (*UpdateDeviceModelResponse, error) {
out := new(UpdateDeviceModelResponse)
err := c.cc.Invoke(ctx, DeviceMapperService_UpdateDeviceModel_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *deviceMapperServiceClient) GetDevice(ctx context.Context, in *GetDeviceRequest, opts ...grpc.CallOption) (*GetDeviceResponse, error) {
out := new(GetDeviceResponse)
err := c.cc.Invoke(ctx, DeviceMapperService_GetDevice_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// DeviceMapperServiceServer is the server API for DeviceMapperService service.
// All implementations must embed UnimplementedDeviceMapperServiceServer
// for forward compatibility
type DeviceMapperServiceServer interface {
// RegisterDevice registers a device to the device mapper.
// Device manager registers a device instance with the information of device
// to the mapper through the interface of RegisterDevice.
// When the mapper gets the request of register with device information,
// it should add the device to the device list and connect to the real physical device via the specific protocol.
RegisterDevice(context.Context, *RegisterDeviceRequest) (*RegisterDeviceResponse, error)
// RemoveDevice unregisters a device to the device mapper.
// Device manager unregisters a device instance with the name of device
// to the mapper through the interface of RemoveDevice.
// When the mapper gets the request of unregister with device name,
// it should remove the device from the device list and disconnect to the real physical device.
RemoveDevice(context.Context, *RemoveDeviceRequest) (*RemoveDeviceResponse, error)
// UpdateDevice updates a device to the device mapper
// Device manager updates the information of a device used by the mapper
// through the interface of UpdateDevice.
// The information of a device includes the meta data and the status data of a device.
// When the mapper gets the request of updating with the information of a device,
// it should update the device of the device list and connect to the real physical device via the updated information.
UpdateDevice(context.Context, *UpdateDeviceRequest) (*UpdateDeviceResponse, error)
// CreateDeviceModel creates a device model to the device mapper.
// Device manager sends the information of device model to the mapper
// through the interface of CreateDeviceModel.
// When the mapper gets the request of creating with the information of device model,
// it should create a new device model to the list of device models.
CreateDeviceModel(context.Context, *CreateDeviceModelRequest) (*CreateDeviceModelResponse, error)
// RemoveDeviceModel remove a device model to the device mapper.
// Device manager sends the name of device model to the mapper
// through the interface of RemoveDeviceModel.
// When the mapper gets the request of removing with the name of device model,
// it should remove the device model to the list of device models.
RemoveDeviceModel(context.Context, *RemoveDeviceModelRequest) (*RemoveDeviceModelResponse, error)
// UpdateDeviceModel update a device model to the device mapper.
// Device manager sends the information of device model to the mapper
// through the interface of UpdateDeviceModel.
// When the mapper gets the request of updating with the information of device model,
// it should update the device model to the list of device models.
UpdateDeviceModel(context.Context, *UpdateDeviceModelRequest) (*UpdateDeviceModelResponse, error)
// GetDevice get the information of a device from the device mapper.
// Device sends the request of querying device information with the device name to the mapper
// through the interface of GetDevice.
// When the mapper gets the request of querying with the device name,
// it should return the device information.
GetDevice(context.Context, *GetDeviceRequest) (*GetDeviceResponse, error)
mustEmbedUnimplementedDeviceMapperServiceServer()
}
// UnimplementedDeviceMapperServiceServer must be embedded to have forward compatible implementations.
type UnimplementedDeviceMapperServiceServer struct {
}
func (UnimplementedDeviceMapperServiceServer) RegisterDevice(context.Context, *RegisterDeviceRequest) (*RegisterDeviceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterDevice not implemented")
}
func (UnimplementedDeviceMapperServiceServer) RemoveDevice(context.Context, *RemoveDeviceRequest) (*RemoveDeviceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveDevice not implemented")
}
func (UnimplementedDeviceMapperServiceServer) UpdateDevice(context.Context, *UpdateDeviceRequest) (*UpdateDeviceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateDevice not implemented")
}
func (UnimplementedDeviceMapperServiceServer) CreateDeviceModel(context.Context, *CreateDeviceModelRequest) (*CreateDeviceModelResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateDeviceModel not implemented")
}
func (UnimplementedDeviceMapperServiceServer) RemoveDeviceModel(context.Context, *RemoveDeviceModelRequest) (*RemoveDeviceModelResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveDeviceModel not implemented")
}
func (UnimplementedDeviceMapperServiceServer) UpdateDeviceModel(context.Context, *UpdateDeviceModelRequest) (*UpdateDeviceModelResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateDeviceModel not implemented")
}
func (UnimplementedDeviceMapperServiceServer) GetDevice(context.Context, *GetDeviceRequest) (*GetDeviceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetDevice not implemented")
}
func (UnimplementedDeviceMapperServiceServer) mustEmbedUnimplementedDeviceMapperServiceServer() {}
// UnsafeDeviceMapperServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to DeviceMapperServiceServer will
// result in compilation errors.
type UnsafeDeviceMapperServiceServer interface {
mustEmbedUnimplementedDeviceMapperServiceServer()
}
func RegisterDeviceMapperServiceServer(s grpc.ServiceRegistrar, srv DeviceMapperServiceServer) {
s.RegisterService(&DeviceMapperService_ServiceDesc, srv)
}
func _DeviceMapperService_RegisterDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RegisterDeviceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceMapperServiceServer).RegisterDevice(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceMapperService_RegisterDevice_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceMapperServiceServer).RegisterDevice(ctx, req.(*RegisterDeviceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceMapperService_RemoveDevice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveDeviceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceMapperServiceServer).RemoveDevice(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceMapperService_RemoveDevice_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceMapperServiceServer).RemoveDevice(ctx, req.(*RemoveDeviceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceMapperService_UpdateDevice_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.(DeviceMapperServiceServer).UpdateDevice(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceMapperService_UpdateDevice_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceMapperServiceServer).UpdateDevice(ctx, req.(*UpdateDeviceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceMapperService_CreateDeviceModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateDeviceModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceMapperServiceServer).CreateDeviceModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceMapperService_CreateDeviceModel_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceMapperServiceServer).CreateDeviceModel(ctx, req.(*CreateDeviceModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceMapperService_RemoveDeviceModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveDeviceModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceMapperServiceServer).RemoveDeviceModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceMapperService_RemoveDeviceModel_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceMapperServiceServer).RemoveDeviceModel(ctx, req.(*RemoveDeviceModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceMapperService_UpdateDeviceModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateDeviceModelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DeviceMapperServiceServer).UpdateDeviceModel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceMapperService_UpdateDeviceModel_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceMapperServiceServer).UpdateDeviceModel(ctx, req.(*UpdateDeviceModelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _DeviceMapperService_GetDevice_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.(DeviceMapperServiceServer).GetDevice(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DeviceMapperService_GetDevice_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DeviceMapperServiceServer).GetDevice(ctx, req.(*GetDeviceRequest))
}
return interceptor(ctx, in, info, handler)
}
// DeviceMapperService_ServiceDesc is the grpc.ServiceDesc for DeviceMapperService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DeviceMapperService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "v1beta1.DeviceMapperService",
HandlerType: (*DeviceMapperServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RegisterDevice",
Handler: _DeviceMapperService_RegisterDevice_Handler,
},
{
MethodName: "RemoveDevice",
Handler: _DeviceMapperService_RemoveDevice_Handler,
},
{
MethodName: "UpdateDevice",
Handler: _DeviceMapperService_UpdateDevice_Handler,
},
{
MethodName: "CreateDeviceModel",
Handler: _DeviceMapperService_CreateDeviceModel_Handler,
},
{
MethodName: "RemoveDeviceModel",
Handler: _DeviceMapperService_RemoveDeviceModel_Handler,
},
{
MethodName: "UpdateDeviceModel",
Handler: _DeviceMapperService_UpdateDeviceModel_Handler,
},
{
MethodName: "GetDevice",
Handler: _DeviceMapperService_GetDevice_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api.proto",
}