Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterLightsServer(s grpc.ServiceRegistrar, srv LightsServer)
- type Empty
- type Group
- func (*Group) Descriptor() ([]byte, []int)deprecated
- func (x *Group) GetBrightness() int32
- func (x *Group) GetID() int32
- func (x *Group) GetName() string
- func (x *Group) GetOn() bool
- func (*Group) ProtoMessage()
- func (x *Group) ProtoReflect() protoreflect.Message
- func (x *Group) Reset()
- func (x *Group) String() string
- type Groups
- type LightsClient
- type LightsRequest
- func (*LightsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LightsRequest) GetBrightnessPercent() float32
- func (x *LightsRequest) GetGroup() int32
- func (x *LightsRequest) GetHue() float32
- func (x *LightsRequest) GetSaturationPercent() float32
- func (*LightsRequest) ProtoMessage()
- func (x *LightsRequest) ProtoReflect() protoreflect.Message
- func (x *LightsRequest) Reset()
- func (x *LightsRequest) String() string
- type LightsResponse
- type LightsServer
- type Sensor
- func (*Sensor) Descriptor() ([]byte, []int)deprecated
- func (x *Sensor) GetID() int32
- func (x *Sensor) GetManufacturerName() string
- func (x *Sensor) GetModelID() string
- func (x *Sensor) GetName() string
- func (x *Sensor) GetSWVersion() string
- func (x *Sensor) GetState() *State
- func (x *Sensor) GetType() string
- func (x *Sensor) GetUniqueID() string
- func (*Sensor) ProtoMessage()
- func (x *Sensor) ProtoReflect() protoreflect.Message
- func (x *Sensor) Reset()
- func (x *Sensor) String() string
- type SensorRequest
- type Sensors
- type State
- func (*State) Descriptor() ([]byte, []int)deprecated
- func (x *State) GetButtonEvent() int32
- func (x *State) GetDark() bool
- func (x *State) GetDaylight() bool
- func (x *State) GetLastUpdated() string
- func (x *State) GetLightLevel() int32
- func (x *State) GetPresence() bool
- func (x *State) GetStatus() int32
- func (x *State) GetTemperature() int32
- func (*State) ProtoMessage()
- func (x *State) ProtoReflect() protoreflect.Message
- func (x *State) Reset()
- func (x *State) String() string
- type UnimplementedLightsServer
- func (UnimplementedLightsServer) Blink(context.Context, *LightsRequest) (*LightsResponse, error)
- func (UnimplementedLightsServer) GetGroups(context.Context, *Empty) (*Groups, error)
- func (UnimplementedLightsServer) GetSensors(context.Context, *Empty) (*Sensors, error)
- func (UnimplementedLightsServer) SwitchOff(context.Context, *LightsRequest) (*LightsResponse, error)
- func (UnimplementedLightsServer) SwitchOn(context.Context, *LightsRequest) (*LightsResponse, error)
- type UnsafeLightsServer
Constants ¶
const ( Lights_GetGroups_FullMethodName = "/hue.Lights/GetGroups" Lights_GetSensors_FullMethodName = "/hue.Lights/GetSensors" Lights_SwitchOn_FullMethodName = "/hue.Lights/SwitchOn" Lights_SwitchOff_FullMethodName = "/hue.Lights/SwitchOff" Lights_Blink_FullMethodName = "/hue.Lights/Blink" )
Variables ¶
var File_hue_proto protoreflect.FileDescriptor
var Lights_ServiceDesc = grpc.ServiceDesc{ ServiceName: "hue.Lights", HandlerType: (*LightsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetGroups", Handler: _Lights_GetGroups_Handler, }, { MethodName: "GetSensors", Handler: _Lights_GetSensors_Handler, }, { MethodName: "SwitchOn", Handler: _Lights_SwitchOn_Handler, }, { MethodName: "SwitchOff", Handler: _Lights_SwitchOff_Handler, }, { MethodName: "Blink", Handler: _Lights_Blink_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "hue.proto", }
Lights_ServiceDesc is the grpc.ServiceDesc for Lights service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterLightsServer ¶
func RegisterLightsServer(s grpc.ServiceRegistrar, srv LightsServer)
Types ¶
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 Group ¶
type Group struct { ID int32 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` On bool `protobuf:"varint,3,opt,name=On,proto3" json:"On,omitempty"` Brightness int32 `protobuf:"varint,4,opt,name=Brightness,proto3" json:"Brightness,omitempty"` // contains filtered or unexported fields }
func (*Group) Descriptor
deprecated
func (*Group) GetBrightness ¶
func (*Group) ProtoMessage ¶
func (*Group) ProtoMessage()
func (*Group) ProtoReflect ¶
func (x *Group) ProtoReflect() protoreflect.Message
type Groups ¶
type Groups struct { Groups []*Group `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` // contains filtered or unexported fields }
func (*Groups) Descriptor
deprecated
func (*Groups) ProtoMessage ¶
func (*Groups) ProtoMessage()
func (*Groups) ProtoReflect ¶
func (x *Groups) ProtoReflect() protoreflect.Message
type LightsClient ¶
type LightsClient interface { GetGroups(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Groups, error) GetSensors(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Sensors, error) SwitchOn(ctx context.Context, in *LightsRequest, opts ...grpc.CallOption) (*LightsResponse, error) SwitchOff(ctx context.Context, in *LightsRequest, opts ...grpc.CallOption) (*LightsResponse, error) Blink(ctx context.Context, in *LightsRequest, opts ...grpc.CallOption) (*LightsResponse, error) }
LightsClient is the client API for Lights service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewLightsClient ¶
func NewLightsClient(cc grpc.ClientConnInterface) LightsClient
type LightsRequest ¶
type LightsRequest struct { Group int32 `protobuf:"varint,1,opt,name=Group,proto3" json:"Group,omitempty"` // Value between 0 and 1 BrightnessPercent float32 `protobuf:"fixed32,2,opt,name=BrightnessPercent,proto3" json:"BrightnessPercent,omitempty"` // Value between 0 and 1 SaturationPercent float32 `protobuf:"fixed32,3,opt,name=SaturationPercent,proto3" json:"SaturationPercent,omitempty"` // Value between 0 and 65535 // Red: 65535 // Green: 25500 // Blue: 46920 Hue float32 `protobuf:"fixed32,4,opt,name=Hue,proto3" json:"Hue,omitempty"` // contains filtered or unexported fields }
func (*LightsRequest) Descriptor
deprecated
func (*LightsRequest) Descriptor() ([]byte, []int)
Deprecated: Use LightsRequest.ProtoReflect.Descriptor instead.
func (*LightsRequest) GetBrightnessPercent ¶
func (x *LightsRequest) GetBrightnessPercent() float32
func (*LightsRequest) GetGroup ¶
func (x *LightsRequest) GetGroup() int32
func (*LightsRequest) GetHue ¶
func (x *LightsRequest) GetHue() float32
func (*LightsRequest) GetSaturationPercent ¶
func (x *LightsRequest) GetSaturationPercent() float32
func (*LightsRequest) ProtoMessage ¶
func (*LightsRequest) ProtoMessage()
func (*LightsRequest) ProtoReflect ¶
func (x *LightsRequest) ProtoReflect() protoreflect.Message
func (*LightsRequest) Reset ¶
func (x *LightsRequest) Reset()
func (*LightsRequest) String ¶
func (x *LightsRequest) String() string
type LightsResponse ¶
type LightsResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
func (*LightsResponse) Descriptor
deprecated
func (*LightsResponse) Descriptor() ([]byte, []int)
Deprecated: Use LightsResponse.ProtoReflect.Descriptor instead.
func (*LightsResponse) GetSuccess ¶
func (x *LightsResponse) GetSuccess() bool
func (*LightsResponse) ProtoMessage ¶
func (*LightsResponse) ProtoMessage()
func (*LightsResponse) ProtoReflect ¶
func (x *LightsResponse) ProtoReflect() protoreflect.Message
func (*LightsResponse) Reset ¶
func (x *LightsResponse) Reset()
func (*LightsResponse) String ¶
func (x *LightsResponse) String() string
type LightsServer ¶
type LightsServer interface { GetGroups(context.Context, *Empty) (*Groups, error) GetSensors(context.Context, *Empty) (*Sensors, error) SwitchOn(context.Context, *LightsRequest) (*LightsResponse, error) SwitchOff(context.Context, *LightsRequest) (*LightsResponse, error) Blink(context.Context, *LightsRequest) (*LightsResponse, error) // contains filtered or unexported methods }
LightsServer is the server API for Lights service. All implementations must embed UnimplementedLightsServer for forward compatibility.
type Sensor ¶
type Sensor struct { ID int32 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` UniqueID string `protobuf:"bytes,2,opt,name=UniqueID,proto3" json:"UniqueID,omitempty"` Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"` Type string `protobuf:"bytes,4,opt,name=Type,proto3" json:"Type,omitempty"` ManufacturerName string `protobuf:"bytes,5,opt,name=ManufacturerName,proto3" json:"ManufacturerName,omitempty"` ModelID string `protobuf:"bytes,6,opt,name=ModelID,proto3" json:"ModelID,omitempty"` SWVersion string `protobuf:"bytes,7,opt,name=SWVersion,proto3" json:"SWVersion,omitempty"` State *State `protobuf:"bytes,8,opt,name=State,proto3" json:"State,omitempty"` // contains filtered or unexported fields }
func (*Sensor) Descriptor
deprecated
func (*Sensor) GetManufacturerName ¶
func (*Sensor) GetModelID ¶
func (*Sensor) GetSWVersion ¶
func (*Sensor) GetUniqueID ¶
func (*Sensor) ProtoMessage ¶
func (*Sensor) ProtoMessage()
func (*Sensor) ProtoReflect ¶
func (x *Sensor) ProtoReflect() protoreflect.Message
type SensorRequest ¶
type SensorRequest struct { Sensor int32 `protobuf:"varint,1,opt,name=Sensor,proto3" json:"Sensor,omitempty"` // contains filtered or unexported fields }
func (*SensorRequest) Descriptor
deprecated
func (*SensorRequest) Descriptor() ([]byte, []int)
Deprecated: Use SensorRequest.ProtoReflect.Descriptor instead.
func (*SensorRequest) GetSensor ¶
func (x *SensorRequest) GetSensor() int32
func (*SensorRequest) ProtoMessage ¶
func (*SensorRequest) ProtoMessage()
func (*SensorRequest) ProtoReflect ¶
func (x *SensorRequest) ProtoReflect() protoreflect.Message
func (*SensorRequest) Reset ¶
func (x *SensorRequest) Reset()
func (*SensorRequest) String ¶
func (x *SensorRequest) String() string
type Sensors ¶
type Sensors struct { Sensors []*Sensor `protobuf:"bytes,1,rep,name=sensors,proto3" json:"sensors,omitempty"` // contains filtered or unexported fields }
func (*Sensors) Descriptor
deprecated
func (*Sensors) GetSensors ¶
func (*Sensors) ProtoMessage ¶
func (*Sensors) ProtoMessage()
func (*Sensors) ProtoReflect ¶
func (x *Sensors) ProtoReflect() protoreflect.Message
type State ¶
type State struct { ButtonEvent int32 `protobuf:"varint,1,opt,name=ButtonEvent,proto3" json:"ButtonEvent,omitempty"` Dark bool `protobuf:"varint,2,opt,name=Dark,proto3" json:"Dark,omitempty"` Daylight bool `protobuf:"varint,3,opt,name=Daylight,proto3" json:"Daylight,omitempty"` LastUpdated string `protobuf:"bytes,4,opt,name=LastUpdated,proto3" json:"LastUpdated,omitempty"` LightLevel int32 `protobuf:"varint,5,opt,name=LightLevel,proto3" json:"LightLevel,omitempty"` Presence bool `protobuf:"varint,6,opt,name=Presence,proto3" json:"Presence,omitempty"` Status int32 `protobuf:"varint,7,opt,name=Status,proto3" json:"Status,omitempty"` Temperature int32 `protobuf:"varint,8,opt,name=Temperature,proto3" json:"Temperature,omitempty"` // contains filtered or unexported fields }
func (*State) Descriptor
deprecated
func (*State) GetButtonEvent ¶
func (*State) GetDaylight ¶
func (*State) GetLastUpdated ¶
func (*State) GetLightLevel ¶
func (*State) GetPresence ¶
func (*State) GetTemperature ¶
func (*State) ProtoMessage ¶
func (*State) ProtoMessage()
func (*State) ProtoReflect ¶
func (x *State) ProtoReflect() protoreflect.Message
type UnimplementedLightsServer ¶
type UnimplementedLightsServer struct{}
UnimplementedLightsServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedLightsServer) Blink ¶
func (UnimplementedLightsServer) Blink(context.Context, *LightsRequest) (*LightsResponse, error)
func (UnimplementedLightsServer) GetSensors ¶
func (UnimplementedLightsServer) SwitchOff ¶
func (UnimplementedLightsServer) SwitchOff(context.Context, *LightsRequest) (*LightsResponse, error)
func (UnimplementedLightsServer) SwitchOn ¶
func (UnimplementedLightsServer) SwitchOn(context.Context, *LightsRequest) (*LightsResponse, error)
type UnsafeLightsServer ¶ added in v0.7.2
type UnsafeLightsServer interface {
// contains filtered or unexported methods
}
UnsafeLightsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LightsServer will result in compilation errors.