proto

package
v1.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use AuthReq.ProtoReflect.Descriptor instead.

func (*AuthReq) GetIdentity added in v1.5.0

func (x *AuthReq) GetIdentity() string

func (*AuthReq) GetParams added in v1.5.0

func (x *AuthReq) GetParams() map[string]string

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

func (*AuthReq) Reset added in v1.5.0

func (x *AuthReq) Reset()

func (*AuthReq) String added in v1.5.0

func (x *AuthReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Device.ProtoReflect.Descriptor instead.

func (*Device) GetAuthRequired added in v1.5.0

func (x *Device) GetAuthRequired() bool

func (*Device) GetIdentity

func (x *Device) GetIdentity() string

func (*Device) GetManufacturer

func (x *Device) GetManufacturer() string

func (*Device) GetModel

func (x *Device) GetModel() string

func (*Device) ProtoMessage

func (*Device) ProtoMessage()

func (*Device) ProtoReflect

func (x *Device) ProtoReflect() protoreflect.Message

func (*Device) Reset

func (x *Device) Reset()

func (*Device) String

func (x *Device) String() string

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

func (*Empty) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Instance.ProtoReflect.Descriptor instead.

func (*Instance) GetAttributes

func (x *Instance) GetAttributes() []byte

func (*Instance) GetIdentity

func (x *Instance) GetIdentity() string

func (*Instance) GetInstanceId

func (x *Instance) GetInstanceId() int32

func (*Instance) GetType

func (x *Instance) GetType() string

func (*Instance) ProtoMessage

func (*Instance) ProtoMessage()

func (*Instance) ProtoReflect

func (x *Instance) ProtoReflect() protoreflect.Message

func (*Instance) Reset

func (x *Instance) Reset()

func (*Instance) String

func (x *Instance) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use OTAReq.ProtoReflect.Descriptor instead.

func (*OTAReq) GetFirmwareUrl added in v1.9.1

func (x *OTAReq) GetFirmwareUrl() string

func (*OTAReq) GetIdentity added in v1.9.1

func (x *OTAReq) GetIdentity() string

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

func (*OTAReq) Reset added in v1.9.1

func (x *OTAReq) Reset()

func (*OTAReq) String added in v1.9.1

func (x *OTAReq) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use OTAResp.ProtoReflect.Descriptor instead.

func (*OTAResp) GetIdentity added in v1.9.1

func (x *OTAResp) GetIdentity() string

func (*OTAResp) GetStep added in v1.9.1

func (x *OTAResp) GetStep() int32

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

func (*OTAResp) Reset added in v1.9.1

func (x *OTAResp) Reset()

func (*OTAResp) String added in v1.9.1

func (x *OTAResp) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use State.ProtoReflect.Descriptor instead.

func (*State) GetAttributes

func (x *State) GetAttributes() []byte

func (*State) GetIdentity

func (x *State) GetIdentity() string

func (*State) GetInstanceId

func (x *State) GetInstanceId() int32

func (*State) ProtoMessage

func (*State) ProtoMessage()

func (*State) ProtoReflect

func (x *State) ProtoReflect() protoreflect.Message

func (*State) Reset

func (x *State) Reset()

func (*State) String

func (x *State) String() string

type UnimplementedPluginServer

type UnimplementedPluginServer struct {
}

UnimplementedPluginServer can be embedded to have forward compatible implementations.

func (*UnimplementedPluginServer) Connect added in v1.5.0

func (*UnimplementedPluginServer) Disconnect added in v1.5.0

func (*UnimplementedPluginServer) Discover

func (*UnimplementedPluginServer) GetAttributes

func (*UnimplementedPluginServer) HealthCheck

func (*UnimplementedPluginServer) OTA added in v1.9.1

func (*UnimplementedPluginServer) SetAttributes

func (*UnimplementedPluginServer) StateChange

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL