Documentation ¶
Index ¶
- Variables
- func RegisterPluginServer(s *grpc.Server, srv PluginServer)
- type AuthReq
- type Device
- func (*Device) Descriptor() ([]byte, []int)deprecated
- func (x *Device) GetAuthRequired() bool
- func (x *Device) GetIdentity() string
- func (x *Device) GetManufacturer() string
- func (x *Device) GetModel() string
- func (*Device) ProtoMessage()
- func (x *Device) ProtoReflect() protoreflect.Message
- func (x *Device) Reset()
- func (x *Device) String() string
- type Empty
- type GetAttributesReq
- type GetAttributesResp
- func (*GetAttributesResp) Descriptor() ([]byte, []int)deprecated
- func (x *GetAttributesResp) GetError() string
- func (x *GetAttributesResp) GetInstances() []*Instance
- func (x *GetAttributesResp) GetOtaSupport() bool
- func (x *GetAttributesResp) GetSuccess() bool
- func (*GetAttributesResp) ProtoMessage()
- func (x *GetAttributesResp) ProtoReflect() protoreflect.Message
- func (x *GetAttributesResp) Reset()
- func (x *GetAttributesResp) String() string
- type HealthCheckReq
- type HealthCheckResp
- func (*HealthCheckResp) Descriptor() ([]byte, []int)deprecated
- func (x *HealthCheckResp) GetIdentity() string
- func (x *HealthCheckResp) GetOnline() bool
- func (*HealthCheckResp) ProtoMessage()
- func (x *HealthCheckResp) ProtoReflect() protoreflect.Message
- func (x *HealthCheckResp) Reset()
- func (x *HealthCheckResp) String() string
- type Instance
- func (*Instance) Descriptor() ([]byte, []int)deprecated
- func (x *Instance) GetAttributes() []byte
- func (x *Instance) GetIdentity() string
- func (x *Instance) GetInstanceId() int32
- func (x *Instance) GetType() string
- func (*Instance) ProtoMessage()
- func (x *Instance) ProtoReflect() protoreflect.Message
- func (x *Instance) Reset()
- func (x *Instance) String() string
- type OTAReq
- type OTAResp
- type PluginClient
- type PluginServer
- type Plugin_DiscoverClient
- type Plugin_DiscoverServer
- type Plugin_OTAClient
- type Plugin_OTAServer
- type Plugin_StateChangeClient
- type Plugin_StateChangeServer
- type SetAttributesReq
- func (*SetAttributesReq) Descriptor() ([]byte, []int)deprecated
- func (x *SetAttributesReq) GetData() []byte
- func (x *SetAttributesReq) GetIdentity() string
- func (*SetAttributesReq) ProtoMessage()
- func (x *SetAttributesReq) ProtoReflect() protoreflect.Message
- func (x *SetAttributesReq) Reset()
- func (x *SetAttributesReq) String() string
- type SetAttributesResp
- func (*SetAttributesResp) Descriptor() ([]byte, []int)deprecated
- func (x *SetAttributesResp) GetError() string
- func (x *SetAttributesResp) GetSuccess() bool
- func (*SetAttributesResp) ProtoMessage()
- func (x *SetAttributesResp) ProtoReflect() protoreflect.Message
- func (x *SetAttributesResp) Reset()
- func (x *SetAttributesResp) String() string
- type State
- func (*State) Descriptor() ([]byte, []int)deprecated
- func (x *State) GetAttributes() []byte
- func (x *State) GetIdentity() string
- func (x *State) GetInstanceId() int32
- func (*State) ProtoMessage()
- func (x *State) ProtoReflect() protoreflect.Message
- func (x *State) Reset()
- func (x *State) String() string
- type UnimplementedPluginServer
- func (*UnimplementedPluginServer) Connect(context.Context, *AuthReq) (*GetAttributesResp, error)
- func (*UnimplementedPluginServer) Disconnect(context.Context, *AuthReq) (*Empty, error)
- func (*UnimplementedPluginServer) Discover(*Empty, Plugin_DiscoverServer) error
- func (*UnimplementedPluginServer) GetAttributes(context.Context, *GetAttributesReq) (*GetAttributesResp, error)
- func (*UnimplementedPluginServer) HealthCheck(context.Context, *HealthCheckReq) (*HealthCheckResp, error)
- func (*UnimplementedPluginServer) OTA(*OTAReq, Plugin_OTAServer) error
- func (*UnimplementedPluginServer) SetAttributes(context.Context, *SetAttributesReq) (*SetAttributesResp, error)
- func (*UnimplementedPluginServer) StateChange(*Empty, Plugin_StateChangeServer) error
Constants ¶
This section is empty.
Variables ¶
var File_plugin_proto protoreflect.FileDescriptor
Functions ¶
func RegisterPluginServer ¶
func RegisterPluginServer(s *grpc.Server, srv PluginServer)
Types ¶
type AuthReq ¶ added in v1.5.0
type AuthReq struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` Params map[string]string `` /* 153-byte string literal not displayed */ // contains filtered or unexported fields }
func (*AuthReq) Descriptor
deprecated
added in
v1.5.0
func (*AuthReq) GetIdentity ¶ added in v1.5.0
func (*AuthReq) ProtoMessage ¶ added in v1.5.0
func (*AuthReq) ProtoMessage()
func (*AuthReq) ProtoReflect ¶ added in v1.5.0
func (x *AuthReq) ProtoReflect() protoreflect.Message
type Device ¶
type Device struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` Model string `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"` Manufacturer string `protobuf:"bytes,3,opt,name=manufacturer,proto3" json:"manufacturer,omitempty"` AuthRequired bool `protobuf:"varint,4,opt,name=authRequired,proto3" json:"authRequired,omitempty"` // contains filtered or unexported fields }
func (*Device) Descriptor
deprecated
func (*Device) GetAuthRequired ¶ added in v1.5.0
func (*Device) GetIdentity ¶
func (*Device) GetManufacturer ¶
func (*Device) ProtoMessage ¶
func (*Device) ProtoMessage()
func (*Device) ProtoReflect ¶
func (x *Device) ProtoReflect() protoreflect.Message
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type GetAttributesReq ¶
type GetAttributesReq struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` // contains filtered or unexported fields }
func (*GetAttributesReq) Descriptor
deprecated
func (*GetAttributesReq) Descriptor() ([]byte, []int)
Deprecated: Use GetAttributesReq.ProtoReflect.Descriptor instead.
func (*GetAttributesReq) GetIdentity ¶
func (x *GetAttributesReq) GetIdentity() string
func (*GetAttributesReq) ProtoMessage ¶
func (*GetAttributesReq) ProtoMessage()
func (*GetAttributesReq) ProtoReflect ¶
func (x *GetAttributesReq) ProtoReflect() protoreflect.Message
func (*GetAttributesReq) Reset ¶
func (x *GetAttributesReq) Reset()
func (*GetAttributesReq) String ¶
func (x *GetAttributesReq) String() string
type GetAttributesResp ¶
type GetAttributesResp struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` Instances []*Instance `protobuf:"bytes,3,rep,name=instances,proto3" json:"instances,omitempty"` OtaSupport bool `protobuf:"varint,4,opt,name=ota_support,json=otaSupport,proto3" json:"ota_support,omitempty"` // contains filtered or unexported fields }
func (*GetAttributesResp) Descriptor
deprecated
func (*GetAttributesResp) Descriptor() ([]byte, []int)
Deprecated: Use GetAttributesResp.ProtoReflect.Descriptor instead.
func (*GetAttributesResp) GetError ¶
func (x *GetAttributesResp) GetError() string
func (*GetAttributesResp) GetInstances ¶
func (x *GetAttributesResp) GetInstances() []*Instance
func (*GetAttributesResp) GetOtaSupport ¶ added in v1.9.1
func (x *GetAttributesResp) GetOtaSupport() bool
func (*GetAttributesResp) GetSuccess ¶
func (x *GetAttributesResp) GetSuccess() bool
func (*GetAttributesResp) ProtoMessage ¶
func (*GetAttributesResp) ProtoMessage()
func (*GetAttributesResp) ProtoReflect ¶
func (x *GetAttributesResp) ProtoReflect() protoreflect.Message
func (*GetAttributesResp) Reset ¶
func (x *GetAttributesResp) Reset()
func (*GetAttributesResp) String ¶
func (x *GetAttributesResp) String() string
type HealthCheckReq ¶
type HealthCheckReq struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` // contains filtered or unexported fields }
func (*HealthCheckReq) Descriptor
deprecated
func (*HealthCheckReq) Descriptor() ([]byte, []int)
Deprecated: Use HealthCheckReq.ProtoReflect.Descriptor instead.
func (*HealthCheckReq) GetIdentity ¶
func (x *HealthCheckReq) GetIdentity() string
func (*HealthCheckReq) ProtoMessage ¶
func (*HealthCheckReq) ProtoMessage()
func (*HealthCheckReq) ProtoReflect ¶
func (x *HealthCheckReq) ProtoReflect() protoreflect.Message
func (*HealthCheckReq) Reset ¶
func (x *HealthCheckReq) Reset()
func (*HealthCheckReq) String ¶
func (x *HealthCheckReq) String() string
type HealthCheckResp ¶
type HealthCheckResp struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` Online bool `protobuf:"varint,2,opt,name=online,proto3" json:"online,omitempty"` // contains filtered or unexported fields }
func (*HealthCheckResp) Descriptor
deprecated
func (*HealthCheckResp) Descriptor() ([]byte, []int)
Deprecated: Use HealthCheckResp.ProtoReflect.Descriptor instead.
func (*HealthCheckResp) GetIdentity ¶
func (x *HealthCheckResp) GetIdentity() string
func (*HealthCheckResp) GetOnline ¶
func (x *HealthCheckResp) GetOnline() bool
func (*HealthCheckResp) ProtoMessage ¶
func (*HealthCheckResp) ProtoMessage()
func (*HealthCheckResp) ProtoReflect ¶
func (x *HealthCheckResp) ProtoReflect() protoreflect.Message
func (*HealthCheckResp) Reset ¶
func (x *HealthCheckResp) Reset()
func (*HealthCheckResp) String ¶
func (x *HealthCheckResp) String() string
type Instance ¶
type Instance struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` InstanceId int32 `protobuf:"varint,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` Attributes []byte `protobuf:"bytes,3,opt,name=attributes,proto3" json:"attributes,omitempty"` Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Instance) Descriptor
deprecated
func (*Instance) GetAttributes ¶
func (*Instance) GetIdentity ¶
func (*Instance) GetInstanceId ¶
func (*Instance) ProtoMessage ¶
func (*Instance) ProtoMessage()
func (*Instance) ProtoReflect ¶
func (x *Instance) ProtoReflect() protoreflect.Message
type OTAReq ¶ added in v1.9.1
type OTAReq struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` FirmwareUrl string `protobuf:"bytes,2,opt,name=firmware_url,json=firmwareUrl,proto3" json:"firmware_url,omitempty"` // contains filtered or unexported fields }
func (*OTAReq) Descriptor
deprecated
added in
v1.9.1
func (*OTAReq) GetFirmwareUrl ¶ added in v1.9.1
func (*OTAReq) GetIdentity ¶ added in v1.9.1
func (*OTAReq) ProtoMessage ¶ added in v1.9.1
func (*OTAReq) ProtoMessage()
func (*OTAReq) ProtoReflect ¶ added in v1.9.1
func (x *OTAReq) ProtoReflect() protoreflect.Message
type OTAResp ¶ added in v1.9.1
type OTAResp struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` Step int32 `protobuf:"varint,2,opt,name=step,proto3" json:"step,omitempty"` // contains filtered or unexported fields }
func (*OTAResp) Descriptor
deprecated
added in
v1.9.1
func (*OTAResp) GetIdentity ¶ added in v1.9.1
func (*OTAResp) ProtoMessage ¶ added in v1.9.1
func (*OTAResp) ProtoMessage()
func (*OTAResp) ProtoReflect ¶ added in v1.9.1
func (x *OTAResp) ProtoReflect() protoreflect.Message
type PluginClient ¶
type PluginClient interface { // Discover 发现时设备 Discover(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Plugin_DiscoverClient, error) StateChange(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Plugin_StateChangeClient, error) HealthCheck(ctx context.Context, in *HealthCheckReq, opts ...grpc.CallOption) (*HealthCheckResp, error) // GetAttributes TODO 考虑删除该接口,仅通过Connect获取模型,并通过回调更新属性 GetAttributes(ctx context.Context, in *GetAttributesReq, opts ...grpc.CallOption) (*GetAttributesResp, error) SetAttributes(ctx context.Context, in *SetAttributesReq, opts ...grpc.CallOption) (*SetAttributesResp, error) OTA(ctx context.Context, in *OTAReq, opts ...grpc.CallOption) (Plugin_OTAClient, error) Connect(ctx context.Context, in *AuthReq, opts ...grpc.CallOption) (*GetAttributesResp, error) Disconnect(ctx context.Context, in *AuthReq, opts ...grpc.CallOption) (*Empty, error) }
PluginClient is the client API for Plugin service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewPluginClient ¶
func NewPluginClient(cc grpc.ClientConnInterface) PluginClient
type PluginServer ¶
type PluginServer interface { // Discover 发现时设备 Discover(*Empty, Plugin_DiscoverServer) error StateChange(*Empty, Plugin_StateChangeServer) error HealthCheck(context.Context, *HealthCheckReq) (*HealthCheckResp, error) // GetAttributes TODO 考虑删除该接口,仅通过Connect获取模型,并通过回调更新属性 GetAttributes(context.Context, *GetAttributesReq) (*GetAttributesResp, error) SetAttributes(context.Context, *SetAttributesReq) (*SetAttributesResp, error) OTA(*OTAReq, Plugin_OTAServer) error Connect(context.Context, *AuthReq) (*GetAttributesResp, error) Disconnect(context.Context, *AuthReq) (*Empty, error) }
PluginServer is the server API for Plugin service.
type Plugin_DiscoverClient ¶
type Plugin_DiscoverClient interface { Recv() (*Device, error) grpc.ClientStream }
type Plugin_DiscoverServer ¶
type Plugin_DiscoverServer interface { Send(*Device) error grpc.ServerStream }
type Plugin_OTAClient ¶ added in v1.9.1
type Plugin_OTAClient interface { Recv() (*OTAResp, error) grpc.ClientStream }
type Plugin_OTAServer ¶ added in v1.9.1
type Plugin_OTAServer interface { Send(*OTAResp) error grpc.ServerStream }
type Plugin_StateChangeClient ¶
type Plugin_StateChangeClient interface { Recv() (*State, error) grpc.ClientStream }
type Plugin_StateChangeServer ¶
type Plugin_StateChangeServer interface { Send(*State) error grpc.ServerStream }
type SetAttributesReq ¶
type SetAttributesReq struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*SetAttributesReq) Descriptor
deprecated
func (*SetAttributesReq) Descriptor() ([]byte, []int)
Deprecated: Use SetAttributesReq.ProtoReflect.Descriptor instead.
func (*SetAttributesReq) GetData ¶
func (x *SetAttributesReq) GetData() []byte
func (*SetAttributesReq) GetIdentity ¶
func (x *SetAttributesReq) GetIdentity() string
func (*SetAttributesReq) ProtoMessage ¶
func (*SetAttributesReq) ProtoMessage()
func (*SetAttributesReq) ProtoReflect ¶
func (x *SetAttributesReq) ProtoReflect() protoreflect.Message
func (*SetAttributesReq) Reset ¶
func (x *SetAttributesReq) Reset()
func (*SetAttributesReq) String ¶
func (x *SetAttributesReq) String() string
type SetAttributesResp ¶
type SetAttributesResp struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` Error string `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*SetAttributesResp) Descriptor
deprecated
func (*SetAttributesResp) Descriptor() ([]byte, []int)
Deprecated: Use SetAttributesResp.ProtoReflect.Descriptor instead.
func (*SetAttributesResp) GetError ¶
func (x *SetAttributesResp) GetError() string
func (*SetAttributesResp) GetSuccess ¶
func (x *SetAttributesResp) GetSuccess() bool
func (*SetAttributesResp) ProtoMessage ¶
func (*SetAttributesResp) ProtoMessage()
func (*SetAttributesResp) ProtoReflect ¶
func (x *SetAttributesResp) ProtoReflect() protoreflect.Message
func (*SetAttributesResp) Reset ¶
func (x *SetAttributesResp) Reset()
func (*SetAttributesResp) String ¶
func (x *SetAttributesResp) String() string
type State ¶
type State struct { Identity string `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` InstanceId int32 `protobuf:"varint,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"` Attributes []byte `protobuf:"bytes,3,opt,name=attributes,proto3" json:"attributes,omitempty"` // contains filtered or unexported fields }
func (*State) Descriptor
deprecated
func (*State) GetAttributes ¶
func (*State) GetIdentity ¶
func (*State) GetInstanceId ¶
func (*State) ProtoMessage ¶
func (*State) ProtoMessage()
func (*State) ProtoReflect ¶
func (x *State) ProtoReflect() protoreflect.Message
type UnimplementedPluginServer ¶
type UnimplementedPluginServer struct { }
UnimplementedPluginServer can be embedded to have forward compatible implementations.
func (*UnimplementedPluginServer) Connect ¶ added in v1.5.0
func (*UnimplementedPluginServer) Connect(context.Context, *AuthReq) (*GetAttributesResp, error)
func (*UnimplementedPluginServer) Disconnect ¶ added in v1.5.0
func (*UnimplementedPluginServer) Discover ¶
func (*UnimplementedPluginServer) Discover(*Empty, Plugin_DiscoverServer) error
func (*UnimplementedPluginServer) GetAttributes ¶
func (*UnimplementedPluginServer) GetAttributes(context.Context, *GetAttributesReq) (*GetAttributesResp, error)
func (*UnimplementedPluginServer) HealthCheck ¶
func (*UnimplementedPluginServer) HealthCheck(context.Context, *HealthCheckReq) (*HealthCheckResp, error)
func (*UnimplementedPluginServer) OTA ¶ added in v1.9.1
func (*UnimplementedPluginServer) OTA(*OTAReq, Plugin_OTAServer) error
func (*UnimplementedPluginServer) SetAttributes ¶
func (*UnimplementedPluginServer) SetAttributes(context.Context, *SetAttributesReq) (*SetAttributesResp, error)
func (*UnimplementedPluginServer) StateChange ¶
func (*UnimplementedPluginServer) StateChange(*Empty, Plugin_StateChangeServer) error