protos

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Deprecated: Use DeviceID.ProtoReflect.Descriptor instead.

func (*DeviceID) GetDeviceID

func (x *DeviceID) GetDeviceID() string

func (*DeviceID) GetType

func (x *DeviceID) GetType() string

func (*DeviceID) ProtoMessage

func (*DeviceID) ProtoMessage()

func (*DeviceID) ProtoReflect

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

func (*DeviceID) Reset

func (x *DeviceID) Reset()

func (*DeviceID) String

func (x *DeviceID) String() string

type DeviceServer

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 (*RegisterOrUpdateDevicesRequest) Reset

func (x *RegisterOrUpdateDevicesRequest) Reset()

func (*RegisterOrUpdateDevicesRequest) String

type UnimplementedDeviceServer

type UnimplementedDeviceServer struct {
}

UnimplementedDeviceServer can be embedded to have forward compatible implementations.

func (*UnimplementedDeviceServer) DeleteDevices

func (*UnimplementedDeviceServer) GetDeviceInfo

func (*UnimplementedDeviceServer) RegisterDevices

func (*UnimplementedDeviceServer) UpdateDevices

Jump to

Keyboard shortcuts

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