diff --git a/Makefile b/Makefile index 20f9896..47914f0 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,8 @@ tls: ## Generates TLS certificates for the server, under ~/.homecon openssl genrsa -out ${HOME}/.homecontrol/server.key 4096 openssl req -new -x509 -sha256 -key ${HOME}/.homecontrol/server.key \ -out ${HOME}/.homecontrol/server.crt -days 3650 \ - -subj "/C=US/ST=MA/L=Cambridge/O=Networld/CN=Homecontrol/emailAddress=foo@bar.com" + -subj "/C=US/ST=MA/L=Cambridge/O=Networld/CN=Homecontrol/emailAddress=foo@bar.com" \ + -addext "subjectAltName=IP:0.0.0.0,IP:127.0.0.1,IP:192.168.1.2" clean: ## Removes generated protobuffer code and binaries. Keeps ~/.homecontrol rm -f */*.pb.go diff --git a/client/main.go b/client/main.go index dc518ab..6bbd849 100644 --- a/client/main.go +++ b/client/main.go @@ -1,8 +1,11 @@ package main import ( + "crypto/tls" + "crypto/x509" "flag" "fmt" + "io/ioutil" "os" "time" @@ -20,7 +23,7 @@ var ( address = flag.String("host", "127.0.0.1:50051", "The gRPC service endpoint that will be contacted.") cmd = flag.String("cmd", "groups", "The command that will be executed.") group = flag.Int("group", 2, "The light group ID.") - tls = flag.Bool("tls", false, "Activate TLS communication channel encryption.") + tlsFlag = flag.Bool("tls", false, "Activate TLS communication channel encryption.") brightness = flag.Float64("brightness", 0.66, "Light brightness in percentage. Value between 0 and 1.") saturation = flag.Float64("sat", 0, "Light saturation in percentage. Value between 0 and 1.") hueValue = flag.Float64("hue", 0, " Value between 0 and 65535 with Red=5535 and Green=25500 and Blue=46920") @@ -71,18 +74,18 @@ func blink(client hue.LightsClient, group int) { func getCallOptions() []grpc.CallOption { opts := []grpc.CallOption{ - grpc.FailFast(true), - grpc.MaxCallSendMsgSize(1024), - grpc.MaxCallRecvMsgSize(5120), + // grpc.FailFast(true), + // grpc.MaxCallSendMsgSize(1024), + // grpc.MaxCallRecvMsgSize(5120), } return opts } func getDialOptions() []grpc.DialOption { opts := []grpc.DialOption{ - grpc.WithTimeout(10 * time.Second), - grpc.WithBlock(), - grpc.WithBackoffMaxDelay(1 * time.Second), + // grpc.WithTimeout(10 * time.Second), + // grpc.WithBlock(), + // grpc.WithBackoffMaxDelay(1 * time.Second), } return opts } @@ -92,8 +95,20 @@ func main() { start := time.Now() opts := getDialOptions() - if *tls { - cred, err := credentials.NewClientTLSFromFile(os.Getenv("HOME")+"/.homecontrol/server.crt", "Homecontrol") + if *tlsFlag { + certPool := x509.NewCertPool() + bs, err := ioutil.ReadFile(os.Getenv("HOME") + "/.homecontrol/server.crt") + if err != nil { + log.Fatalf("failed to read ca cert: %s", err) + } + + ok := certPool.AppendCertsFromPEM(bs) + if !ok { + log.Fatal("failed to append certs") + } + cred := credentials.NewTLS(&tls.Config{ + RootCAs: certPool, + }) info := cred.Info() log.WithField("tls", true). WithField("tls_version", info.SecurityVersion). diff --git a/go.mod b/go.mod index a93fa23..c24192f 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/sirupsen/logrus v1.0.5 github.com/stretchr/testify v1.6.1 // indirect google.golang.org/grpc v1.31.1 - google.golang.org/protobuf v1.25.0 + google.golang.org/protobuf v1.25.0 // indirect gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect ) diff --git a/go.sum b/go.sum index 856623d..667f43f 100644 --- a/go.sum +++ b/go.sum @@ -33,6 +33,7 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/heatxsink/go-hue v0.0.0-20170108211435-077c5fe84349 h1:XMlISHes9eDJr9K5hTAIG92d1j4RBlFh3b+AetKz2MU= github.com/heatxsink/go-hue v0.0.0-20170108211435-077c5fe84349/go.mod h1:MeBXPrQdPQwocP+nWBaDcrs5CZnk4e1xyvVyS0bgSkc= @@ -97,15 +98,11 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24 h1:wDju+RU97qa0FZT0QnZDg9Uc2dH0Ql513kFvHocz+WM= -google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= -google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.31.1 h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs= google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= diff --git a/hue/hue.pb.go b/hue/hue.pb.go index d105d98..c59765f 100644 --- a/hue/hue.pb.go +++ b/hue/hue.pb.go @@ -1,39 +1,30 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 // source: hue.proto package hue import ( context "context" + fmt "fmt" proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" + math "math" ) -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type LightsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - 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"` @@ -43,789 +34,535 @@ type LightsRequest struct { // Red: 65535 // Green: 25500 // Blue: 46920 - Hue float32 `protobuf:"fixed32,4,opt,name=Hue,proto3" json:"Hue,omitempty"` + Hue float32 `protobuf:"fixed32,4,opt,name=Hue,proto3" json:"Hue,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *LightsRequest) Reset() { - *x = LightsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_hue_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *LightsRequest) Reset() { *m = LightsRequest{} } +func (m *LightsRequest) String() string { return proto.CompactTextString(m) } +func (*LightsRequest) ProtoMessage() {} +func (*LightsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d258138af7183d5a, []int{0} } -func (x *LightsRequest) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *LightsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LightsRequest.Unmarshal(m, b) } - -func (*LightsRequest) ProtoMessage() {} - -func (x *LightsRequest) ProtoReflect() protoreflect.Message { - mi := &file_hue_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *LightsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LightsRequest.Marshal(b, m, deterministic) } - -// Deprecated: Use LightsRequest.ProtoReflect.Descriptor instead. -func (*LightsRequest) Descriptor() ([]byte, []int) { - return file_hue_proto_rawDescGZIP(), []int{0} +func (m *LightsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_LightsRequest.Merge(m, src) +} +func (m *LightsRequest) XXX_Size() int { + return xxx_messageInfo_LightsRequest.Size(m) } +func (m *LightsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_LightsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_LightsRequest proto.InternalMessageInfo -func (x *LightsRequest) GetGroup() int32 { - if x != nil { - return x.Group +func (m *LightsRequest) GetGroup() int32 { + if m != nil { + return m.Group } return 0 } -func (x *LightsRequest) GetBrightnessPercent() float32 { - if x != nil { - return x.BrightnessPercent +func (m *LightsRequest) GetBrightnessPercent() float32 { + if m != nil { + return m.BrightnessPercent } return 0 } -func (x *LightsRequest) GetSaturationPercent() float32 { - if x != nil { - return x.SaturationPercent +func (m *LightsRequest) GetSaturationPercent() float32 { + if m != nil { + return m.SaturationPercent } return 0 } -func (x *LightsRequest) GetHue() float32 { - if x != nil { - return x.Hue +func (m *LightsRequest) GetHue() float32 { + if m != nil { + return m.Hue } return 0 } type LightsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *LightsResponse) Reset() { - *x = LightsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_hue_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *LightsResponse) Reset() { *m = LightsResponse{} } +func (m *LightsResponse) String() string { return proto.CompactTextString(m) } +func (*LightsResponse) ProtoMessage() {} +func (*LightsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d258138af7183d5a, []int{1} } -func (x *LightsResponse) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *LightsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LightsResponse.Unmarshal(m, b) } - -func (*LightsResponse) ProtoMessage() {} - -func (x *LightsResponse) ProtoReflect() protoreflect.Message { - mi := &file_hue_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *LightsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LightsResponse.Marshal(b, m, deterministic) } - -// Deprecated: Use LightsResponse.ProtoReflect.Descriptor instead. -func (*LightsResponse) Descriptor() ([]byte, []int) { - return file_hue_proto_rawDescGZIP(), []int{1} +func (m *LightsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_LightsResponse.Merge(m, src) +} +func (m *LightsResponse) XXX_Size() int { + return xxx_messageInfo_LightsResponse.Size(m) +} +func (m *LightsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_LightsResponse.DiscardUnknown(m) } -func (x *LightsResponse) GetSuccess() bool { - if x != nil { - return x.Success +var xxx_messageInfo_LightsResponse proto.InternalMessageInfo + +func (m *LightsResponse) GetSuccess() bool { + if m != nil { + return m.Success } return false } type Groups struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Groups []*Group `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` + Groups []*Group `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *Groups) Reset() { - *x = Groups{} - if protoimpl.UnsafeEnabled { - mi := &file_hue_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *Groups) Reset() { *m = Groups{} } +func (m *Groups) String() string { return proto.CompactTextString(m) } +func (*Groups) ProtoMessage() {} +func (*Groups) Descriptor() ([]byte, []int) { + return fileDescriptor_d258138af7183d5a, []int{2} } -func (x *Groups) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *Groups) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Groups.Unmarshal(m, b) } - -func (*Groups) ProtoMessage() {} - -func (x *Groups) ProtoReflect() protoreflect.Message { - mi := &file_hue_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *Groups) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Groups.Marshal(b, m, deterministic) } - -// Deprecated: Use Groups.ProtoReflect.Descriptor instead. -func (*Groups) Descriptor() ([]byte, []int) { - return file_hue_proto_rawDescGZIP(), []int{2} +func (m *Groups) XXX_Merge(src proto.Message) { + xxx_messageInfo_Groups.Merge(m, src) } +func (m *Groups) XXX_Size() int { + return xxx_messageInfo_Groups.Size(m) +} +func (m *Groups) XXX_DiscardUnknown() { + xxx_messageInfo_Groups.DiscardUnknown(m) +} + +var xxx_messageInfo_Groups proto.InternalMessageInfo -func (x *Groups) GetGroups() []*Group { - if x != nil { - return x.Groups +func (m *Groups) GetGroups() []*Group { + if m != nil { + return m.Groups } return nil } type Group struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *Group) Reset() { - *x = Group{} - if protoimpl.UnsafeEnabled { - mi := &file_hue_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + 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"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Group) Reset() { *m = Group{} } +func (m *Group) String() string { return proto.CompactTextString(m) } +func (*Group) ProtoMessage() {} +func (*Group) Descriptor() ([]byte, []int) { + return fileDescriptor_d258138af7183d5a, []int{3} } -func (x *Group) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *Group) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Group.Unmarshal(m, b) } - -func (*Group) ProtoMessage() {} - -func (x *Group) ProtoReflect() protoreflect.Message { - mi := &file_hue_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *Group) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Group.Marshal(b, m, deterministic) } - -// Deprecated: Use Group.ProtoReflect.Descriptor instead. -func (*Group) Descriptor() ([]byte, []int) { - return file_hue_proto_rawDescGZIP(), []int{3} +func (m *Group) XXX_Merge(src proto.Message) { + xxx_messageInfo_Group.Merge(m, src) +} +func (m *Group) XXX_Size() int { + return xxx_messageInfo_Group.Size(m) +} +func (m *Group) XXX_DiscardUnknown() { + xxx_messageInfo_Group.DiscardUnknown(m) } -func (x *Group) GetID() int32 { - if x != nil { - return x.ID +var xxx_messageInfo_Group proto.InternalMessageInfo + +func (m *Group) GetID() int32 { + if m != nil { + return m.ID } return 0 } -func (x *Group) GetName() string { - if x != nil { - return x.Name +func (m *Group) GetName() string { + if m != nil { + return m.Name } return "" } -func (x *Group) GetOn() bool { - if x != nil { - return x.On +func (m *Group) GetOn() bool { + if m != nil { + return m.On } return false } -func (x *Group) GetBrightness() int32 { - if x != nil { - return x.Brightness +func (m *Group) GetBrightness() int32 { + if m != nil { + return m.Brightness } return 0 } type SensorRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sensor int32 `protobuf:"varint,1,opt,name=Sensor,proto3" json:"Sensor,omitempty"` + Sensor int32 `protobuf:"varint,1,opt,name=Sensor,proto3" json:"Sensor,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *SensorRequest) Reset() { - *x = SensorRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_hue_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *SensorRequest) Reset() { *m = SensorRequest{} } +func (m *SensorRequest) String() string { return proto.CompactTextString(m) } +func (*SensorRequest) ProtoMessage() {} +func (*SensorRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d258138af7183d5a, []int{4} } -func (x *SensorRequest) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *SensorRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SensorRequest.Unmarshal(m, b) } - -func (*SensorRequest) ProtoMessage() {} - -func (x *SensorRequest) ProtoReflect() protoreflect.Message { - mi := &file_hue_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *SensorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SensorRequest.Marshal(b, m, deterministic) } - -// Deprecated: Use SensorRequest.ProtoReflect.Descriptor instead. -func (*SensorRequest) Descriptor() ([]byte, []int) { - return file_hue_proto_rawDescGZIP(), []int{4} +func (m *SensorRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SensorRequest.Merge(m, src) +} +func (m *SensorRequest) XXX_Size() int { + return xxx_messageInfo_SensorRequest.Size(m) +} +func (m *SensorRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SensorRequest.DiscardUnknown(m) } -func (x *SensorRequest) GetSensor() int32 { - if x != nil { - return x.Sensor +var xxx_messageInfo_SensorRequest proto.InternalMessageInfo + +func (m *SensorRequest) GetSensor() int32 { + if m != nil { + return m.Sensor } return 0 } type Sensors struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sensors []*Sensor `protobuf:"bytes,1,rep,name=sensors,proto3" json:"sensors,omitempty"` + Sensors []*Sensor `protobuf:"bytes,1,rep,name=sensors,proto3" json:"sensors,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *Sensors) Reset() { - *x = Sensors{} - if protoimpl.UnsafeEnabled { - mi := &file_hue_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *Sensors) Reset() { *m = Sensors{} } +func (m *Sensors) String() string { return proto.CompactTextString(m) } +func (*Sensors) ProtoMessage() {} +func (*Sensors) Descriptor() ([]byte, []int) { + return fileDescriptor_d258138af7183d5a, []int{5} } -func (x *Sensors) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *Sensors) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Sensors.Unmarshal(m, b) } - -func (*Sensors) ProtoMessage() {} - -func (x *Sensors) ProtoReflect() protoreflect.Message { - mi := &file_hue_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *Sensors) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Sensors.Marshal(b, m, deterministic) } - -// Deprecated: Use Sensors.ProtoReflect.Descriptor instead. -func (*Sensors) Descriptor() ([]byte, []int) { - return file_hue_proto_rawDescGZIP(), []int{5} +func (m *Sensors) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sensors.Merge(m, src) } +func (m *Sensors) XXX_Size() int { + return xxx_messageInfo_Sensors.Size(m) +} +func (m *Sensors) XXX_DiscardUnknown() { + xxx_messageInfo_Sensors.DiscardUnknown(m) +} + +var xxx_messageInfo_Sensors proto.InternalMessageInfo -func (x *Sensors) GetSensors() []*Sensor { - if x != nil { - return x.Sensors +func (m *Sensors) GetSensors() []*Sensor { + if m != nil { + return m.Sensors } return nil } type Sensor struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *Sensor) Reset() { - *x = Sensor{} - if protoimpl.UnsafeEnabled { - mi := &file_hue_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + 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"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Sensor) Reset() { *m = Sensor{} } +func (m *Sensor) String() string { return proto.CompactTextString(m) } +func (*Sensor) ProtoMessage() {} +func (*Sensor) Descriptor() ([]byte, []int) { + return fileDescriptor_d258138af7183d5a, []int{6} } -func (x *Sensor) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *Sensor) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Sensor.Unmarshal(m, b) } - -func (*Sensor) ProtoMessage() {} - -func (x *Sensor) ProtoReflect() protoreflect.Message { - mi := &file_hue_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *Sensor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Sensor.Marshal(b, m, deterministic) } - -// Deprecated: Use Sensor.ProtoReflect.Descriptor instead. -func (*Sensor) Descriptor() ([]byte, []int) { - return file_hue_proto_rawDescGZIP(), []int{6} +func (m *Sensor) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sensor.Merge(m, src) +} +func (m *Sensor) XXX_Size() int { + return xxx_messageInfo_Sensor.Size(m) } +func (m *Sensor) XXX_DiscardUnknown() { + xxx_messageInfo_Sensor.DiscardUnknown(m) +} + +var xxx_messageInfo_Sensor proto.InternalMessageInfo -func (x *Sensor) GetID() int32 { - if x != nil { - return x.ID +func (m *Sensor) GetID() int32 { + if m != nil { + return m.ID } return 0 } -func (x *Sensor) GetUniqueID() string { - if x != nil { - return x.UniqueID +func (m *Sensor) GetUniqueID() string { + if m != nil { + return m.UniqueID } return "" } -func (x *Sensor) GetName() string { - if x != nil { - return x.Name +func (m *Sensor) GetName() string { + if m != nil { + return m.Name } return "" } -func (x *Sensor) GetType() string { - if x != nil { - return x.Type +func (m *Sensor) GetType() string { + if m != nil { + return m.Type } return "" } -func (x *Sensor) GetManufacturerName() string { - if x != nil { - return x.ManufacturerName +func (m *Sensor) GetManufacturerName() string { + if m != nil { + return m.ManufacturerName } return "" } -func (x *Sensor) GetModelID() string { - if x != nil { - return x.ModelID +func (m *Sensor) GetModelID() string { + if m != nil { + return m.ModelID } return "" } -func (x *Sensor) GetSWVersion() string { - if x != nil { - return x.SWVersion +func (m *Sensor) GetSWVersion() string { + if m != nil { + return m.SWVersion } return "" } -func (x *Sensor) GetState() *State { - if x != nil { - return x.State +func (m *Sensor) GetState() *State { + if m != nil { + return m.State } return nil } type State struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - 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"` -} - -func (x *State) Reset() { - *x = State{} - if protoimpl.UnsafeEnabled { - mi := &file_hue_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + 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"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *State) Reset() { *m = State{} } +func (m *State) String() string { return proto.CompactTextString(m) } +func (*State) ProtoMessage() {} +func (*State) Descriptor() ([]byte, []int) { + return fileDescriptor_d258138af7183d5a, []int{7} } -func (x *State) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *State) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_State.Unmarshal(m, b) } - -func (*State) ProtoMessage() {} - -func (x *State) ProtoReflect() protoreflect.Message { - mi := &file_hue_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_State.Marshal(b, m, deterministic) } - -// Deprecated: Use State.ProtoReflect.Descriptor instead. -func (*State) Descriptor() ([]byte, []int) { - return file_hue_proto_rawDescGZIP(), []int{7} +func (m *State) XXX_Merge(src proto.Message) { + xxx_messageInfo_State.Merge(m, src) } +func (m *State) XXX_Size() int { + return xxx_messageInfo_State.Size(m) +} +func (m *State) XXX_DiscardUnknown() { + xxx_messageInfo_State.DiscardUnknown(m) +} + +var xxx_messageInfo_State proto.InternalMessageInfo -func (x *State) GetButtonEvent() int32 { - if x != nil { - return x.ButtonEvent +func (m *State) GetButtonEvent() int32 { + if m != nil { + return m.ButtonEvent } return 0 } -func (x *State) GetDark() bool { - if x != nil { - return x.Dark +func (m *State) GetDark() bool { + if m != nil { + return m.Dark } return false } -func (x *State) GetDaylight() bool { - if x != nil { - return x.Daylight +func (m *State) GetDaylight() bool { + if m != nil { + return m.Daylight } return false } -func (x *State) GetLastUpdated() string { - if x != nil { - return x.LastUpdated +func (m *State) GetLastUpdated() string { + if m != nil { + return m.LastUpdated } return "" } -func (x *State) GetLightLevel() int32 { - if x != nil { - return x.LightLevel +func (m *State) GetLightLevel() int32 { + if m != nil { + return m.LightLevel } return 0 } -func (x *State) GetPresence() bool { - if x != nil { - return x.Presence +func (m *State) GetPresence() bool { + if m != nil { + return m.Presence } return false } -func (x *State) GetStatus() int32 { - if x != nil { - return x.Status +func (m *State) GetStatus() int32 { + if m != nil { + return m.Status } return 0 } -func (x *State) GetTemperature() int32 { - if x != nil { - return x.Temperature +func (m *State) GetTemperature() int32 { + if m != nil { + return m.Temperature } return 0 } -var File_hue_proto protoreflect.FileDescriptor - -var file_hue_proto_rawDesc = []byte{ - 0x0a, 0x09, 0x68, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x03, 0x68, 0x75, 0x65, - 0x22, 0x93, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x2c, 0x0a, 0x11, 0x42, 0x72, 0x69, 0x67, - 0x68, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x02, 0x52, 0x11, 0x42, 0x72, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x50, - 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x11, 0x53, 0x61, 0x74, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x11, 0x53, 0x61, 0x74, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x65, 0x72, - 0x63, 0x65, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x48, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x02, 0x52, 0x03, 0x48, 0x75, 0x65, 0x22, 0x2a, 0x0a, 0x0e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x22, 0x2c, 0x0a, 0x06, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x22, 0x0a, 0x06, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x68, - 0x75, 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, - 0x22, 0x5b, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x4f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x02, 0x4f, 0x6e, 0x12, 0x1e, 0x0a, - 0x0a, 0x42, 0x72, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0a, 0x42, 0x72, 0x69, 0x67, 0x68, 0x74, 0x6e, 0x65, 0x73, 0x73, 0x22, 0x27, 0x0a, - 0x0d, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, - 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x22, 0x30, 0x0a, 0x07, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, - 0x73, 0x12, 0x25, 0x0a, 0x07, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x68, 0x75, 0x65, 0x2e, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x52, - 0x07, 0x73, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x22, 0xe2, 0x01, 0x0a, 0x06, 0x53, 0x65, 0x6e, - 0x73, 0x6f, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x02, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x44, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x44, 0x12, - 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x4d, 0x61, 0x6e, 0x75, 0x66, - 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x10, 0x4d, 0x61, 0x6e, 0x75, 0x66, 0x61, 0x63, 0x74, 0x75, 0x72, 0x65, 0x72, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x44, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x49, 0x44, 0x12, 0x1c, 0x0a, - 0x09, 0x53, 0x57, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x53, 0x57, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x05, 0x53, - 0x74, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x68, 0x75, 0x65, - 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x22, 0xf1, 0x01, - 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x42, 0x75, 0x74, 0x74, 0x6f, - 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x42, 0x75, - 0x74, 0x74, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x72, - 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x44, 0x61, 0x72, 0x6b, 0x12, 0x1a, 0x0a, - 0x08, 0x44, 0x61, 0x79, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x44, 0x61, 0x79, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x4c, 0x61, 0x73, - 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x4c, 0x61, 0x73, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x4c, - 0x69, 0x67, 0x68, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x50, - 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x50, - 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, - 0x20, 0x0a, 0x0b, 0x54, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x54, 0x65, 0x6d, 0x70, 0x65, 0x72, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x32, 0x8d, 0x02, 0x0a, 0x06, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x12, 0x2e, 0x0a, 0x09, - 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x12, 0x2e, 0x68, 0x75, 0x65, 0x2e, - 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0b, 0x2e, - 0x68, 0x75, 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0x00, 0x12, 0x30, 0x0a, 0x0a, - 0x47, 0x65, 0x74, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x12, 0x12, 0x2e, 0x68, 0x75, 0x65, - 0x2e, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0c, - 0x2e, 0x68, 0x75, 0x65, 0x2e, 0x53, 0x65, 0x6e, 0x73, 0x6f, 0x72, 0x73, 0x22, 0x00, 0x12, 0x35, - 0x0a, 0x08, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x4f, 0x6e, 0x12, 0x12, 0x2e, 0x68, 0x75, 0x65, - 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, - 0x2e, 0x68, 0x75, 0x65, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x09, 0x53, 0x77, 0x69, 0x74, 0x63, 0x68, 0x4f, - 0x66, 0x66, 0x12, 0x12, 0x2e, 0x68, 0x75, 0x65, 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x68, 0x75, 0x65, 0x2e, 0x4c, 0x69, 0x67, - 0x68, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x32, 0x0a, - 0x05, 0x42, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x2e, 0x68, 0x75, 0x65, 0x2e, 0x4c, 0x69, 0x67, - 0x68, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x68, 0x75, 0x65, - 0x2e, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x00, 0x42, 0x07, 0x5a, 0x05, 0x2e, 0x3b, 0x68, 0x75, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_hue_proto_rawDescOnce sync.Once - file_hue_proto_rawDescData = file_hue_proto_rawDesc -) - -func file_hue_proto_rawDescGZIP() []byte { - file_hue_proto_rawDescOnce.Do(func() { - file_hue_proto_rawDescData = protoimpl.X.CompressGZIP(file_hue_proto_rawDescData) - }) - return file_hue_proto_rawDescData -} - -var file_hue_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_hue_proto_goTypes = []interface{}{ - (*LightsRequest)(nil), // 0: hue.LightsRequest - (*LightsResponse)(nil), // 1: hue.LightsResponse - (*Groups)(nil), // 2: hue.Groups - (*Group)(nil), // 3: hue.Group - (*SensorRequest)(nil), // 4: hue.SensorRequest - (*Sensors)(nil), // 5: hue.Sensors - (*Sensor)(nil), // 6: hue.Sensor - (*State)(nil), // 7: hue.State -} -var file_hue_proto_depIdxs = []int32{ - 3, // 0: hue.Groups.groups:type_name -> hue.Group - 6, // 1: hue.Sensors.sensors:type_name -> hue.Sensor - 7, // 2: hue.Sensor.State:type_name -> hue.State - 0, // 3: hue.Lights.GetGroups:input_type -> hue.LightsRequest - 4, // 4: hue.Lights.GetSensors:input_type -> hue.SensorRequest - 0, // 5: hue.Lights.SwitchOn:input_type -> hue.LightsRequest - 0, // 6: hue.Lights.SwitchOff:input_type -> hue.LightsRequest - 0, // 7: hue.Lights.Blink:input_type -> hue.LightsRequest - 2, // 8: hue.Lights.GetGroups:output_type -> hue.Groups - 5, // 9: hue.Lights.GetSensors:output_type -> hue.Sensors - 1, // 10: hue.Lights.SwitchOn:output_type -> hue.LightsResponse - 1, // 11: hue.Lights.SwitchOff:output_type -> hue.LightsResponse - 1, // 12: hue.Lights.Blink:output_type -> hue.LightsResponse - 8, // [8:13] is the sub-list for method output_type - 3, // [3:8] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name -} - -func init() { file_hue_proto_init() } -func file_hue_proto_init() { - if File_hue_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_hue_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hue_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LightsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hue_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Groups); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hue_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Group); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hue_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SensorRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hue_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Sensors); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hue_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Sensor); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_hue_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*State); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_hue_proto_rawDesc, - NumEnums: 0, - NumMessages: 8, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_hue_proto_goTypes, - DependencyIndexes: file_hue_proto_depIdxs, - MessageInfos: file_hue_proto_msgTypes, - }.Build() - File_hue_proto = out.File - file_hue_proto_rawDesc = nil - file_hue_proto_goTypes = nil - file_hue_proto_depIdxs = nil +func init() { + proto.RegisterType((*LightsRequest)(nil), "hue.LightsRequest") + proto.RegisterType((*LightsResponse)(nil), "hue.LightsResponse") + proto.RegisterType((*Groups)(nil), "hue.Groups") + proto.RegisterType((*Group)(nil), "hue.Group") + proto.RegisterType((*SensorRequest)(nil), "hue.SensorRequest") + proto.RegisterType((*Sensors)(nil), "hue.Sensors") + proto.RegisterType((*Sensor)(nil), "hue.Sensor") + proto.RegisterType((*State)(nil), "hue.State") +} + +func init() { proto.RegisterFile("hue.proto", fileDescriptor_d258138af7183d5a) } + +var fileDescriptor_d258138af7183d5a = []byte{ + // 581 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x5f, 0x4f, 0xd4, 0x40, + 0x10, 0xa7, 0x77, 0xb4, 0xd7, 0xce, 0x09, 0xc1, 0xd5, 0x98, 0x86, 0x18, 0xd3, 0x34, 0x31, 0x12, + 0x42, 0x2e, 0x04, 0xa3, 0x2f, 0xbe, 0x5d, 0x6a, 0xf0, 0x12, 0x10, 0xb2, 0x07, 0x9a, 0xe8, 0x53, + 0x2d, 0x03, 0xd7, 0x70, 0x6c, 0xcb, 0xfe, 0xc1, 0xf0, 0x21, 0x7c, 0xf2, 0x1b, 0xfa, 0x0d, 0xfc, + 0x06, 0x66, 0xa7, 0xdb, 0xbb, 0x92, 0xf3, 0x85, 0xb7, 0x99, 0xdf, 0x6f, 0x66, 0xf7, 0xf7, 0xdb, + 0x99, 0x16, 0xa2, 0x99, 0xc1, 0x51, 0x2d, 0x2b, 0x5d, 0xb1, 0xfe, 0xcc, 0x60, 0xfa, 0xdb, 0x83, + 0x8d, 0xa3, 0xf2, 0x6a, 0xa6, 0x15, 0xc7, 0x5b, 0x83, 0x4a, 0xb3, 0xe7, 0xe0, 0x1f, 0xca, 0xca, + 0xd4, 0xb1, 0x97, 0x78, 0x3b, 0x3e, 0x6f, 0x12, 0xb6, 0x07, 0x4f, 0xc7, 0xd2, 0xd6, 0x09, 0x54, + 0xea, 0x14, 0x65, 0x81, 0x42, 0xc7, 0xbd, 0xc4, 0xdb, 0xe9, 0xf1, 0x55, 0xc2, 0x56, 0x4f, 0x73, + 0x6d, 0x64, 0xae, 0xcb, 0x4a, 0xb4, 0xd5, 0xfd, 0xa6, 0x7a, 0x85, 0x60, 0x5b, 0xd0, 0xff, 0x64, + 0x30, 0x5e, 0x27, 0xde, 0x86, 0xe9, 0x2e, 0x6c, 0xb6, 0xa2, 0x54, 0x5d, 0x09, 0x85, 0x2c, 0x86, + 0x81, 0x32, 0x45, 0x81, 0x4a, 0x91, 0xae, 0x90, 0xb7, 0x69, 0xba, 0x07, 0x01, 0x49, 0x54, 0x2c, + 0x85, 0xe0, 0x8a, 0xa2, 0xd8, 0x4b, 0xfa, 0x3b, 0xc3, 0x03, 0x18, 0x59, 0xb3, 0x44, 0x72, 0xc7, + 0xa4, 0xdf, 0x9d, 0x3b, 0xb6, 0x09, 0xbd, 0x49, 0xe6, 0x3c, 0xf6, 0x26, 0x19, 0x63, 0xb0, 0xfe, + 0x39, 0xbf, 0x41, 0xf2, 0x14, 0x71, 0x8a, 0x6d, 0xcd, 0x89, 0x20, 0xdd, 0x21, 0xef, 0x9d, 0x08, + 0xf6, 0x0a, 0x60, 0xe9, 0x95, 0xf4, 0xfa, 0xbc, 0x83, 0xa4, 0x6f, 0x60, 0x63, 0x8a, 0x42, 0x55, + 0xb2, 0x7d, 0xcb, 0x17, 0x10, 0x34, 0x80, 0xbb, 0xc8, 0x65, 0xe9, 0x3e, 0x0c, 0x9a, 0x48, 0xb1, + 0xd7, 0x30, 0x50, 0x4d, 0xe8, 0x54, 0x0f, 0x49, 0xb5, 0x3b, 0xa7, 0xe5, 0xd2, 0x3f, 0x5e, 0x7b, + 0xd4, 0x8a, 0xf2, 0x6d, 0x08, 0xcf, 0x45, 0x79, 0x6b, 0x70, 0x92, 0x39, 0xf5, 0x8b, 0x7c, 0xe1, + 0xaa, 0xdf, 0x71, 0xc5, 0x60, 0xfd, 0xec, 0xbe, 0x6e, 0xde, 0x3b, 0xe2, 0x14, 0xb3, 0x5d, 0xd8, + 0x3a, 0xce, 0x85, 0xb9, 0xcc, 0x0b, 0x6d, 0x24, 0x4a, 0xea, 0xf1, 0x89, 0x5f, 0xc1, 0xed, 0x28, + 0x8e, 0xab, 0x0b, 0x9c, 0x4f, 0xb2, 0x38, 0xa0, 0x92, 0x36, 0x65, 0x2f, 0x21, 0x9a, 0x7e, 0xfd, + 0x82, 0x52, 0x95, 0x95, 0x88, 0x07, 0xc4, 0x2d, 0x01, 0x96, 0x80, 0x3f, 0xd5, 0xb9, 0xc6, 0x38, + 0x4c, 0xbc, 0xc5, 0x74, 0x08, 0xe1, 0x0d, 0x91, 0xfe, 0xf5, 0x5c, 0x09, 0x4b, 0x60, 0x38, 0x36, + 0x5a, 0x57, 0xe2, 0xe3, 0x9d, 0x5d, 0x9d, 0xc6, 0x6c, 0x17, 0xb2, 0x2e, 0xb2, 0x5c, 0x5e, 0x93, + 0xe3, 0x90, 0x53, 0x6c, 0x5f, 0x22, 0xcb, 0xef, 0xe7, 0x76, 0x1e, 0x6e, 0x6a, 0x8b, 0xdc, 0x9e, + 0x78, 0x94, 0x2b, 0x7d, 0x5e, 0x5f, 0xe4, 0x1a, 0x2f, 0x9c, 0xf9, 0x2e, 0x64, 0xa7, 0x4b, 0x4b, + 0x77, 0x84, 0x77, 0x38, 0x27, 0xf7, 0x3e, 0xef, 0x20, 0xf6, 0xf4, 0x53, 0x89, 0x0a, 0x45, 0x81, + 0x64, 0x3c, 0xe4, 0x8b, 0x9c, 0x06, 0xad, 0x73, 0x6d, 0x14, 0xd9, 0xb6, 0x83, 0xa6, 0xcc, 0xde, + 0x7a, 0x86, 0x37, 0x35, 0x4a, 0xbb, 0xf4, 0x8d, 0x73, 0x9f, 0x77, 0xa1, 0x83, 0x5f, 0x3d, 0x08, + 0x9a, 0x5d, 0x67, 0x23, 0x88, 0x0e, 0x51, 0xbb, 0x65, 0x66, 0xf4, 0x3c, 0x0f, 0x3e, 0xcd, 0xed, + 0xe1, 0x72, 0xa1, 0x55, 0xba, 0xc6, 0xf6, 0x01, 0x0e, 0x51, 0xb7, 0x8b, 0xc4, 0xba, 0x7b, 0xe3, + 0x1a, 0x9e, 0x74, 0x30, 0xdb, 0xf1, 0x0e, 0xc2, 0xe9, 0xcf, 0x52, 0x17, 0xb3, 0x13, 0xf1, 0xdf, + 0x0b, 0x9e, 0x3d, 0xc0, 0x9a, 0x4f, 0x2f, 0x5d, 0x63, 0xef, 0x21, 0x72, 0x6d, 0x97, 0x97, 0x8f, + 0xe9, 0x3b, 0x00, 0x7f, 0x3c, 0x2f, 0xc5, 0xf5, 0x23, 0x7a, 0xc6, 0x83, 0x6f, 0xfe, 0xe8, 0xc3, + 0xcc, 0xe0, 0x8f, 0x80, 0xfe, 0x52, 0x6f, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xef, 0x8f, 0x54, + 0x31, 0xb2, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 // LightsClient is the client API for Lights service. // @@ -839,10 +576,10 @@ type LightsClient interface { } type lightsClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewLightsClient(cc grpc.ClientConnInterface) LightsClient { +func NewLightsClient(cc *grpc.ClientConn) LightsClient { return &lightsClient{cc} } @@ -904,19 +641,19 @@ type LightsServer interface { type UnimplementedLightsServer struct { } -func (*UnimplementedLightsServer) GetGroups(context.Context, *LightsRequest) (*Groups, error) { +func (*UnimplementedLightsServer) GetGroups(ctx context.Context, req *LightsRequest) (*Groups, error) { return nil, status.Errorf(codes.Unimplemented, "method GetGroups not implemented") } -func (*UnimplementedLightsServer) GetSensors(context.Context, *SensorRequest) (*Sensors, error) { +func (*UnimplementedLightsServer) GetSensors(ctx context.Context, req *SensorRequest) (*Sensors, error) { return nil, status.Errorf(codes.Unimplemented, "method GetSensors not implemented") } -func (*UnimplementedLightsServer) SwitchOn(context.Context, *LightsRequest) (*LightsResponse, error) { +func (*UnimplementedLightsServer) SwitchOn(ctx context.Context, req *LightsRequest) (*LightsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SwitchOn not implemented") } -func (*UnimplementedLightsServer) SwitchOff(context.Context, *LightsRequest) (*LightsResponse, error) { +func (*UnimplementedLightsServer) SwitchOff(ctx context.Context, req *LightsRequest) (*LightsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SwitchOff not implemented") } -func (*UnimplementedLightsServer) Blink(context.Context, *LightsRequest) (*LightsResponse, error) { +func (*UnimplementedLightsServer) Blink(ctx context.Context, req *LightsRequest) (*LightsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Blink not implemented") } diff --git a/version/version.pb.go b/version/version.pb.go index 05b9d7c..7dbc03f 100644 --- a/version/version.pb.go +++ b/version/version.pb.go @@ -1,178 +1,101 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.25.0-devel -// protoc v3.13.0 // source: version.proto package version import ( context "context" + fmt "fmt" proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" + math "math" ) -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type VersionMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` - Build string `protobuf:"bytes,2,opt,name=build,proto3" json:"build,omitempty"` + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Build string `protobuf:"bytes,2,opt,name=build,proto3" json:"build,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *VersionMessage) Reset() { - *x = VersionMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_version_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *VersionMessage) Reset() { *m = VersionMessage{} } +func (m *VersionMessage) String() string { return proto.CompactTextString(m) } +func (*VersionMessage) ProtoMessage() {} +func (*VersionMessage) Descriptor() ([]byte, []int) { + return fileDescriptor_7d2c07d79758f814, []int{0} } -func (x *VersionMessage) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *VersionMessage) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_VersionMessage.Unmarshal(m, b) } - -func (*VersionMessage) ProtoMessage() {} - -func (x *VersionMessage) ProtoReflect() protoreflect.Message { - mi := &file_version_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *VersionMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_VersionMessage.Marshal(b, m, deterministic) } - -// Deprecated: Use VersionMessage.ProtoReflect.Descriptor instead. -func (*VersionMessage) Descriptor() ([]byte, []int) { - return file_version_proto_rawDescGZIP(), []int{0} +func (m *VersionMessage) XXX_Merge(src proto.Message) { + xxx_messageInfo_VersionMessage.Merge(m, src) +} +func (m *VersionMessage) XXX_Size() int { + return xxx_messageInfo_VersionMessage.Size(m) } +func (m *VersionMessage) XXX_DiscardUnknown() { + xxx_messageInfo_VersionMessage.DiscardUnknown(m) +} + +var xxx_messageInfo_VersionMessage proto.InternalMessageInfo -func (x *VersionMessage) GetVersion() string { - if x != nil { - return x.Version +func (m *VersionMessage) GetVersion() string { + if m != nil { + return m.Version } return "" } -func (x *VersionMessage) GetBuild() string { - if x != nil { - return x.Build +func (m *VersionMessage) GetBuild() string { + if m != nil { + return m.Build } return "" } -var File_version_proto protoreflect.FileDescriptor - -var file_version_proto_rawDesc = []byte{ - 0x0a, 0x0d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x40, 0x0a, 0x0e, 0x56, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x32, 0x48, 0x0a, 0x07, 0x56, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x3d, 0x0a, 0x07, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x17, 0x2e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, - 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x17, 0x2e, 0x76, 0x65, 0x72, 0x73, - 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0x00, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x3b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_version_proto_rawDescOnce sync.Once - file_version_proto_rawDescData = file_version_proto_rawDesc -) - -func file_version_proto_rawDescGZIP() []byte { - file_version_proto_rawDescOnce.Do(func() { - file_version_proto_rawDescData = protoimpl.X.CompressGZIP(file_version_proto_rawDescData) - }) - return file_version_proto_rawDescData +func init() { + proto.RegisterType((*VersionMessage)(nil), "version.VersionMessage") } -var file_version_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_version_proto_goTypes = []interface{}{ - (*VersionMessage)(nil), // 0: version.VersionMessage -} -var file_version_proto_depIdxs = []int32{ - 0, // 0: version.Version.Version:input_type -> version.VersionMessage - 0, // 1: version.Version.Version:output_type -> version.VersionMessage - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} +func init() { proto.RegisterFile("version.proto", fileDescriptor_7d2c07d79758f814) } -func init() { file_version_proto_init() } -func file_version_proto_init() { - if File_version_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_version_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VersionMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_version_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_version_proto_goTypes, - DependencyIndexes: file_version_proto_depIdxs, - MessageInfos: file_version_proto_msgTypes, - }.Build() - File_version_proto = out.File - file_version_proto_rawDesc = nil - file_version_proto_goTypes = nil - file_version_proto_depIdxs = nil +var fileDescriptor_7d2c07d79758f814 = []byte{ + // 119 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2d, 0x4b, 0x2d, 0x2a, + 0xce, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x87, 0x72, 0x95, 0x1c, 0xb8, + 0xf8, 0xc2, 0x20, 0x4c, 0xdf, 0xd4, 0xe2, 0xe2, 0xc4, 0xf4, 0x54, 0x21, 0x09, 0x2e, 0x98, 0xa4, + 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10, 0x8c, 0x2b, 0x24, 0xc2, 0xc5, 0x9a, 0x54, 0x9a, 0x99, + 0x93, 0x22, 0xc1, 0x04, 0x16, 0x87, 0x70, 0x8c, 0x3c, 0xb8, 0xd8, 0xa1, 0x26, 0x08, 0xd9, 0x22, + 0x98, 0xe2, 0x7a, 0x30, 0x0b, 0x51, 0x8d, 0x97, 0xc2, 0x25, 0xa1, 0xc4, 0xe0, 0xc4, 0x1d, 0xc5, + 0xa9, 0x67, 0x0d, 0x95, 0x4d, 0x62, 0x03, 0x3b, 0xd4, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x82, + 0x64, 0x2d, 0x9d, 0xb9, 0x00, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 // VersionClient is the client API for Version service. // @@ -182,10 +105,10 @@ type VersionClient interface { } type versionClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewVersionClient(cc grpc.ClientConnInterface) VersionClient { +func NewVersionClient(cc *grpc.ClientConn) VersionClient { return &versionClient{cc} } @@ -207,7 +130,7 @@ type VersionServer interface { type UnimplementedVersionServer struct { } -func (*UnimplementedVersionServer) Version(context.Context, *VersionMessage) (*VersionMessage, error) { +func (*UnimplementedVersionServer) Version(ctx context.Context, req *VersionMessage) (*VersionMessage, error) { return nil, status.Errorf(codes.Unimplemented, "method Version not implemented") }