Documentation ¶
Index ¶
- func RegisterDeviceServer(s *grpc.Server, srv DeviceServer)
- type DevInfo
- func (*DevInfo) Descriptor() ([]byte, []int)
- func (m *DevInfo) GetAddr() string
- func (m *DevInfo) GetFuncs() []*Func
- func (m *DevInfo) GetMeta() *Meta
- func (m *DevInfo) GetPort() uint32
- func (*DevInfo) ProtoMessage()
- func (m *DevInfo) Reset()
- func (m *DevInfo) String() string
- func (m *DevInfo) XXX_DiscardUnknown()
- func (m *DevInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DevInfo) XXX_Merge(src proto.Message)
- func (m *DevInfo) XXX_Size() int
- func (m *DevInfo) XXX_Unmarshal(b []byte) error
- type DeviceClient
- type DeviceServer
- type Func
- func (*Func) Descriptor() ([]byte, []int)
- func (m *Func) GetName() string
- func (m *Func) GetParams() []*Param
- func (*Func) ProtoMessage()
- func (m *Func) Reset()
- func (m *Func) String() string
- func (m *Func) XXX_DiscardUnknown()
- func (m *Func) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Func) XXX_Merge(src proto.Message)
- func (m *Func) XXX_Size() int
- func (m *Func) XXX_Unmarshal(b []byte) error
- type FuncCall
- func (*FuncCall) Descriptor() ([]byte, []int)
- func (m *FuncCall) GetName() string
- func (m *FuncCall) GetParams() []uint32
- func (*FuncCall) ProtoMessage()
- func (m *FuncCall) Reset()
- func (m *FuncCall) String() string
- func (m *FuncCall) XXX_DiscardUnknown()
- func (m *FuncCall) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FuncCall) XXX_Merge(src proto.Message)
- func (m *FuncCall) XXX_Size() int
- func (m *FuncCall) XXX_Unmarshal(b []byte) error
- type FuncRet
- func (*FuncRet) Descriptor() ([]byte, []int)
- func (*FuncRet) ProtoMessage()
- func (m *FuncRet) Reset()
- func (m *FuncRet) String() string
- func (m *FuncRet) XXX_DiscardUnknown()
- func (m *FuncRet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FuncRet) XXX_Merge(src proto.Message)
- func (m *FuncRet) XXX_Size() int
- func (m *FuncRet) XXX_Unmarshal(b []byte) error
- type Meta
- func (*Meta) Descriptor() ([]byte, []int)
- func (m *Meta) GetName() string
- func (m *Meta) GetRoom() uint32
- func (m *Meta) GetType() uint32
- func (*Meta) ProtoMessage()
- func (m *Meta) Reset()
- func (m *Meta) String() string
- func (m *Meta) XXX_DiscardUnknown()
- func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Meta) XXX_Merge(src proto.Message)
- func (m *Meta) XXX_Size() int
- func (m *Meta) XXX_Unmarshal(b []byte) error
- type Nothing
- func (*Nothing) Descriptor() ([]byte, []int)
- func (*Nothing) ProtoMessage()
- func (m *Nothing) Reset()
- func (m *Nothing) String() string
- func (m *Nothing) XXX_DiscardUnknown()
- func (m *Nothing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Nothing) XXX_Merge(src proto.Message)
- func (m *Nothing) XXX_Size() int
- func (m *Nothing) XXX_Unmarshal(b []byte) error
- type Param
- func (*Param) Descriptor() ([]byte, []int)
- func (m *Param) GetMax() uint32
- func (m *Param) GetMin() uint32
- func (*Param) ProtoMessage()
- func (m *Param) Reset()
- func (m *Param) String() string
- func (m *Param) XXX_DiscardUnknown()
- func (m *Param) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Param) XXX_Merge(src proto.Message)
- func (m *Param) XXX_Size() int
- func (m *Param) XXX_Unmarshal(b []byte) error
- type UnimplementedDeviceServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDeviceServer ¶
func RegisterDeviceServer(s *grpc.Server, srv DeviceServer)
Types ¶
type DevInfo ¶
type DevInfo struct { Port uint32 `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"` Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` Meta *Meta `protobuf:"bytes,3,opt,name=meta,proto3" json:"meta,omitempty"` Funcs []*Func `protobuf:"bytes,4,rep,name=funcs,proto3" json:"funcs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
DevInfo message are sent when a new device is connecting to the network. Contains a device's identifying information and all of the functions it performs.
func (*DevInfo) Descriptor ¶
func (*DevInfo) ProtoMessage ¶
func (*DevInfo) ProtoMessage()
func (*DevInfo) XXX_DiscardUnknown ¶
func (m *DevInfo) XXX_DiscardUnknown()
func (*DevInfo) XXX_Marshal ¶
func (*DevInfo) XXX_Unmarshal ¶
type DeviceClient ¶
type DeviceClient interface { // Send our information to a remote device, and get theirs in return Bootstrap(ctx context.Context, in *DevInfo, opts ...grpc.CallOption) (*DevInfo, error) // call a function on a remote device CallFunc(ctx context.Context, in *FuncCall, opts ...grpc.CallOption) (*FuncRet, error) // tell a remote device that we are quitting, and to remove us from their network Quit(ctx context.Context, in *DevInfo, opts ...grpc.CallOption) (*Nothing, 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 DeviceServer ¶
type DeviceServer interface { // Send our information to a remote device, and get theirs in return Bootstrap(context.Context, *DevInfo) (*DevInfo, error) // call a function on a remote device CallFunc(context.Context, *FuncCall) (*FuncRet, error) // tell a remote device that we are quitting, and to remove us from their network Quit(context.Context, *DevInfo) (*Nothing, error) }
DeviceServer is the server API for Device service.
type Func ¶
type Func struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Params []*Param `protobuf:"bytes,2,rep,name=params,proto3" json:"params,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Func messages represent individual functions a device can perform. Contains an ID, human-readable name, and list of parameters.
func (*Func) Descriptor ¶
func (*Func) ProtoMessage ¶
func (*Func) ProtoMessage()
func (*Func) XXX_DiscardUnknown ¶
func (m *Func) XXX_DiscardUnknown()
func (*Func) XXX_Unmarshal ¶
type FuncCall ¶
type FuncCall struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Params []uint32 `protobuf:"varint,2,rep,packed,name=params,proto3" json:"params,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
FuncCall is used when calling functions on a remote device. Provides the name and parameter values, set by the caller.
func (*FuncCall) Descriptor ¶
func (*FuncCall) ProtoMessage ¶
func (*FuncCall) ProtoMessage()
func (*FuncCall) XXX_DiscardUnknown ¶
func (m *FuncCall) XXX_DiscardUnknown()
func (*FuncCall) XXX_Marshal ¶
func (*FuncCall) XXX_Unmarshal ¶
type FuncRet ¶
type FuncRet struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
FuncRet represents function return values. Empty for now, allowing the ability to expand in the future
func (*FuncRet) Descriptor ¶
func (*FuncRet) ProtoMessage ¶
func (*FuncRet) ProtoMessage()
func (*FuncRet) XXX_DiscardUnknown ¶
func (m *FuncRet) XXX_DiscardUnknown()
func (*FuncRet) XXX_Marshal ¶
func (*FuncRet) XXX_Unmarshal ¶
type Meta ¶
type Meta struct { Type uint32 `protobuf:"varint,1,opt,name=type,proto3" json:"type,omitempty"` Room uint32 `protobuf:"varint,2,opt,name=room,proto3" json:"room,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Meta contains human-readable information about a device. Name, type of device, and room it is located in
func (*Meta) Descriptor ¶
func (*Meta) ProtoMessage ¶
func (*Meta) ProtoMessage()
func (*Meta) XXX_DiscardUnknown ¶
func (m *Meta) XXX_DiscardUnknown()
func (*Meta) XXX_Unmarshal ¶
type Nothing ¶
type Nothing struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Nothing represents nothing
func (*Nothing) Descriptor ¶
func (*Nothing) ProtoMessage ¶
func (*Nothing) ProtoMessage()
func (*Nothing) XXX_DiscardUnknown ¶
func (m *Nothing) XXX_DiscardUnknown()
func (*Nothing) XXX_Marshal ¶
func (*Nothing) XXX_Unmarshal ¶
type Param ¶
type Param struct { Min uint32 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"` Max uint32 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Param messages represent valid parameters for a given function. Contains mininum and maximum values the parameter can take.
func (*Param) Descriptor ¶
func (*Param) ProtoMessage ¶
func (*Param) ProtoMessage()
func (*Param) XXX_DiscardUnknown ¶
func (m *Param) XXX_DiscardUnknown()