Documentation ¶
Index ¶
- Variables
- func BlobsToEntityByDeviceID(entities []blobstore.Blob) map[string]*PhysicalEntity
- func DeviceIDsToTypeAndKey(deviceIDs []*DeviceID) []storage.TypeAndKey
- func EntitiesToBlobs(entities []*PhysicalEntity) []blobstore.Blob
- func RegisterDeviceServer(s *grpc.Server, srv DeviceServer)
- type DeleteDevicesRequest
- func (*DeleteDevicesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteDevicesRequest) GetDeviceIDs() []*DeviceID
- func (x *DeleteDevicesRequest) GetNetworkID() string
- func (*DeleteDevicesRequest) ProtoMessage()
- func (x *DeleteDevicesRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteDevicesRequest) Reset()
- func (x *DeleteDevicesRequest) String() string
- type DeviceClient
- type DeviceID
- type DeviceServer
- type GetDeviceInfoRequest
- func (*GetDeviceInfoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetDeviceInfoRequest) GetDeviceIDs() []*DeviceID
- func (x *GetDeviceInfoRequest) GetNetworkID() string
- func (*GetDeviceInfoRequest) ProtoMessage()
- func (x *GetDeviceInfoRequest) ProtoReflect() protoreflect.Message
- func (x *GetDeviceInfoRequest) Reset()
- func (x *GetDeviceInfoRequest) String() string
- type GetDeviceInfoResponse
- func (*GetDeviceInfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetDeviceInfoResponse) GetDeviceMap() map[string]*PhysicalEntity
- func (*GetDeviceInfoResponse) ProtoMessage()
- func (x *GetDeviceInfoResponse) ProtoReflect() protoreflect.Message
- func (x *GetDeviceInfoResponse) Reset()
- func (x *GetDeviceInfoResponse) String() string
- type PhysicalEntity
- func (*PhysicalEntity) Descriptor() ([]byte, []int)deprecated
- func (x *PhysicalEntity) GetDeviceID() string
- func (x *PhysicalEntity) GetInfo() []byte
- func (x *PhysicalEntity) GetType() string
- func (*PhysicalEntity) ProtoMessage()
- func (x *PhysicalEntity) ProtoReflect() protoreflect.Message
- func (x *PhysicalEntity) Reset()
- func (x *PhysicalEntity) String() string
- type RegisterOrUpdateDevicesRequest
- func (*RegisterOrUpdateDevicesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RegisterOrUpdateDevicesRequest) GetEntities() []*PhysicalEntity
- func (x *RegisterOrUpdateDevicesRequest) GetNetworkID() string
- func (*RegisterOrUpdateDevicesRequest) ProtoMessage()
- func (x *RegisterOrUpdateDevicesRequest) ProtoReflect() protoreflect.Message
- func (x *RegisterOrUpdateDevicesRequest) Reset()
- func (x *RegisterOrUpdateDevicesRequest) String() string
- type UnimplementedDeviceServer
- func (*UnimplementedDeviceServer) DeleteDevices(context.Context, *DeleteDevicesRequest) (*protos.Void, error)
- func (*UnimplementedDeviceServer) GetDeviceInfo(context.Context, *GetDeviceInfoRequest) (*GetDeviceInfoResponse, error)
- func (*UnimplementedDeviceServer) RegisterDevices(context.Context, *RegisterOrUpdateDevicesRequest) (*protos.Void, error)
- func (*UnimplementedDeviceServer) UpdateDevices(context.Context, *RegisterOrUpdateDevicesRequest) (*protos.Void, error)
Constants ¶
This section is empty.
Variables ¶
var File_device_proto protoreflect.FileDescriptor
Functions ¶
func BlobsToEntityByDeviceID ¶
func BlobsToEntityByDeviceID(entities []blobstore.Blob) map[string]*PhysicalEntity
BlobsToEntityByDeviceID maps a list of blobstore.Blob to map[deviceID]PhysicalEntity
func DeviceIDsToTypeAndKey ¶
func DeviceIDsToTypeAndKey(deviceIDs []*DeviceID) []storage.TypeAndKey
DeviceIDsToTypeAndKey maps a list of DeviceID to a list of storage.TypeAndKey.
func EntitiesToBlobs ¶
func EntitiesToBlobs(entities []*PhysicalEntity) []blobstore.Blob
EntitiesToBlobs maps a list of PhysicalEntity to a list of blobstore.Blob by using each entity's networkID as blob value
func RegisterDeviceServer ¶
func RegisterDeviceServer(s *grpc.Server, srv DeviceServer)
Types ¶
type DeleteDevicesRequest ¶
type DeleteDevicesRequest struct { NetworkID string `protobuf:"bytes,1,opt,name=networkID,proto3" json:"networkID,omitempty"` DeviceIDs []*DeviceID `protobuf:"bytes,2,rep,name=deviceIDs,proto3" json:"deviceIDs,omitempty"` // contains filtered or unexported fields }
func (*DeleteDevicesRequest) Descriptor
deprecated
func (*DeleteDevicesRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteDevicesRequest.ProtoReflect.Descriptor instead.
func (*DeleteDevicesRequest) GetDeviceIDs ¶
func (x *DeleteDevicesRequest) GetDeviceIDs() []*DeviceID
func (*DeleteDevicesRequest) GetNetworkID ¶
func (x *DeleteDevicesRequest) GetNetworkID() string
func (*DeleteDevicesRequest) ProtoMessage ¶
func (*DeleteDevicesRequest) ProtoMessage()
func (*DeleteDevicesRequest) ProtoReflect ¶
func (x *DeleteDevicesRequest) ProtoReflect() protoreflect.Message
func (*DeleteDevicesRequest) Reset ¶
func (x *DeleteDevicesRequest) Reset()
func (*DeleteDevicesRequest) String ¶
func (x *DeleteDevicesRequest) String() string
type DeviceClient ¶
type DeviceClient interface { RegisterDevices(ctx context.Context, in *RegisterOrUpdateDevicesRequest, opts ...grpc.CallOption) (*protos.Void, error) UpdateDevices(ctx context.Context, in *RegisterOrUpdateDevicesRequest, opts ...grpc.CallOption) (*protos.Void, error) GetDeviceInfo(ctx context.Context, in *GetDeviceInfoRequest, opts ...grpc.CallOption) (*GetDeviceInfoResponse, error) DeleteDevices(ctx context.Context, in *DeleteDevicesRequest, opts ...grpc.CallOption) (*protos.Void, error) }
DeviceClient is the client API for Device service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewDeviceClient ¶
func NewDeviceClient(cc grpc.ClientConnInterface) DeviceClient
type DeviceID ¶
type DeviceID struct { DeviceID string `protobuf:"bytes,1,opt,name=deviceID,proto3" json:"deviceID,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // contains filtered or unexported fields }
func (*DeviceID) Descriptor
deprecated
func (*DeviceID) GetDeviceID ¶
func (*DeviceID) ProtoMessage ¶
func (*DeviceID) ProtoMessage()
func (*DeviceID) ProtoReflect ¶
func (x *DeviceID) ProtoReflect() protoreflect.Message
type DeviceServer ¶
type DeviceServer interface { RegisterDevices(context.Context, *RegisterOrUpdateDevicesRequest) (*protos.Void, error) UpdateDevices(context.Context, *RegisterOrUpdateDevicesRequest) (*protos.Void, error) GetDeviceInfo(context.Context, *GetDeviceInfoRequest) (*GetDeviceInfoResponse, error) DeleteDevices(context.Context, *DeleteDevicesRequest) (*protos.Void, error) }
DeviceServer is the server API for Device service.
type GetDeviceInfoRequest ¶
type GetDeviceInfoRequest struct { NetworkID string `protobuf:"bytes,1,opt,name=networkID,proto3" json:"networkID,omitempty"` DeviceIDs []*DeviceID `protobuf:"bytes,2,rep,name=deviceIDs,proto3" json:"deviceIDs,omitempty"` // contains filtered or unexported fields }
func (*GetDeviceInfoRequest) Descriptor
deprecated
func (*GetDeviceInfoRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetDeviceInfoRequest.ProtoReflect.Descriptor instead.
func (*GetDeviceInfoRequest) GetDeviceIDs ¶
func (x *GetDeviceInfoRequest) GetDeviceIDs() []*DeviceID
func (*GetDeviceInfoRequest) GetNetworkID ¶
func (x *GetDeviceInfoRequest) GetNetworkID() string
func (*GetDeviceInfoRequest) ProtoMessage ¶
func (*GetDeviceInfoRequest) ProtoMessage()
func (*GetDeviceInfoRequest) ProtoReflect ¶
func (x *GetDeviceInfoRequest) ProtoReflect() protoreflect.Message
func (*GetDeviceInfoRequest) Reset ¶
func (x *GetDeviceInfoRequest) Reset()
func (*GetDeviceInfoRequest) String ¶
func (x *GetDeviceInfoRequest) String() string
type GetDeviceInfoResponse ¶
type GetDeviceInfoResponse struct { // A map of device IDs to corresponding PhysicalEntity structure DeviceMap map[string]*PhysicalEntity `` /* 159-byte string literal not displayed */ // contains filtered or unexported fields }
func (*GetDeviceInfoResponse) Descriptor
deprecated
func (*GetDeviceInfoResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetDeviceInfoResponse.ProtoReflect.Descriptor instead.
func (*GetDeviceInfoResponse) GetDeviceMap ¶
func (x *GetDeviceInfoResponse) GetDeviceMap() map[string]*PhysicalEntity
func (*GetDeviceInfoResponse) ProtoMessage ¶
func (*GetDeviceInfoResponse) ProtoMessage()
func (*GetDeviceInfoResponse) ProtoReflect ¶
func (x *GetDeviceInfoResponse) ProtoReflect() protoreflect.Message
func (*GetDeviceInfoResponse) Reset ¶
func (x *GetDeviceInfoResponse) Reset()
func (*GetDeviceInfoResponse) String ¶
func (x *GetDeviceInfoResponse) String() string
type PhysicalEntity ¶
type PhysicalEntity struct { // Globally unique identifier per type (MAC/SN) DeviceID string `protobuf:"bytes,1,opt,name=deviceID,proto3" json:"deviceID,omitempty"` // Used to deserialize info Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // Any other information (manufacturer, location, owner, etc) Info []byte `protobuf:"bytes,3,opt,name=info,proto3" json:"info,omitempty"` // contains filtered or unexported fields }
func (*PhysicalEntity) Descriptor
deprecated
func (*PhysicalEntity) Descriptor() ([]byte, []int)
Deprecated: Use PhysicalEntity.ProtoReflect.Descriptor instead.
func (*PhysicalEntity) GetDeviceID ¶
func (x *PhysicalEntity) GetDeviceID() string
func (*PhysicalEntity) GetInfo ¶
func (x *PhysicalEntity) GetInfo() []byte
func (*PhysicalEntity) GetType ¶
func (x *PhysicalEntity) GetType() string
func (*PhysicalEntity) ProtoMessage ¶
func (*PhysicalEntity) ProtoMessage()
func (*PhysicalEntity) ProtoReflect ¶
func (x *PhysicalEntity) ProtoReflect() protoreflect.Message
func (*PhysicalEntity) Reset ¶
func (x *PhysicalEntity) Reset()
func (*PhysicalEntity) String ¶
func (x *PhysicalEntity) String() string
type RegisterOrUpdateDevicesRequest ¶
type RegisterOrUpdateDevicesRequest struct { NetworkID string `protobuf:"bytes,1,opt,name=networkID,proto3" json:"networkID,omitempty"` Entities []*PhysicalEntity `protobuf:"bytes,2,rep,name=entities,proto3" json:"entities,omitempty"` // contains filtered or unexported fields }
func (*RegisterOrUpdateDevicesRequest) Descriptor
deprecated
func (*RegisterOrUpdateDevicesRequest) Descriptor() ([]byte, []int)
Deprecated: Use RegisterOrUpdateDevicesRequest.ProtoReflect.Descriptor instead.
func (*RegisterOrUpdateDevicesRequest) GetEntities ¶
func (x *RegisterOrUpdateDevicesRequest) GetEntities() []*PhysicalEntity
func (*RegisterOrUpdateDevicesRequest) GetNetworkID ¶
func (x *RegisterOrUpdateDevicesRequest) GetNetworkID() string
func (*RegisterOrUpdateDevicesRequest) ProtoMessage ¶
func (*RegisterOrUpdateDevicesRequest) ProtoMessage()
func (*RegisterOrUpdateDevicesRequest) ProtoReflect ¶
func (x *RegisterOrUpdateDevicesRequest) ProtoReflect() protoreflect.Message
func (*RegisterOrUpdateDevicesRequest) Reset ¶
func (x *RegisterOrUpdateDevicesRequest) Reset()
func (*RegisterOrUpdateDevicesRequest) String ¶
func (x *RegisterOrUpdateDevicesRequest) String() string
type UnimplementedDeviceServer ¶
type UnimplementedDeviceServer struct { }
UnimplementedDeviceServer can be embedded to have forward compatible implementations.
func (*UnimplementedDeviceServer) DeleteDevices ¶
func (*UnimplementedDeviceServer) DeleteDevices(context.Context, *DeleteDevicesRequest) (*protos.Void, error)
func (*UnimplementedDeviceServer) GetDeviceInfo ¶
func (*UnimplementedDeviceServer) GetDeviceInfo(context.Context, *GetDeviceInfoRequest) (*GetDeviceInfoResponse, error)
func (*UnimplementedDeviceServer) RegisterDevices ¶
func (*UnimplementedDeviceServer) RegisterDevices(context.Context, *RegisterOrUpdateDevicesRequest) (*protos.Void, error)
func (*UnimplementedDeviceServer) UpdateDevices ¶
func (*UnimplementedDeviceServer) UpdateDevices(context.Context, *RegisterOrUpdateDevicesRequest) (*protos.Void, error)