diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 45c071d..6494926 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,7 @@ updates: - package-ecosystem: "gomod" # See documentation for possible values directory: "/" # Location of package manifests schedule: - interval: "daily" + interval: "weekly" reviewers: - "yusank" assignees: diff --git a/Makefile b/Makefile index a24202f..ee27903 100644 --- a/Makefile +++ b/Makefile @@ -59,8 +59,10 @@ tools-install: ## Install tools. .PHONY: buf buf: ## run buf generate command. @printf $(COLOR) "Generating buf code..." + @echo $(NEWLINE) buf generate @printf $(COLOR) "Done." + @echo $(NEWLINE) ################################################## # General # diff --git a/config/registry/v1/registry.pb.go b/config/registry/v1/registry.pb.go index b24b160..d1a290c 100644 --- a/config/registry/v1/registry.pb.go +++ b/config/registry/v1/registry.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: config/registry/v1/registry.proto @@ -175,6 +175,7 @@ type Registry struct { ConfigCenter *ConfigCenterInfo `protobuf:"bytes,1,opt,name=config_center,json=configCenter,proto3" json:"config_center,omitempty"` // Types that are assignable to Reg: + // // *Registry_Consul // *Registry_Etcd Reg isRegistry_Reg `protobuf_oneof:"reg"` diff --git a/config/registry/v1/registry.pb.validate.go b/config/registry/v1/registry.pb.validate.go index 97ecd20..acc2b0a 100644 --- a/config/registry/v1/registry.pb.validate.go +++ b/config/registry/v1/registry.pb.validate.go @@ -461,9 +461,18 @@ func (m *Registry) validate(all bool) error { } } - switch m.Reg.(type) { - + switch v := m.Reg.(type) { case *Registry_Consul: + if v == nil { + err := RegistryValidationError{ + field: "Reg", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } if all { switch v := interface{}(m.GetConsul()).(type) { @@ -495,6 +504,16 @@ func (m *Registry) validate(all bool) error { } case *Registry_Etcd: + if v == nil { + err := RegistryValidationError{ + field: "Reg", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } if all { switch v := interface{}(m.GetEtcd()).(type) { @@ -525,6 +544,8 @@ func (m *Registry) validate(all bool) error { } } + default: + _ = v // ensures v is used } if len(errors) > 0 { diff --git a/config/v1/config.pb.go b/config/v1/config.pb.go index 23cda00..75aa51a 100644 --- a/config/v1/config.pb.go +++ b/config/v1/config.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: config/v1/config.proto @@ -162,7 +162,6 @@ type Service struct { Redis *Redis `protobuf:"bytes,7,opt,name=redis,proto3" json:"redis,omitempty"` Mq *MQ `protobuf:"bytes,8,opt,name=mq,proto3" json:"mq,omitempty"` Mysql *MySQL `protobuf:"bytes,9,opt,name=mysql,proto3" json:"mysql,omitempty"` - HBase *HBase `protobuf:"bytes,10,opt,name=hBase,proto3" json:"hBase,omitempty"` // services name GatewayService string `protobuf:"bytes,11,opt,name=gatewayService,proto3" json:"gatewayService,omitempty"` UserService string `protobuf:"bytes,12,opt,name=userService,proto3" json:"userService,omitempty"` @@ -267,13 +266,6 @@ func (x *Service) GetMysql() *MySQL { return nil } -func (x *Service) GetHBase() *HBase { - if x != nil { - return x.HBase - } - return nil -} - func (x *Service) GetGatewayService() string { if x != nil { return x.GatewayService @@ -628,53 +620,6 @@ func (x *MySQL) GetOpenTimeout() *durationpb.Duration { return nil } -type HBase struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` // add more -} - -func (x *HBase) Reset() { - *x = HBase{} - if protoimpl.UnsafeEnabled { - mi := &file_config_v1_config_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *HBase) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*HBase) ProtoMessage() {} - -func (x *HBase) ProtoReflect() protoreflect.Message { - mi := &file_config_v1_config_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) -} - -// Deprecated: Use HBase.ProtoReflect.Descriptor instead. -func (*HBase) Descriptor() ([]byte, []int) { - return file_config_v1_config_proto_rawDescGZIP(), []int{6} -} - -func (x *HBase) GetAddr() string { - if x != nil { - return x.Addr - } - return "" -} - var File_config_v1_config_proto protoreflect.FileDescriptor var file_config_v1_config_proto_rawDesc = []byte{ @@ -694,7 +639,7 @@ var file_config_v1_config_proto_rawDesc = []byte{ 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11, 0xfa, 0x42, 0x0e, 0xaa, 0x01, 0x0b, 0x22, 0x02, 0x08, 0x0a, 0x32, 0x05, 0x10, 0x80, 0xad, 0xe2, 0x04, 0x52, 0x07, 0x74, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x99, 0x06, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xed, 0x05, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x34, 0xfa, 0x42, 0x31, 0x72, 0x2f, 0x32, 0x2d, 0x5e, 0x67, 0x6f, 0x69, 0x6d, 0x5c, 0x2e, 0x28, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x7c, 0x77, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x7c, 0x61, @@ -723,87 +668,83 @@ var file_config_v1_config_proto_rawDesc = []byte{ 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x51, 0x52, 0x02, 0x6d, 0x71, 0x12, 0x2a, 0x0a, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x79, - 0x53, 0x51, 0x4c, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x2a, 0x0a, 0x05, 0x68, 0x42, - 0x61, 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x42, 0x61, 0x73, 0x65, 0x52, - 0x05, 0x68, 0x42, 0x61, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x0e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, - 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x75, 0x73, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x75, 0x73, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x65, - 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, 0x6f, - 0x72, 0x6b, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x73, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x73, 0x67, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x57, 0x6f, 0x72, 0x6b, 0x65, - 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x73, 0x67, 0x57, 0x6f, 0x72, 0x6b, - 0x65, 0x72, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, - 0x07, 0x0a, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x67, 0x72, 0x70, - 0x63, 0x22, 0x8f, 0x01, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x1e, 0x0a, 0x08, 0x6c, 0x6f, 0x67, - 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6c, - 0x6f, 0x67, 0x50, 0x61, 0x74, 0x68, 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x05, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x42, 0x08, - 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, - 0x25, 0x0a, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x43, - 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x70, - 0x61, 0x74, 0x68, 0x22, 0x9c, 0x02, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x12, 0x0a, - 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, - 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1b, 0x0a, - 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x08, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x6e, 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x69, - 0x6e, 0x5f, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x73, - 0x12, 0x4f, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x11, 0xfa, 0x42, 0x0e, 0xaa, 0x01, 0x0b, 0x22, 0x02, 0x08, 0x0a, 0x32, 0x05, 0x10, - 0x80, 0xad, 0xe2, 0x04, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x12, 0x4f, 0x0a, 0x0c, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x42, 0x11, 0xfa, 0x42, 0x0e, 0xaa, 0x01, 0x0b, 0x22, 0x02, 0x08, 0x0a, 0x32, 0x05, - 0x10, 0x80, 0xad, 0xe2, 0x04, 0x52, 0x0b, 0x69, 0x64, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x22, 0x35, 0x0a, 0x02, 0x4d, 0x51, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1b, 0x0a, 0x09, - 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x74, 0x72, 0x79, 0x22, 0xc7, 0x02, 0x0a, 0x05, 0x4d, 0x79, - 0x53, 0x51, 0x4c, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x64, 0x62, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x69, - 0x64, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0c, 0x6d, 0x61, 0x78, 0x49, 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, 0x73, 0x12, 0x24, 0x0a, - 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x4f, 0x70, 0x65, 0x6e, 0x43, 0x6f, - 0x6e, 0x6e, 0x73, 0x12, 0x4e, 0x0a, 0x0c, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0xfa, 0x42, 0x0d, 0xaa, 0x01, 0x0a, 0x22, 0x02, 0x08, 0x0a, - 0x32, 0x04, 0x10, 0xc0, 0x84, 0x3d, 0x52, 0x0b, 0x69, 0x64, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x12, 0x4e, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0xfa, 0x42, 0x0d, 0xaa, 0x01, 0x0a, 0x22, 0x02, 0x08, 0x0a, - 0x32, 0x04, 0x10, 0xc0, 0x84, 0x3d, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x6e, 0x54, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x22, 0x1b, 0x0a, 0x05, 0x48, 0x42, 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, - 0x2a, 0x3f, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, - 0x55, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x0b, - 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, - 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x41, 0x54, 0x41, 0x4c, 0x10, - 0x04, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x53, 0x51, 0x4c, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x26, 0x0a, 0x0e, 0x67, 0x61, + 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x67, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x75, 0x73, 0x68, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x75, 0x73, 0x68, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, + 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x74, 0x6f, + 0x72, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x73, 0x67, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x73, + 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x73, 0x67, 0x57, + 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x73, 0x67, + 0x57, 0x6f, 0x72, 0x6b, 0x65, 0x72, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x68, 0x74, 0x74, 0x70, 0x42, 0x07, 0x0a, 0x05, + 0x5f, 0x67, 0x72, 0x70, 0x63, 0x22, 0x8f, 0x01, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x1e, 0x0a, + 0x08, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x50, 0x61, 0x74, 0x68, 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, + 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x65, 0x76, + 0x65, 0x6c, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x6c, 0x65, + 0x76, 0x65, 0x6c, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x63, 0x6f, + 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6c, + 0x6f, 0x67, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x22, 0x9c, 0x02, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x6e, 0x73, 0x12, 0x24, + 0x0a, 0x0e, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x69, 0x6e, 0x49, 0x64, 0x6c, 0x65, 0x43, + 0x6f, 0x6e, 0x6e, 0x73, 0x12, 0x4f, 0x0a, 0x0c, 0x64, 0x69, 0x61, 0x6c, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11, 0xfa, 0x42, 0x0e, 0xaa, 0x01, 0x0b, 0x22, 0x02, 0x08, + 0x0a, 0x32, 0x05, 0x10, 0x80, 0xad, 0xe2, 0x04, 0x52, 0x0b, 0x64, 0x69, 0x61, 0x6c, 0x54, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x4f, 0x0a, 0x0c, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11, 0xfa, 0x42, 0x0e, 0xaa, 0x01, 0x0b, 0x22, 0x02, + 0x08, 0x0a, 0x32, 0x05, 0x10, 0x80, 0xad, 0xe2, 0x04, 0x52, 0x0b, 0x69, 0x64, 0x6c, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x35, 0x0a, 0x02, 0x4d, 0x51, 0x12, 0x12, 0x0a, 0x04, + 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, + 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x65, 0x74, 0x72, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x08, 0x6d, 0x61, 0x78, 0x52, 0x65, 0x74, 0x72, 0x79, 0x22, 0xc7, 0x02, + 0x0a, 0x05, 0x4d, 0x79, 0x53, 0x51, 0x4c, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x64, + 0x62, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x64, 0x62, 0x12, 0x24, 0x0a, 0x0e, 0x6d, + 0x61, 0x78, 0x5f, 0x69, 0x64, 0x6c, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x73, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x49, 0x64, 0x6c, 0x65, 0x43, 0x6f, 0x6e, 0x6e, + 0x73, 0x12, 0x24, 0x0a, 0x0e, 0x6d, 0x61, 0x78, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x63, 0x6f, + 0x6e, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x6d, 0x61, 0x78, 0x4f, 0x70, + 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x6e, 0x73, 0x12, 0x4e, 0x0a, 0x0c, 0x69, 0x64, 0x6c, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0xfa, 0x42, 0x0d, 0xaa, 0x01, 0x0a, + 0x22, 0x02, 0x08, 0x0a, 0x32, 0x04, 0x10, 0xc0, 0x84, 0x3d, 0x52, 0x0b, 0x69, 0x64, 0x6c, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x4e, 0x0a, 0x0c, 0x6f, 0x70, 0x65, 0x6e, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x10, 0xfa, 0x42, 0x0d, 0xaa, 0x01, 0x0a, + 0x22, 0x02, 0x08, 0x0a, 0x32, 0x04, 0x10, 0xc0, 0x84, 0x3d, 0x52, 0x0b, 0x6f, 0x70, 0x65, 0x6e, + 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x2a, 0x3f, 0x0a, 0x05, 0x4c, 0x65, 0x76, 0x65, 0x6c, + 0x12, 0x09, 0x0a, 0x05, 0x44, 0x45, 0x42, 0x55, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x49, + 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x57, 0x41, 0x52, 0x4e, 0x49, 0x4e, 0x47, + 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x03, 0x12, 0x09, 0x0a, + 0x05, 0x46, 0x41, 0x54, 0x41, 0x4c, 0x10, 0x04, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -819,7 +760,7 @@ func file_config_v1_config_proto_rawDescGZIP() []byte { } var file_config_v1_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_config_v1_config_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_config_v1_config_proto_goTypes = []interface{}{ (Level)(0), // 0: api.config.v1.Level (*Server)(nil), // 1: api.config.v1.Server @@ -828,30 +769,28 @@ var file_config_v1_config_proto_goTypes = []interface{}{ (*Redis)(nil), // 4: api.config.v1.Redis (*MQ)(nil), // 5: api.config.v1.MQ (*MySQL)(nil), // 6: api.config.v1.MySQL - (*HBase)(nil), // 7: api.config.v1.HBase - nil, // 8: api.config.v1.Service.MetadataEntry - (*durationpb.Duration)(nil), // 9: google.protobuf.Duration + nil, // 7: api.config.v1.Service.MetadataEntry + (*durationpb.Duration)(nil), // 8: google.protobuf.Duration } var file_config_v1_config_proto_depIdxs = []int32{ - 9, // 0: api.config.v1.Server.timeout:type_name -> google.protobuf.Duration + 8, // 0: api.config.v1.Server.timeout:type_name -> google.protobuf.Duration 1, // 1: api.config.v1.Service.http:type_name -> api.config.v1.Server 1, // 2: api.config.v1.Service.grpc:type_name -> api.config.v1.Server 3, // 3: api.config.v1.Service.log:type_name -> api.config.v1.Log - 8, // 4: api.config.v1.Service.metadata:type_name -> api.config.v1.Service.MetadataEntry + 7, // 4: api.config.v1.Service.metadata:type_name -> api.config.v1.Service.MetadataEntry 4, // 5: api.config.v1.Service.redis:type_name -> api.config.v1.Redis 5, // 6: api.config.v1.Service.mq:type_name -> api.config.v1.MQ 6, // 7: api.config.v1.Service.mysql:type_name -> api.config.v1.MySQL - 7, // 8: api.config.v1.Service.hBase:type_name -> api.config.v1.HBase - 0, // 9: api.config.v1.Log.level:type_name -> api.config.v1.Level - 9, // 10: api.config.v1.Redis.dial_timeout:type_name -> google.protobuf.Duration - 9, // 11: api.config.v1.Redis.idle_timeout:type_name -> google.protobuf.Duration - 9, // 12: api.config.v1.MySQL.idle_timeout:type_name -> google.protobuf.Duration - 9, // 13: api.config.v1.MySQL.open_timeout:type_name -> google.protobuf.Duration - 14, // [14:14] is the sub-list for method output_type - 14, // [14:14] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 0, // 8: api.config.v1.Log.level:type_name -> api.config.v1.Level + 8, // 9: api.config.v1.Redis.dial_timeout:type_name -> google.protobuf.Duration + 8, // 10: api.config.v1.Redis.idle_timeout:type_name -> google.protobuf.Duration + 8, // 11: api.config.v1.MySQL.idle_timeout:type_name -> google.protobuf.Duration + 8, // 12: api.config.v1.MySQL.open_timeout:type_name -> google.protobuf.Duration + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_config_v1_config_proto_init() } @@ -932,18 +871,6 @@ func file_config_v1_config_proto_init() { return nil } } - file_config_v1_config_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HBase); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } file_config_v1_config_proto_msgTypes[1].OneofWrappers = []interface{}{} file_config_v1_config_proto_msgTypes[2].OneofWrappers = []interface{}{} @@ -953,7 +880,7 @@ func file_config_v1_config_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_config_v1_config_proto_rawDesc, NumEnums: 1, - NumMessages: 8, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/config/v1/config.pb.validate.go b/config/v1/config.pb.validate.go index edc8447..faf61f4 100644 --- a/config/v1/config.pb.validate.go +++ b/config/v1/config.pb.validate.go @@ -353,35 +353,6 @@ func (m *Service) validate(all bool) error { } } - if all { - switch v := interface{}(m.GetHBase()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ServiceValidationError{ - field: "HBase", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ServiceValidationError{ - field: "HBase", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetHBase()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ServiceValidationError{ - field: "HBase", - reason: "embedded message failed validation", - cause: err, - } - } - } - // no validation rules for GatewayService // no validation rules for UserService @@ -1095,103 +1066,3 @@ var _ interface { Cause() error ErrorName() string } = MySQLValidationError{} - -// Validate checks the field values on HBase with the rules defined in the -// proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *HBase) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on HBase with the rules defined in the -// proto definition for this message. If any rules are violated, the result is -// a list of violation errors wrapped in HBaseMultiError, or nil if none found. -func (m *HBase) ValidateAll() error { - return m.validate(true) -} - -func (m *HBase) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Addr - - if len(errors) > 0 { - return HBaseMultiError(errors) - } - - return nil -} - -// HBaseMultiError is an error wrapping multiple validation errors returned by -// HBase.ValidateAll() if the designated constraints aren't met. -type HBaseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m HBaseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m HBaseMultiError) AllErrors() []error { return m } - -// HBaseValidationError is the validation error returned by HBase.Validate if -// the designated constraints aren't met. -type HBaseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e HBaseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e HBaseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e HBaseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e HBaseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e HBaseValidationError) ErrorName() string { return "HBaseValidationError" } - -// Error satisfies the builtin error interface -func (e HBaseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sHBase.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = HBaseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = HBaseValidationError{} diff --git a/config/v1/config.proto b/config/v1/config.proto index 9a0e4cd..1413555 100644 --- a/config/v1/config.proto +++ b/config/v1/config.proto @@ -52,7 +52,6 @@ message Service { Redis redis = 7; MQ mq = 8; MySQL mysql = 9; - HBase hBase = 10; // services name string gatewayService = 11; string userService = 12; @@ -135,9 +134,4 @@ message MySQL { seconds: 10 } }]; -} - -message HBase { - string addr = 1; - // add more -} +} \ No newline at end of file diff --git a/errors/errors.ext.go b/errors/errors.ext.go new file mode 100644 index 0000000..01f3e4c --- /dev/null +++ b/errors/errors.ext.go @@ -0,0 +1,94 @@ +// This file Written Manually. + +package errors + +import ( + "fmt" +) + +/* + * Define BaseResponse + */ + +var _ error = &Error{} + +func NewErrorWithCode(code ErrorCode) *Error { + return &Error{ + ErrorCode: code, + Reason: code.String(), + } +} + +func ErrorOK() *Error { + return NewErrorWithCode(ErrorCode_OK) +} + +func NewErrorWithError(err error) *Error { + // check err is BaseResponse + if br, ok := err.(*Error); ok { + return br + } + + return &Error{ + ErrorCode: ErrorCode_InternalError, + Reason: ErrorCode_InternalError.String(), + Message: err.Error(), + } +} + +// Error is implement of error interface. +func (x *Error) Error() string { + return fmt.Sprintf("ErrorCode: %d, Reason: %s, Message: %s", x.ErrorCode, x.Reason, x.Message) +} + +// Err returns as error. +func (x *Error) Err() error { + if x.ErrorCode == ErrorCode_OK { + return nil + } + + return x +} + +func (x *Error) Success() bool { + return x.ErrorCode == ErrorCode_OK +} + +func (x *Error) WithMessage(msg string) *Error { + x.Message = msg + return x +} + +func (x *Error) WithError(err error) *Error { + x.Message = err.Error() + return x +} + +/* + * ErrorCode As Error. + */ + +func (x ErrorCode) Error() string { + return NewErrorWithCode(x).Error() +} + +func (x ErrorCode) Err() error { + if x == ErrorCode_OK { + return nil + } + + return NewErrorWithCode(x) +} + +// Err2 returns as Error we defined. +func (x ErrorCode) Err2() *Error { + return NewErrorWithCode(x) +} + +func (x ErrorCode) WithMessage(msg string) *Error { + return NewErrorWithCode(x).WithMessage(msg) +} + +func (x ErrorCode) WithError(err error) *Error { + return NewErrorWithCode(x).WithError(err) +} diff --git a/errors/errors.pb.go b/errors/errors.pb.go new file mode 100644 index 0000000..f7d9624 --- /dev/null +++ b/errors/errors.pb.go @@ -0,0 +1,299 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc (unknown) +// source: errors/errors.proto + +package errors + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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) +) + +type ErrorCode int32 + +const ( + ErrorCode_OK ErrorCode = 0 + // common error codes + ErrorCode_InternalError ErrorCode = 10001 + ErrorCode_InvalidParams ErrorCode = 10002 + ErrorCode_DBError ErrorCode = 10003 + ErrorCode_CacheError ErrorCode = 10004 + // user error codes + ErrorCode_UserNotExist ErrorCode = 20001 + ErrorCode_UserExist ErrorCode = 20002 + ErrorCode_InvalidUsernameOrPassword ErrorCode = 20003 + // relation error codes + ErrorCode_RelationNotExist ErrorCode = 30001 + ErrorCode_RelationExist ErrorCode = 30002 + ErrorCode_InvalidUpdateRelationAction ErrorCode = 30003 + // friend request error codes + ErrorCode_FriendRequestNotExist ErrorCode = 31001 + ErrorCode_FriendRequestStatusError ErrorCode = 31002 + // push server error codes + ErrorCode_UserNotOnline ErrorCode = 40001 + // group error codes + ErrorCode_GroupNotExist ErrorCode = 50001 + ErrorCode_GroupExist ErrorCode = 50002 + ErrorCode_NotGroupMember ErrorCode = 50003 + ErrorCode_NotGroupOwner ErrorCode = 50004 + ErrorCode_GroupLimitExceed ErrorCode = 50005 +) + +// Enum value maps for ErrorCode. +var ( + ErrorCode_name = map[int32]string{ + 0: "OK", + 10001: "InternalError", + 10002: "InvalidParams", + 10003: "DBError", + 10004: "CacheError", + 20001: "UserNotExist", + 20002: "UserExist", + 20003: "InvalidUsernameOrPassword", + 30001: "RelationNotExist", + 30002: "RelationExist", + 30003: "InvalidUpdateRelationAction", + 31001: "FriendRequestNotExist", + 31002: "FriendRequestStatusError", + 40001: "UserNotOnline", + 50001: "GroupNotExist", + 50002: "GroupExist", + 50003: "NotGroupMember", + 50004: "NotGroupOwner", + 50005: "GroupLimitExceed", + } + ErrorCode_value = map[string]int32{ + "OK": 0, + "InternalError": 10001, + "InvalidParams": 10002, + "DBError": 10003, + "CacheError": 10004, + "UserNotExist": 20001, + "UserExist": 20002, + "InvalidUsernameOrPassword": 20003, + "RelationNotExist": 30001, + "RelationExist": 30002, + "InvalidUpdateRelationAction": 30003, + "FriendRequestNotExist": 31001, + "FriendRequestStatusError": 31002, + "UserNotOnline": 40001, + "GroupNotExist": 50001, + "GroupExist": 50002, + "NotGroupMember": 50003, + "NotGroupOwner": 50004, + "GroupLimitExceed": 50005, + } +) + +func (x ErrorCode) Enum() *ErrorCode { + p := new(ErrorCode) + *p = x + return p +} + +func (x ErrorCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ErrorCode) Descriptor() protoreflect.EnumDescriptor { + return file_errors_errors_proto_enumTypes[0].Descriptor() +} + +func (ErrorCode) Type() protoreflect.EnumType { + return &file_errors_errors_proto_enumTypes[0] +} + +func (x ErrorCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ErrorCode.Descriptor instead. +func (ErrorCode) EnumDescriptor() ([]byte, []int) { + return file_errors_errors_proto_rawDescGZIP(), []int{0} +} + +// Error use as define error code and message. +type Error struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ErrorCode ErrorCode `protobuf:"varint,1,opt,name=error_code,json=errorCode,proto3,enum=api.errors.ErrorCode" json:"error_code,omitempty"` + Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *Error) Reset() { + *x = Error{} + if protoimpl.UnsafeEnabled { + mi := &file_errors_errors_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Error) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Error) ProtoMessage() {} + +func (x *Error) ProtoReflect() protoreflect.Message { + mi := &file_errors_errors_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) +} + +// Deprecated: Use Error.ProtoReflect.Descriptor instead. +func (*Error) Descriptor() ([]byte, []int) { + return file_errors_errors_proto_rawDescGZIP(), []int{0} +} + +func (x *Error) GetErrorCode() ErrorCode { + if x != nil { + return x.ErrorCode + } + return ErrorCode_OK +} + +func (x *Error) GetReason() string { + if x != nil { + return x.Reason + } + return "" +} + +func (x *Error) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_errors_errors_proto protoreflect.FileDescriptor + +var file_errors_errors_proto_rawDesc = []byte{ + 0x0a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x73, 0x22, 0x6f, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x34, 0x0a, 0x0a, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x2a, 0xac, 0x03, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, + 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0d, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x91, 0x4e, 0x12, 0x12, 0x0a, 0x0d, + 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x10, 0x92, 0x4e, + 0x12, 0x0c, 0x0a, 0x07, 0x44, 0x42, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x93, 0x4e, 0x12, 0x0f, + 0x0a, 0x0a, 0x43, 0x61, 0x63, 0x68, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x94, 0x4e, 0x12, + 0x12, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, + 0xa1, 0x9c, 0x01, 0x12, 0x0f, 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, + 0x10, 0xa2, 0x9c, 0x01, 0x12, 0x1f, 0x0a, 0x19, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x4f, 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, + 0x64, 0x10, 0xa3, 0x9c, 0x01, 0x12, 0x16, 0x0a, 0x10, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xb1, 0xea, 0x01, 0x12, 0x13, 0x0a, + 0x0d, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xb2, + 0xea, 0x01, 0x12, 0x21, 0x0a, 0x1b, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x10, 0xb3, 0xea, 0x01, 0x12, 0x1b, 0x0a, 0x15, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0x99, + 0xf2, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x9a, + 0xf2, 0x01, 0x12, 0x13, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x4f, 0x6e, 0x6c, + 0x69, 0x6e, 0x65, 0x10, 0xc1, 0xb8, 0x02, 0x12, 0x13, 0x0a, 0x0d, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xd1, 0x86, 0x03, 0x12, 0x10, 0x0a, 0x0a, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xd2, 0x86, 0x03, 0x12, 0x14, + 0x0a, 0x0e, 0x4e, 0x6f, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, + 0x10, 0xd3, 0x86, 0x03, 0x12, 0x13, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x10, 0xd4, 0x86, 0x03, 0x12, 0x16, 0x0a, 0x10, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x45, 0x78, 0x63, 0x65, 0x65, 0x64, 0x10, 0xd5, 0x86, + 0x03, 0x42, 0x1f, 0x5a, 0x1d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_errors_errors_proto_rawDescOnce sync.Once + file_errors_errors_proto_rawDescData = file_errors_errors_proto_rawDesc +) + +func file_errors_errors_proto_rawDescGZIP() []byte { + file_errors_errors_proto_rawDescOnce.Do(func() { + file_errors_errors_proto_rawDescData = protoimpl.X.CompressGZIP(file_errors_errors_proto_rawDescData) + }) + return file_errors_errors_proto_rawDescData +} + +var file_errors_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_errors_errors_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_errors_errors_proto_goTypes = []interface{}{ + (ErrorCode)(0), // 0: api.errors.ErrorCode + (*Error)(nil), // 1: api.errors.Error +} +var file_errors_errors_proto_depIdxs = []int32{ + 0, // 0: api.errors.Error.error_code:type_name -> api.errors.ErrorCode + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_errors_errors_proto_init() } +func file_errors_errors_proto_init() { + if File_errors_errors_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_errors_errors_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Error); 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_errors_errors_proto_rawDesc, + NumEnums: 1, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_errors_errors_proto_goTypes, + DependencyIndexes: file_errors_errors_proto_depIdxs, + EnumInfos: file_errors_errors_proto_enumTypes, + MessageInfos: file_errors_errors_proto_msgTypes, + }.Build() + File_errors_errors_proto = out.File + file_errors_errors_proto_rawDesc = nil + file_errors_errors_proto_goTypes = nil + file_errors_errors_proto_depIdxs = nil +} diff --git a/errors/errors.pb.validate.go b/errors/errors.pb.validate.go new file mode 100644 index 0000000..6fc30f9 --- /dev/null +++ b/errors/errors.pb.validate.go @@ -0,0 +1,140 @@ +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: errors/errors.proto + +package errors + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on Error with the rules defined in the +// proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *Error) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on Error with the rules defined in the +// proto definition for this message. If any rules are violated, the result is +// a list of violation errors wrapped in ErrorMultiError, or nil if none found. +func (m *Error) ValidateAll() error { + return m.validate(true) +} + +func (m *Error) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for ErrorCode + + // no validation rules for Reason + + // no validation rules for Message + + if len(errors) > 0 { + return ErrorMultiError(errors) + } + + return nil +} + +// ErrorMultiError is an error wrapping multiple validation errors returned by +// Error.ValidateAll() if the designated constraints aren't met. +type ErrorMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ErrorMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ErrorMultiError) AllErrors() []error { return m } + +// ErrorValidationError is the validation error returned by Error.Validate if +// the designated constraints aren't met. +type ErrorValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ErrorValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ErrorValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ErrorValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ErrorValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ErrorValidationError) ErrorName() string { return "ErrorValidationError" } + +// Error satisfies the builtin error interface +func (e ErrorValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sError.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ErrorValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ErrorValidationError{} diff --git a/transport/response/response.proto b/errors/errors.proto similarity index 77% rename from transport/response/response.proto rename to errors/errors.proto index 65e8078..aabe667 100644 --- a/transport/response/response.proto +++ b/errors/errors.proto @@ -1,10 +1,10 @@ syntax = "proto3"; -package api.transport.response; +package api.errors; -option go_package = "github.com/go-goim/api/transport/response"; +option go_package = "github.com/go-goim/api/errors"; -enum Code { +enum ErrorCode { OK = 0; // common error codes @@ -38,9 +38,9 @@ enum Code { GroupLimitExceed = 50005; } -// BaseResponse use as define response code and message -message BaseResponse { - Code code = 1; +// Error use as define error code and message. +message Error { + ErrorCode error_code = 1; string reason = 2; string message = 3; -} +} \ No newline at end of file diff --git a/go.mod b/go.mod index 130bd10..72dc051 100644 --- a/go.mod +++ b/go.mod @@ -3,19 +3,21 @@ module github.com/go-goim/api go 1.18 require ( - github.com/envoyproxy/protoc-gen-validate v0.6.7 - github.com/stretchr/testify v1.8.0 - google.golang.org/grpc v1.47.0 - google.golang.org/protobuf v1.28.0 + github.com/envoyproxy/protoc-gen-validate v1.0.4 + github.com/stretchr/testify v1.9.0 + google.golang.org/grpc v1.64.0 + google.golang.org/protobuf v1.34.1 ) require ( github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect - golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 // indirect - golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect + github.com/rogpeppe/go-internal v1.8.0 // indirect + golang.org/x/net v0.22.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index dec3e9e..a58c186 100644 --- a/go.sum +++ b/go.sum @@ -1,173 +1,41 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.7 h1:qcZcULcd/abmQg6dwigimCNEyi4gg31M/xaciQlDml8= -github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912 h1:uCLL3g5wH2xjxVREVuAbP9JM5PPKjRbXKRa6IBjkzmU= -golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -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.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= -google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= +golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= +google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= +google.golang.org/grpc v1.64.0 h1:KH3VH9y/MgNQg1dE7b3XfVK0GsPSIzJwdF617gUSbvY= +google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/message/v1/message.db.go b/message/v1/message.db.go new file mode 100644 index 0000000..85328c2 --- /dev/null +++ b/message/v1/message.db.go @@ -0,0 +1,49 @@ +package v1 + +import ( + "github.com/go-goim/api/types" + "google.golang.org/protobuf/types/known/timestamppb" + "time" +) + +func (x *StorageMessage) TableName() string { + return "message_history" // TODO: use config +} + +type StorageMessageDBContent struct { + Content string `json:"content"` + ContentType MessageContentType `json:"content_type"` +} + +type StorageMessageDB struct { + MsgID types.ID `gorm:"column:id;primaryKey"` + SessionID string `gorm:"column:session_id"` + SessionType SessionType `gorm:"column:session_type,type:tinyint"` + FromUID types.ID `gorm:"column:from_uid,type:bigint"` + ToUID types.ID `gorm:"column:to_uid,type:bigint"` + Content *StorageMessageDBContent `gorm:"column:content, type:bytes, serializer:json"` + CreateTime int64 `gorm:"column:create_time,type:int"` +} + +func (s *StorageMessageDB) ToProto() *StorageMessage { + return &StorageMessage{ + MsgID: s.MsgID.Int64(), + SessionID: s.SessionID, + SessionType: s.SessionType, + FromID: s.FromUID.Int64(), + ToID: s.ToUID.Int64(), + Content: &StorageMessage_Content{Content: s.Content.Content, ContentType: s.Content.ContentType}, + CreateTime: timestamppb.New(time.UnixMilli(s.CreateTime)), + } +} + +func (s *StorageMessageDB) FromProto(m *StorageMessage) *StorageMessageDB { + s.MsgID = types.ID(m.MsgID) + s.SessionID = m.SessionID + s.SessionType = m.SessionType + s.FromUID = types.ID(m.FromID) + s.ToUID = types.ID(m.ToID) + s.Content = &StorageMessageDBContent{Content: m.Content.Content, ContentType: m.Content.ContentType} + s.CreateTime = m.CreateTime.AsTime().UnixMilli() + return s +} diff --git a/message/v1/message.pb.go b/message/v1/message.pb.go index b7589a5..1f62ef6 100644 --- a/message/v1/message.pb.go +++ b/message/v1/message.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: message/v1/message.proto @@ -8,10 +8,10 @@ package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" - response "github.com/go-goim/api/transport/response" - v1 "github.com/go-goim/api/user/session/v1" + errors "github.com/go-goim/api/errors" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -72,15 +72,116 @@ func (MessageContentType) EnumDescriptor() ([]byte, []int) { return file_message_v1_message_proto_rawDescGZIP(), []int{0} } +// define session type and status +type SessionType int32 + +const ( + SessionType_SingleChat SessionType = 0 + SessionType_GroupChat SessionType = 1 + // broadcast actually not a standard chat type, but we still use it here + SessionType_Broadcast SessionType = 2 + // Channel is for user subscribed channel msgs + SessionType_Channel SessionType = 3 // 255 at most +) + +// Enum value maps for SessionType. +var ( + SessionType_name = map[int32]string{ + 0: "SingleChat", + 1: "GroupChat", + 2: "Broadcast", + 3: "Channel", + } + SessionType_value = map[string]int32{ + "SingleChat": 0, + "GroupChat": 1, + "Broadcast": 2, + "Channel": 3, + } +) + +func (x SessionType) Enum() *SessionType { + p := new(SessionType) + *p = x + return p +} + +func (x SessionType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SessionType) Descriptor() protoreflect.EnumDescriptor { + return file_message_v1_message_proto_enumTypes[1].Descriptor() +} + +func (SessionType) Type() protoreflect.EnumType { + return &file_message_v1_message_proto_enumTypes[1] +} + +func (x SessionType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SessionType.Descriptor instead. +func (SessionType) EnumDescriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{1} +} + +type MessageStatus int32 + +const ( + MessageStatus_Normal MessageStatus = 0 + MessageStatus_Deleted MessageStatus = 1 +) + +// Enum value maps for MessageStatus. +var ( + MessageStatus_name = map[int32]string{ + 0: "Normal", + 1: "Deleted", + } + MessageStatus_value = map[string]int32{ + "Normal": 0, + "Deleted": 1, + } +) + +func (x MessageStatus) Enum() *MessageStatus { + p := new(MessageStatus) + *p = x + return p +} + +func (x MessageStatus) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (MessageStatus) Descriptor() protoreflect.EnumDescriptor { + return file_message_v1_message_proto_enumTypes[2].Descriptor() +} + +func (MessageStatus) Type() protoreflect.EnumType { + return &file_message_v1_message_proto_enumTypes[2] +} + +func (x MessageStatus) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use MessageStatus.Descriptor instead. +func (MessageStatus) EnumDescriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{2} +} + // SendMessageReq receive data from gateway type SendMessageReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` - To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` - SessionType v1.SessionType `protobuf:"varint,3,opt,name=session_type,json=sessionType,proto3,enum=api.user.session.v1.SessionType" json:"session_type,omitempty"` + From int64 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"` + To int64 `protobuf:"varint,2,opt,name=to,proto3" json:"to,omitempty"` + SessionType SessionType `protobuf:"varint,3,opt,name=session_type,json=sessionType,proto3,enum=api.message.v1.SessionType" json:"session_type,omitempty"` SessionId *string `protobuf:"bytes,4,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` ContentType MessageContentType `protobuf:"varint,5,opt,name=content_type,json=contentType,proto3,enum=api.message.v1.MessageContentType" json:"content_type,omitempty"` Content string `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"` @@ -118,25 +219,25 @@ func (*SendMessageReq) Descriptor() ([]byte, []int) { return file_message_v1_message_proto_rawDescGZIP(), []int{0} } -func (x *SendMessageReq) GetFrom() string { +func (x *SendMessageReq) GetFrom() int64 { if x != nil { return x.From } - return "" + return 0 } -func (x *SendMessageReq) GetTo() string { +func (x *SendMessageReq) GetTo() int64 { if x != nil { return x.To } - return "" + return 0 } -func (x *SendMessageReq) GetSessionType() v1.SessionType { +func (x *SendMessageReq) GetSessionType() SessionType { if x != nil { return x.SessionType } - return v1.SessionType_SingleChat + return SessionType_SingleChat } func (x *SendMessageReq) GetSessionId() string { @@ -160,62 +261,6 @@ func (x *SendMessageReq) GetContent() string { return "" } -// SendMessageResp is response body for sendMessage -type SendMessageResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SessionId int64 `protobuf:"varint,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - MsgId int64 `protobuf:"varint,3,opt,name=msg_id,json=msgId,proto3" json:"msg_id,omitempty"` -} - -func (x *SendMessageResp) Reset() { - *x = SendMessageResp{} - if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SendMessageResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendMessageResp) ProtoMessage() {} - -func (x *SendMessageResp) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_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) -} - -// Deprecated: Use SendMessageResp.ProtoReflect.Descriptor instead. -func (*SendMessageResp) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{1} -} - -func (x *SendMessageResp) GetSessionId() int64 { - if x != nil { - return x.SessionId - } - return 0 -} - -func (x *SendMessageResp) GetMsgId() int64 { - if x != nil { - return x.MsgId - } - return 0 -} - // Message is definition of message type Message struct { state protoimpl.MessageState @@ -223,10 +268,10 @@ type Message struct { unknownFields protoimpl.UnknownFields MsgId int64 `protobuf:"varint,1,opt,name=msg_id,json=msgId,proto3" json:"msg_id,omitempty"` - From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` - To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` // to user id or group id - SessionType v1.SessionType `protobuf:"varint,4,opt,name=session_type,json=sessionType,proto3,enum=api.user.session.v1.SessionType" json:"session_type,omitempty"` - SessionId int64 `protobuf:"varint,5,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + From int64 `protobuf:"varint,2,opt,name=from,proto3" json:"from,omitempty"` + To int64 `protobuf:"varint,3,opt,name=to,proto3" json:"to,omitempty"` // user id or group id or room id etc. + SessionType SessionType `protobuf:"varint,4,opt,name=session_type,json=sessionType,proto3,enum=api.message.v1.SessionType" json:"session_type,omitempty"` + SessionId string `protobuf:"bytes,5,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` ContentType MessageContentType `protobuf:"varint,6,opt,name=content_type,json=contentType,proto3,enum=api.message.v1.MessageContentType" json:"content_type,omitempty"` Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"` CreateTime int64 `protobuf:"varint,8,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` @@ -235,7 +280,7 @@ type Message struct { func (x *Message) Reset() { *x = Message{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[2] + mi := &file_message_v1_message_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -248,7 +293,7 @@ func (x *Message) String() string { func (*Message) ProtoMessage() {} func (x *Message) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[2] + mi := &file_message_v1_message_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -261,7 +306,7 @@ func (x *Message) ProtoReflect() protoreflect.Message { // Deprecated: Use Message.ProtoReflect.Descriptor instead. func (*Message) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{2} + return file_message_v1_message_proto_rawDescGZIP(), []int{1} } func (x *Message) GetMsgId() int64 { @@ -271,32 +316,32 @@ func (x *Message) GetMsgId() int64 { return 0 } -func (x *Message) GetFrom() string { +func (x *Message) GetFrom() int64 { if x != nil { return x.From } - return "" + return 0 } -func (x *Message) GetTo() string { +func (x *Message) GetTo() int64 { if x != nil { return x.To } - return "" + return 0 } -func (x *Message) GetSessionType() v1.SessionType { +func (x *Message) GetSessionType() SessionType { if x != nil { return x.SessionType } - return v1.SessionType_SingleChat + return SessionType_SingleChat } -func (x *Message) GetSessionId() int64 { +func (x *Message) GetSessionId() string { if x != nil { return x.SessionId } - return 0 + return "" } func (x *Message) GetContentType() MessageContentType { @@ -328,13 +373,13 @@ type PushMessageReq struct { Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` // ToUsers is a list of user id who receive this message - ToUsers []string `protobuf:"bytes,2,rep,name=to_users,json=toUsers,proto3" json:"to_users,omitempty"` + ToUsers []int64 `protobuf:"varint,2,rep,packed,name=to_users,json=toUsers,proto3" json:"to_users,omitempty"` } func (x *PushMessageReq) Reset() { *x = PushMessageReq{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[3] + mi := &file_message_v1_message_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -347,7 +392,7 @@ func (x *PushMessageReq) String() string { func (*PushMessageReq) ProtoMessage() {} func (x *PushMessageReq) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[3] + mi := &file_message_v1_message_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -360,7 +405,7 @@ func (x *PushMessageReq) ProtoReflect() protoreflect.Message { // Deprecated: Use PushMessageReq.ProtoReflect.Descriptor instead. func (*PushMessageReq) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{3} + return file_message_v1_message_proto_rawDescGZIP(), []int{2} } func (x *PushMessageReq) GetMessage() *Message { @@ -370,7 +415,7 @@ func (x *PushMessageReq) GetMessage() *Message { return nil } -func (x *PushMessageReq) GetToUsers() []string { +func (x *PushMessageReq) GetToUsers() []int64 { if x != nil { return x.ToUsers } @@ -382,14 +427,14 @@ type PushMessageResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - FailedUsers []string `protobuf:"bytes,2,rep,name=failed_users,json=failedUsers,proto3" json:"failed_users,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + FailedUsers []int64 `protobuf:"varint,2,rep,packed,name=failed_users,json=failedUsers,proto3" json:"failed_users,omitempty"` } func (x *PushMessageResp) Reset() { *x = PushMessageResp{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[4] + mi := &file_message_v1_message_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -402,7 +447,7 @@ func (x *PushMessageResp) String() string { func (*PushMessageResp) ProtoMessage() {} func (x *PushMessageResp) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[4] + mi := &file_message_v1_message_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -415,17 +460,17 @@ func (x *PushMessageResp) ProtoReflect() protoreflect.Message { // Deprecated: Use PushMessageResp.ProtoReflect.Descriptor instead. func (*PushMessageResp) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{4} + return file_message_v1_message_proto_rawDescGZIP(), []int{3} } -func (x *PushMessageResp) GetResponse() *response.BaseResponse { +func (x *PushMessageResp) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } -func (x *PushMessageResp) GetFailedUsers() []string { +func (x *PushMessageResp) GetFailedUsers() []int64 { if x != nil { return x.FailedUsers } @@ -437,17 +482,17 @@ type QueryOfflineMessageReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - LastMsgId int64 `protobuf:"varint,2,opt,name=last_msg_id,json=lastMsgId,proto3" json:"last_msg_id,omitempty"` - OnlyCount bool `protobuf:"varint,3,opt,name=onlyCount,proto3" json:"onlyCount,omitempty"` - Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"` - PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + LastMsgId int64 `protobuf:"varint,2,opt,name=last_msg_id,json=lastMsgId,proto3" json:"last_msg_id,omitempty"` + OnlyCount bool `protobuf:"varint,3,opt,name=onlyCount,proto3" json:"onlyCount,omitempty"` + Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` } func (x *QueryOfflineMessageReq) Reset() { *x = QueryOfflineMessageReq{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[5] + mi := &file_message_v1_message_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -460,7 +505,7 @@ func (x *QueryOfflineMessageReq) String() string { func (*QueryOfflineMessageReq) ProtoMessage() {} func (x *QueryOfflineMessageReq) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[5] + mi := &file_message_v1_message_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -473,14 +518,14 @@ func (x *QueryOfflineMessageReq) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryOfflineMessageReq.ProtoReflect.Descriptor instead. func (*QueryOfflineMessageReq) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{5} + return file_message_v1_message_proto_rawDescGZIP(), []int{4} } -func (x *QueryOfflineMessageReq) GetUserId() string { +func (x *QueryOfflineMessageReq) GetUid() int64 { if x != nil { - return x.UserId + return x.Uid } - return "" + return 0 } func (x *QueryOfflineMessageReq) GetLastMsgId() int64 { @@ -516,15 +561,15 @@ type QueryOfflineMessageResp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` - Messages []*Message `protobuf:"bytes,3,rep,name=messages,proto3" json:"messages,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + Messages []*Message `protobuf:"bytes,3,rep,name=messages,proto3" json:"messages,omitempty"` } func (x *QueryOfflineMessageResp) Reset() { *x = QueryOfflineMessageResp{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[6] + mi := &file_message_v1_message_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -537,7 +582,7 @@ func (x *QueryOfflineMessageResp) String() string { func (*QueryOfflineMessageResp) ProtoMessage() {} func (x *QueryOfflineMessageResp) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[6] + mi := &file_message_v1_message_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -550,12 +595,12 @@ func (x *QueryOfflineMessageResp) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryOfflineMessageResp.ProtoReflect.Descriptor instead. func (*QueryOfflineMessageResp) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{6} + return file_message_v1_message_proto_rawDescGZIP(), []int{5} } -func (x *QueryOfflineMessageResp) GetResponse() *response.BaseResponse { +func (x *QueryOfflineMessageResp) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } @@ -574,211 +619,846 @@ func (x *QueryOfflineMessageResp) GetMessages() []*Message { return nil } -var File_message_v1_message_proto protoreflect.FileDescriptor +type ConfirmLastMsgIDReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields -var file_message_v1_message_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x61, 0x70, 0x69, 0x2e, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x21, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2f, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, - 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb5, 0x02, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x14, 0x52, - 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x17, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x14, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x43, - 0x0a, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, - 0x65, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, - 0x10, 0x01, 0x18, 0x80, 0x20, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x0d, - 0x0a, 0x0b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0x47, 0x0a, - 0x0f, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, - 0x15, 0x0a, 0x06, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x22, 0xaa, 0x02, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, - 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, - 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x12, 0x43, 0x0a, - 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x12, 0x45, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x0e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x31, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x6f, 0x5f, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x74, 0x6f, 0x55, 0x73, - 0x65, 0x72, 0x73, 0x22, 0x76, 0x0a, 0x0f, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x61, 0x69, 0x6c, - 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, - 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x22, 0xbd, 0x01, 0x0a, 0x16, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x14, - 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, - 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, - 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x49, - 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x6e, 0x6c, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6f, 0x6e, 0x6c, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, - 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x1a, 0x04, 0x18, 0x64, 0x28, - 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0xa6, 0x01, 0x0a, 0x17, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, - 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, - 0x33, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x2a, 0x34, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, - 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x65, - 0x78, 0x74, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x10, 0x01, 0x12, - 0x09, 0x0a, 0x05, 0x56, 0x6f, 0x69, 0x63, 0x65, 0x10, 0x02, 0x32, 0x64, 0x0a, 0x12, 0x50, 0x75, - 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x4e, 0x0a, 0x0b, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, - 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x32, 0x7f, 0x0a, 0x15, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x66, 0x0a, 0x13, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, - 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + LastMsgId int64 `protobuf:"varint,2,opt,name=last_msg_id,json=lastMsgId,proto3" json:"last_msg_id,omitempty"` } -var ( - file_message_v1_message_proto_rawDescOnce sync.Once - file_message_v1_message_proto_rawDescData = file_message_v1_message_proto_rawDesc -) +func (x *ConfirmLastMsgIDReq) Reset() { + *x = ConfirmLastMsgIDReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_v1_message_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} -func file_message_v1_message_proto_rawDescGZIP() []byte { - file_message_v1_message_proto_rawDescOnce.Do(func() { - file_message_v1_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_v1_message_proto_rawDescData) - }) - return file_message_v1_message_proto_rawDescData +func (x *ConfirmLastMsgIDReq) String() string { + return protoimpl.X.MessageStringOf(x) } -var file_message_v1_message_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_message_v1_message_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_message_v1_message_proto_goTypes = []interface{}{ - (MessageContentType)(0), // 0: api.message.v1.MessageContentType - (*SendMessageReq)(nil), // 1: api.message.v1.SendMessageReq - (*SendMessageResp)(nil), // 2: api.message.v1.SendMessageResp - (*Message)(nil), // 3: api.message.v1.Message - (*PushMessageReq)(nil), // 4: api.message.v1.PushMessageReq - (*PushMessageResp)(nil), // 5: api.message.v1.PushMessageResp - (*QueryOfflineMessageReq)(nil), // 6: api.message.v1.QueryOfflineMessageReq - (*QueryOfflineMessageResp)(nil), // 7: api.message.v1.QueryOfflineMessageResp - (v1.SessionType)(0), // 8: api.user.session.v1.SessionType - (*response.BaseResponse)(nil), // 9: api.transport.response.BaseResponse +func (*ConfirmLastMsgIDReq) ProtoMessage() {} + +func (x *ConfirmLastMsgIDReq) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_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) } -var file_message_v1_message_proto_depIdxs = []int32{ - 8, // 0: api.message.v1.SendMessageReq.session_type:type_name -> api.user.session.v1.SessionType - 0, // 1: api.message.v1.SendMessageReq.content_type:type_name -> api.message.v1.MessageContentType - 8, // 2: api.message.v1.Message.session_type:type_name -> api.user.session.v1.SessionType - 0, // 3: api.message.v1.Message.content_type:type_name -> api.message.v1.MessageContentType - 3, // 4: api.message.v1.PushMessageReq.message:type_name -> api.message.v1.Message - 9, // 5: api.message.v1.PushMessageResp.response:type_name -> api.transport.response.BaseResponse - 9, // 6: api.message.v1.QueryOfflineMessageResp.response:type_name -> api.transport.response.BaseResponse - 3, // 7: api.message.v1.QueryOfflineMessageResp.messages:type_name -> api.message.v1.Message - 4, // 8: api.message.v1.PushMessageService.PushMessage:input_type -> api.message.v1.PushMessageReq - 6, // 9: api.message.v1.OfflineMessageService.QueryOfflineMessage:input_type -> api.message.v1.QueryOfflineMessageReq - 5, // 10: api.message.v1.PushMessageService.PushMessage:output_type -> api.message.v1.PushMessageResp - 7, // 11: api.message.v1.OfflineMessageService.QueryOfflineMessage:output_type -> api.message.v1.QueryOfflineMessageResp - 10, // [10:12] is the sub-list for method output_type - 8, // [8:10] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + +// Deprecated: Use ConfirmLastMsgIDReq.ProtoReflect.Descriptor instead. +func (*ConfirmLastMsgIDReq) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{6} } -func init() { file_message_v1_message_proto_init() } -func file_message_v1_message_proto_init() { - if File_message_v1_message_proto != nil { - return +func (x *ConfirmLastMsgIDReq) GetUid() int64 { + if x != nil { + return x.Uid } - if !protoimpl.UnsafeEnabled { - file_message_v1_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendMessageReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_message_v1_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendMessageResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_message_v1_message_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Message); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } + return 0 +} + +func (x *ConfirmLastMsgIDReq) GetLastMsgId() int64 { + if x != nil { + return x.LastMsgId + } + return 0 +} + +type ConfirmLastMsgIDResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + LastMsgId int64 `protobuf:"varint,2,opt,name=last_msg_id,json=lastMsgId,proto3" json:"last_msg_id,omitempty"` +} + +func (x *ConfirmLastMsgIDResp) Reset() { + *x = ConfirmLastMsgIDResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_v1_message_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfirmLastMsgIDResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfirmLastMsgIDResp) ProtoMessage() {} + +func (x *ConfirmLastMsgIDResp) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - file_message_v1_message_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushMessageReq); i { - case 0: - return &v.state + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfirmLastMsgIDResp.ProtoReflect.Descriptor instead. +func (*ConfirmLastMsgIDResp) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{7} +} + +func (x *ConfirmLastMsgIDResp) GetError() *errors.Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *ConfirmLastMsgIDResp) GetLastMsgId() int64 { + if x != nil { + return x.LastMsgId + } + return 0 +} + +// storage message +type StorageMessage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MsgID int64 `protobuf:"varint,1,opt,name=msgID,proto3" json:"msgID,omitempty"` + SessionID string `protobuf:"bytes,2,opt,name=sessionID,proto3" json:"sessionID,omitempty"` + SessionType SessionType `protobuf:"varint,3,opt,name=session_type,json=sessionType,proto3,enum=api.message.v1.SessionType" json:"session_type,omitempty"` + FromID int64 `protobuf:"varint,4,opt,name=fromID,proto3" json:"fromID,omitempty"` + ToID int64 `protobuf:"varint,5,opt,name=toID,proto3" json:"toID,omitempty"` + Content *StorageMessage_Content `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=createTime,proto3" json:"createTime,omitempty"` + Status MessageStatus `protobuf:"varint,8,opt,name=status,proto3,enum=api.message.v1.MessageStatus" json:"status,omitempty"` +} + +func (x *StorageMessage) Reset() { + *x = StorageMessage{} + if protoimpl.UnsafeEnabled { + mi := &file_message_v1_message_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StorageMessage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StorageMessage) ProtoMessage() {} + +func (x *StorageMessage) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_proto_msgTypes[8] + 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) +} + +// Deprecated: Use StorageMessage.ProtoReflect.Descriptor instead. +func (*StorageMessage) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{8} +} + +func (x *StorageMessage) GetMsgID() int64 { + if x != nil { + return x.MsgID + } + return 0 +} + +func (x *StorageMessage) GetSessionID() string { + if x != nil { + return x.SessionID + } + return "" +} + +func (x *StorageMessage) GetSessionType() SessionType { + if x != nil { + return x.SessionType + } + return SessionType_SingleChat +} + +func (x *StorageMessage) GetFromID() int64 { + if x != nil { + return x.FromID + } + return 0 +} + +func (x *StorageMessage) GetToID() int64 { + if x != nil { + return x.ToID + } + return 0 +} + +func (x *StorageMessage) GetContent() *StorageMessage_Content { + if x != nil { + return x.Content + } + return nil +} + +func (x *StorageMessage) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *StorageMessage) GetStatus() MessageStatus { + if x != nil { + return x.Status + } + return MessageStatus_Normal +} + +type QuerySessionHistoryMessageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + SessionId string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + LastMsgId int64 `protobuf:"varint,3,opt,name=last_msg_id,json=lastMsgId,proto3" json:"last_msg_id,omitempty"` + Page int32 `protobuf:"varint,4,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,5,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *QuerySessionHistoryMessageReq) Reset() { + *x = QuerySessionHistoryMessageReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_v1_message_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuerySessionHistoryMessageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuerySessionHistoryMessageReq) ProtoMessage() {} + +func (x *QuerySessionHistoryMessageReq) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_proto_msgTypes[9] + 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) +} + +// Deprecated: Use QuerySessionHistoryMessageReq.ProtoReflect.Descriptor instead. +func (*QuerySessionHistoryMessageReq) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{9} +} + +func (x *QuerySessionHistoryMessageReq) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *QuerySessionHistoryMessageReq) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *QuerySessionHistoryMessageReq) GetLastMsgId() int64 { + if x != nil { + return x.LastMsgId + } + return 0 +} + +func (x *QuerySessionHistoryMessageReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *QuerySessionHistoryMessageReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type QuerySessionHistoryMessageResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + Messages []*Message `protobuf:"bytes,3,rep,name=messages,proto3" json:"messages,omitempty"` +} + +func (x *QuerySessionHistoryMessageResp) Reset() { + *x = QuerySessionHistoryMessageResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_v1_message_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QuerySessionHistoryMessageResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QuerySessionHistoryMessageResp) ProtoMessage() {} + +func (x *QuerySessionHistoryMessageResp) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_proto_msgTypes[10] + 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) +} + +// Deprecated: Use QuerySessionHistoryMessageResp.ProtoReflect.Descriptor instead. +func (*QuerySessionHistoryMessageResp) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{10} +} + +func (x *QuerySessionHistoryMessageResp) GetError() *errors.Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *QuerySessionHistoryMessageResp) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *QuerySessionHistoryMessageResp) GetMessages() []*Message { + if x != nil { + return x.Messages + } + return nil +} + +type SyncHistoryMessageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + LastMsgId int64 `protobuf:"varint,2,opt,name=last_msg_id,json=lastMsgId,proto3" json:"last_msg_id,omitempty"` + Page int32 `protobuf:"varint,3,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` +} + +func (x *SyncHistoryMessageReq) Reset() { + *x = SyncHistoryMessageReq{} + if protoimpl.UnsafeEnabled { + mi := &file_message_v1_message_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncHistoryMessageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncHistoryMessageReq) ProtoMessage() {} + +func (x *SyncHistoryMessageReq) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_proto_msgTypes[11] + 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) +} + +// Deprecated: Use SyncHistoryMessageReq.ProtoReflect.Descriptor instead. +func (*SyncHistoryMessageReq) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{11} +} + +func (x *SyncHistoryMessageReq) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *SyncHistoryMessageReq) GetLastMsgId() int64 { + if x != nil { + return x.LastMsgId + } + return 0 +} + +func (x *SyncHistoryMessageReq) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *SyncHistoryMessageReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type SyncHistoryMessageResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + Messages []*Message `protobuf:"bytes,3,rep,name=messages,proto3" json:"messages,omitempty"` +} + +func (x *SyncHistoryMessageResp) Reset() { + *x = SyncHistoryMessageResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_v1_message_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SyncHistoryMessageResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SyncHistoryMessageResp) ProtoMessage() {} + +func (x *SyncHistoryMessageResp) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_proto_msgTypes[12] + 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) +} + +// Deprecated: Use SyncHistoryMessageResp.ProtoReflect.Descriptor instead. +func (*SyncHistoryMessageResp) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{12} +} + +func (x *SyncHistoryMessageResp) GetError() *errors.Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *SyncHistoryMessageResp) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *SyncHistoryMessageResp) GetMessages() []*Message { + if x != nil { + return x.Messages + } + return nil +} + +type StorageMessage_Content struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ContentType MessageContentType `protobuf:"varint,1,opt,name=contentType,proto3,enum=api.message.v1.MessageContentType" json:"contentType,omitempty"` + Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` +} + +func (x *StorageMessage_Content) Reset() { + *x = StorageMessage_Content{} + if protoimpl.UnsafeEnabled { + mi := &file_message_v1_message_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *StorageMessage_Content) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StorageMessage_Content) ProtoMessage() {} + +func (x *StorageMessage_Content) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_proto_msgTypes[13] + 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) +} + +// Deprecated: Use StorageMessage_Content.ProtoReflect.Descriptor instead. +func (*StorageMessage_Content) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{8, 0} +} + +func (x *StorageMessage_Content) GetContentType() MessageContentType { + if x != nil { + return x.ContentType + } + return MessageContentType_Text +} + +func (x *StorageMessage_Content) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +var File_message_v1_message_proto protoreflect.FileDescriptor + +var file_message_v1_message_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x61, 0x70, 0x69, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb0, 0x02, 0x0a, 0x0e, 0x53, 0x65, + 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x04, + 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, + 0x02, 0x20, 0x00, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x17, 0x0a, 0x02, 0x74, 0x6f, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x02, + 0x74, 0x6f, 0x12, 0x3e, 0x0a, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x24, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, + 0x01, 0x18, 0x80, 0x20, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x42, 0x0d, 0x0a, + 0x0b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0xa5, 0x02, 0x0a, + 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x6d, 0x73, 0x67, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, 0x64, 0x12, + 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x66, + 0x72, 0x6f, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x02, 0x74, 0x6f, 0x12, 0x3e, 0x0a, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x12, 0x45, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x63, 0x6f, + 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x0e, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x31, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x6f, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x74, 0x6f, 0x55, + 0x73, 0x65, 0x72, 0x73, 0x22, 0x5d, 0x0a, 0x0f, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0b, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x22, 0xb6, 0x01, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x66, 0x66, + 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x19, + 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, + 0x22, 0x02, 0x20, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0b, 0x6c, 0x61, 0x73, + 0x74, 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, + 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6f, 0x6e, 0x6c, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6f, 0x6e, 0x6c, 0x79, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x70, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x1a, 0x04, 0x18, 0x64, + 0x28, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x8d, 0x01, 0x0a, + 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x33, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x59, 0x0a, 0x13, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, + 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x27, + 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x09, 0x6c, 0x61, + 0x73, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x72, 0x6d, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, + 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x64, 0x22, 0xd0, 0x03, 0x0a, 0x0e, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6d, + 0x73, 0x67, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6d, 0x73, 0x67, 0x49, + 0x44, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, + 0x3e, 0x0a, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, + 0x70, 0x65, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x66, 0x72, 0x6f, 0x6d, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x66, 0x72, 0x6f, 0x6d, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x6f, 0x49, 0x44, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x74, 0x6f, 0x49, 0x44, 0x12, 0x40, 0x0a, 0x07, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x3a, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x1a, 0x69, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x44, 0x0a, 0x0b, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0xbe, 0x01, 0x0a, 0x1d, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, + 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, + 0x02, 0x20, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x27, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x5f, + 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x70, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, + 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x1a, 0x04, 0x18, 0x64, + 0x28, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x94, 0x01, 0x0a, + 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x33, + 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x22, 0x97, 0x01, 0x0a, 0x15, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x19, 0x0a, + 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, + 0x02, 0x20, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x6d, 0x73, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, + 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x1a, 0x04, 0x18, + 0x64, 0x28, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x8c, 0x01, + 0x0a, 0x16, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x33, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2a, 0x34, 0x0a, 0x12, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x6f, 0x69, 0x63, 0x65, + 0x10, 0x02, 0x2a, 0x48, 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x61, 0x74, 0x10, + 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, 0x10, 0x01, + 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x10, 0x02, 0x12, + 0x0b, 0x0a, 0x07, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x10, 0x03, 0x2a, 0x28, 0x0a, 0x0d, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, + 0x06, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x64, 0x10, 0x01, 0x32, 0x64, 0x0a, 0x12, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4e, 0x0a, 0x0b, + 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x73, + 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1f, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x73, + 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x32, 0xde, 0x01, 0x0a, + 0x15, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x66, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, + 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x26, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, 0x66, 0x66, 0x6c, + 0x69, 0x6e, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x5d, + 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x74, + 0x49, 0x44, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x4c, 0x61, 0x73, 0x74, 0x4d, + 0x73, 0x67, 0x49, 0x44, 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, + 0x4c, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x49, 0x44, 0x52, 0x65, 0x73, 0x70, 0x32, 0xf9, 0x01, + 0x0a, 0x15, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x1a, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x52, 0x65, 0x71, 0x1a, 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x12, 0x63, 0x0a, 0x12, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, + 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x1a, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x23, 0x5a, 0x21, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_message_v1_message_proto_rawDescOnce sync.Once + file_message_v1_message_proto_rawDescData = file_message_v1_message_proto_rawDesc +) + +func file_message_v1_message_proto_rawDescGZIP() []byte { + file_message_v1_message_proto_rawDescOnce.Do(func() { + file_message_v1_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_v1_message_proto_rawDescData) + }) + return file_message_v1_message_proto_rawDescData +} + +var file_message_v1_message_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_message_v1_message_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_message_v1_message_proto_goTypes = []interface{}{ + (MessageContentType)(0), // 0: api.message.v1.MessageContentType + (SessionType)(0), // 1: api.message.v1.SessionType + (MessageStatus)(0), // 2: api.message.v1.MessageStatus + (*SendMessageReq)(nil), // 3: api.message.v1.SendMessageReq + (*Message)(nil), // 4: api.message.v1.Message + (*PushMessageReq)(nil), // 5: api.message.v1.PushMessageReq + (*PushMessageResp)(nil), // 6: api.message.v1.PushMessageResp + (*QueryOfflineMessageReq)(nil), // 7: api.message.v1.QueryOfflineMessageReq + (*QueryOfflineMessageResp)(nil), // 8: api.message.v1.QueryOfflineMessageResp + (*ConfirmLastMsgIDReq)(nil), // 9: api.message.v1.ConfirmLastMsgIDReq + (*ConfirmLastMsgIDResp)(nil), // 10: api.message.v1.ConfirmLastMsgIDResp + (*StorageMessage)(nil), // 11: api.message.v1.StorageMessage + (*QuerySessionHistoryMessageReq)(nil), // 12: api.message.v1.QuerySessionHistoryMessageReq + (*QuerySessionHistoryMessageResp)(nil), // 13: api.message.v1.QuerySessionHistoryMessageResp + (*SyncHistoryMessageReq)(nil), // 14: api.message.v1.SyncHistoryMessageReq + (*SyncHistoryMessageResp)(nil), // 15: api.message.v1.SyncHistoryMessageResp + (*StorageMessage_Content)(nil), // 16: api.message.v1.StorageMessage.Content + (*errors.Error)(nil), // 17: api.errors.Error + (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp +} +var file_message_v1_message_proto_depIdxs = []int32{ + 1, // 0: api.message.v1.SendMessageReq.session_type:type_name -> api.message.v1.SessionType + 0, // 1: api.message.v1.SendMessageReq.content_type:type_name -> api.message.v1.MessageContentType + 1, // 2: api.message.v1.Message.session_type:type_name -> api.message.v1.SessionType + 0, // 3: api.message.v1.Message.content_type:type_name -> api.message.v1.MessageContentType + 4, // 4: api.message.v1.PushMessageReq.message:type_name -> api.message.v1.Message + 17, // 5: api.message.v1.PushMessageResp.error:type_name -> api.errors.Error + 17, // 6: api.message.v1.QueryOfflineMessageResp.error:type_name -> api.errors.Error + 4, // 7: api.message.v1.QueryOfflineMessageResp.messages:type_name -> api.message.v1.Message + 17, // 8: api.message.v1.ConfirmLastMsgIDResp.error:type_name -> api.errors.Error + 1, // 9: api.message.v1.StorageMessage.session_type:type_name -> api.message.v1.SessionType + 16, // 10: api.message.v1.StorageMessage.content:type_name -> api.message.v1.StorageMessage.Content + 18, // 11: api.message.v1.StorageMessage.createTime:type_name -> google.protobuf.Timestamp + 2, // 12: api.message.v1.StorageMessage.status:type_name -> api.message.v1.MessageStatus + 17, // 13: api.message.v1.QuerySessionHistoryMessageResp.error:type_name -> api.errors.Error + 4, // 14: api.message.v1.QuerySessionHistoryMessageResp.messages:type_name -> api.message.v1.Message + 17, // 15: api.message.v1.SyncHistoryMessageResp.error:type_name -> api.errors.Error + 4, // 16: api.message.v1.SyncHistoryMessageResp.messages:type_name -> api.message.v1.Message + 0, // 17: api.message.v1.StorageMessage.Content.contentType:type_name -> api.message.v1.MessageContentType + 5, // 18: api.message.v1.PushMessageService.PushMessage:input_type -> api.message.v1.PushMessageReq + 7, // 19: api.message.v1.OfflineMessageService.QueryOfflineMessage:input_type -> api.message.v1.QueryOfflineMessageReq + 9, // 20: api.message.v1.OfflineMessageService.ConfirmLastMstID:input_type -> api.message.v1.ConfirmLastMsgIDReq + 12, // 21: api.message.v1.HistoryMessageService.QuerySessionHistoryMessage:input_type -> api.message.v1.QuerySessionHistoryMessageReq + 14, // 22: api.message.v1.HistoryMessageService.SyncHistoryMessage:input_type -> api.message.v1.SyncHistoryMessageReq + 6, // 23: api.message.v1.PushMessageService.PushMessage:output_type -> api.message.v1.PushMessageResp + 8, // 24: api.message.v1.OfflineMessageService.QueryOfflineMessage:output_type -> api.message.v1.QueryOfflineMessageResp + 10, // 25: api.message.v1.OfflineMessageService.ConfirmLastMstID:output_type -> api.message.v1.ConfirmLastMsgIDResp + 13, // 26: api.message.v1.HistoryMessageService.QuerySessionHistoryMessage:output_type -> api.message.v1.QuerySessionHistoryMessageResp + 15, // 27: api.message.v1.HistoryMessageService.SyncHistoryMessage:output_type -> api.message.v1.SyncHistoryMessageResp + 23, // [23:28] is the sub-list for method output_type + 18, // [18:23] is the sub-list for method input_type + 18, // [18:18] is the sub-list for extension type_name + 18, // [18:18] is the sub-list for extension extendee + 0, // [0:18] is the sub-list for field type_name +} + +func init() { file_message_v1_message_proto_init() } +func file_message_v1_message_proto_init() { + if File_message_v1_message_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_message_v1_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendMessageReq); i { + case 0: + return &v.state case 1: return &v.sizeCache case 2: @@ -787,7 +1467,31 @@ func file_message_v1_message_proto_init() { return nil } } - file_message_v1_message_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_message_v1_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Message); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_v1_message_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushMessageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_v1_message_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PushMessageResp); i { case 0: return &v.state @@ -799,7 +1503,7 @@ func file_message_v1_message_proto_init() { return nil } } - file_message_v1_message_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_message_v1_message_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryOfflineMessageReq); i { case 0: return &v.state @@ -811,7 +1515,7 @@ func file_message_v1_message_proto_init() { return nil } } - file_message_v1_message_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_message_v1_message_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryOfflineMessageResp); i { case 0: return &v.state @@ -823,6 +1527,102 @@ func file_message_v1_message_proto_init() { return nil } } + file_message_v1_message_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfirmLastMsgIDReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_v1_message_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfirmLastMsgIDResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_v1_message_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StorageMessage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_v1_message_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuerySessionHistoryMessageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_v1_message_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QuerySessionHistoryMessageResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_v1_message_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncHistoryMessageReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_v1_message_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SyncHistoryMessageResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_v1_message_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*StorageMessage_Content); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_message_v1_message_proto_msgTypes[0].OneofWrappers = []interface{}{} type x struct{} @@ -830,10 +1630,10 @@ func file_message_v1_message_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_message_v1_message_proto_rawDesc, - NumEnums: 1, - NumMessages: 7, + NumEnums: 3, + NumMessages: 14, NumExtensions: 0, - NumServices: 2, + NumServices: 3, }, GoTypes: file_message_v1_message_proto_goTypes, DependencyIndexes: file_message_v1_message_proto_depIdxs, diff --git a/message/v1/message.pb.validate.go b/message/v1/message.pb.validate.go index 17bc72f..88cf198 100644 --- a/message/v1/message.pb.validate.go +++ b/message/v1/message.pb.validate.go @@ -57,10 +57,10 @@ func (m *SendMessageReq) validate(all bool) error { var errors []error - if utf8.RuneCountInString(m.GetFrom()) < 20 { + if m.GetFrom() <= 0 { err := SendMessageReqValidationError{ field: "From", - reason: "value length must be at least 20 runes", + reason: "value must be greater than 0", } if !all { return err @@ -68,10 +68,10 @@ func (m *SendMessageReq) validate(all bool) error { errors = append(errors, err) } - if utf8.RuneCountInString(m.GetTo()) < 20 { + if m.GetTo() <= 0 { err := SendMessageReqValidationError{ field: "To", - reason: "value length must be at least 20 runes", + reason: "value must be greater than 0", } if !all { return err @@ -185,110 +185,6 @@ var _ interface { ErrorName() string } = SendMessageReqValidationError{} -// Validate checks the field values on SendMessageResp with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *SendMessageResp) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on SendMessageResp with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// SendMessageRespMultiError, or nil if none found. -func (m *SendMessageResp) ValidateAll() error { - return m.validate(true) -} - -func (m *SendMessageResp) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for SessionId - - // no validation rules for MsgId - - if len(errors) > 0 { - return SendMessageRespMultiError(errors) - } - - return nil -} - -// SendMessageRespMultiError is an error wrapping multiple validation errors -// returned by SendMessageResp.ValidateAll() if the designated constraints -// aren't met. -type SendMessageRespMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m SendMessageRespMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m SendMessageRespMultiError) AllErrors() []error { return m } - -// SendMessageRespValidationError is the validation error returned by -// SendMessageResp.Validate if the designated constraints aren't met. -type SendMessageRespValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e SendMessageRespValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e SendMessageRespValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e SendMessageRespValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e SendMessageRespValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e SendMessageRespValidationError) ErrorName() string { return "SendMessageRespValidationError" } - -// Error satisfies the builtin error interface -func (e SendMessageRespValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sSendMessageResp.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = SendMessageRespValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = SendMessageRespValidationError{} - // Validate checks the field values on Message with the rules defined in the // proto definition for this message. If any rules are violated, the first // error encountered is returned, or nil if there are no violations. @@ -555,11 +451,11 @@ func (m *PushMessageResp) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, PushMessageRespValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -567,16 +463,16 @@ func (m *PushMessageResp) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, PushMessageRespValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return PushMessageRespValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -683,10 +579,10 @@ func (m *QueryOfflineMessageReq) validate(all bool) error { var errors []error - if utf8.RuneCountInString(m.GetUserId()) < 20 { + if m.GetUid() <= 0 { err := QueryOfflineMessageReqValidationError{ - field: "UserId", - reason: "value length must be at least 20 runes", + field: "Uid", + reason: "value must be greater than 0", } if !all { return err @@ -823,11 +719,11 @@ func (m *QueryOfflineMessageResp) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, QueryOfflineMessageRespValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -835,16 +731,16 @@ func (m *QueryOfflineMessageResp) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, QueryOfflineMessageRespValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return QueryOfflineMessageRespValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -966,3 +862,1148 @@ var _ interface { Cause() error ErrorName() string } = QueryOfflineMessageRespValidationError{} + +// Validate checks the field values on ConfirmLastMsgIDReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ConfirmLastMsgIDReq) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ConfirmLastMsgIDReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ConfirmLastMsgIDReqMultiError, or nil if none found. +func (m *ConfirmLastMsgIDReq) ValidateAll() error { + return m.validate(true) +} + +func (m *ConfirmLastMsgIDReq) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetUid() <= 0 { + err := ConfirmLastMsgIDReqValidationError{ + field: "Uid", + reason: "value must be greater than 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetLastMsgId() <= 0 { + err := ConfirmLastMsgIDReqValidationError{ + field: "LastMsgId", + reason: "value must be greater than 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return ConfirmLastMsgIDReqMultiError(errors) + } + + return nil +} + +// ConfirmLastMsgIDReqMultiError is an error wrapping multiple validation +// errors returned by ConfirmLastMsgIDReq.ValidateAll() if the designated +// constraints aren't met. +type ConfirmLastMsgIDReqMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ConfirmLastMsgIDReqMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ConfirmLastMsgIDReqMultiError) AllErrors() []error { return m } + +// ConfirmLastMsgIDReqValidationError is the validation error returned by +// ConfirmLastMsgIDReq.Validate if the designated constraints aren't met. +type ConfirmLastMsgIDReqValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfirmLastMsgIDReqValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfirmLastMsgIDReqValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfirmLastMsgIDReqValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfirmLastMsgIDReqValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfirmLastMsgIDReqValidationError) ErrorName() string { + return "ConfirmLastMsgIDReqValidationError" +} + +// Error satisfies the builtin error interface +func (e ConfirmLastMsgIDReqValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfirmLastMsgIDReq.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfirmLastMsgIDReqValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfirmLastMsgIDReqValidationError{} + +// Validate checks the field values on ConfirmLastMsgIDResp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *ConfirmLastMsgIDResp) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ConfirmLastMsgIDResp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// ConfirmLastMsgIDRespMultiError, or nil if none found. +func (m *ConfirmLastMsgIDResp) ValidateAll() error { + return m.validate(true) +} + +func (m *ConfirmLastMsgIDResp) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetError()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ConfirmLastMsgIDRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ConfirmLastMsgIDRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return ConfirmLastMsgIDRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for LastMsgId + + if len(errors) > 0 { + return ConfirmLastMsgIDRespMultiError(errors) + } + + return nil +} + +// ConfirmLastMsgIDRespMultiError is an error wrapping multiple validation +// errors returned by ConfirmLastMsgIDResp.ValidateAll() if the designated +// constraints aren't met. +type ConfirmLastMsgIDRespMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ConfirmLastMsgIDRespMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m ConfirmLastMsgIDRespMultiError) AllErrors() []error { return m } + +// ConfirmLastMsgIDRespValidationError is the validation error returned by +// ConfirmLastMsgIDResp.Validate if the designated constraints aren't met. +type ConfirmLastMsgIDRespValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ConfirmLastMsgIDRespValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ConfirmLastMsgIDRespValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ConfirmLastMsgIDRespValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ConfirmLastMsgIDRespValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ConfirmLastMsgIDRespValidationError) ErrorName() string { + return "ConfirmLastMsgIDRespValidationError" +} + +// Error satisfies the builtin error interface +func (e ConfirmLastMsgIDRespValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sConfirmLastMsgIDResp.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ConfirmLastMsgIDRespValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ConfirmLastMsgIDRespValidationError{} + +// Validate checks the field values on StorageMessage with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *StorageMessage) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StorageMessage with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in StorageMessageMultiError, +// or nil if none found. +func (m *StorageMessage) ValidateAll() error { + return m.validate(true) +} + +func (m *StorageMessage) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for MsgID + + // no validation rules for SessionID + + // no validation rules for SessionType + + // no validation rules for FromID + + // no validation rules for ToID + + if all { + switch v := interface{}(m.GetContent()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StorageMessageValidationError{ + field: "Content", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StorageMessageValidationError{ + field: "Content", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetContent()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StorageMessageValidationError{ + field: "Content", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetCreateTime()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, StorageMessageValidationError{ + field: "CreateTime", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, StorageMessageValidationError{ + field: "CreateTime", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetCreateTime()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return StorageMessageValidationError{ + field: "CreateTime", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Status + + if len(errors) > 0 { + return StorageMessageMultiError(errors) + } + + return nil +} + +// StorageMessageMultiError is an error wrapping multiple validation errors +// returned by StorageMessage.ValidateAll() if the designated constraints +// aren't met. +type StorageMessageMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StorageMessageMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StorageMessageMultiError) AllErrors() []error { return m } + +// StorageMessageValidationError is the validation error returned by +// StorageMessage.Validate if the designated constraints aren't met. +type StorageMessageValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StorageMessageValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StorageMessageValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StorageMessageValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StorageMessageValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StorageMessageValidationError) ErrorName() string { return "StorageMessageValidationError" } + +// Error satisfies the builtin error interface +func (e StorageMessageValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStorageMessage.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StorageMessageValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StorageMessageValidationError{} + +// Validate checks the field values on QuerySessionHistoryMessageReq with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *QuerySessionHistoryMessageReq) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on QuerySessionHistoryMessageReq with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// QuerySessionHistoryMessageReqMultiError, or nil if none found. +func (m *QuerySessionHistoryMessageReq) ValidateAll() error { + return m.validate(true) +} + +func (m *QuerySessionHistoryMessageReq) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetUid() <= 0 { + err := QuerySessionHistoryMessageReqValidationError{ + field: "Uid", + reason: "value must be greater than 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + // no validation rules for SessionId + + if m.GetLastMsgId() <= 0 { + err := QuerySessionHistoryMessageReqValidationError{ + field: "LastMsgId", + reason: "value must be greater than 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + // no validation rules for Page + + if val := m.GetPageSize(); val < 1 || val > 100 { + err := QuerySessionHistoryMessageReqValidationError{ + field: "PageSize", + reason: "value must be inside range [1, 100]", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return QuerySessionHistoryMessageReqMultiError(errors) + } + + return nil +} + +// QuerySessionHistoryMessageReqMultiError is an error wrapping multiple +// validation errors returned by QuerySessionHistoryMessageReq.ValidateAll() +// if the designated constraints aren't met. +type QuerySessionHistoryMessageReqMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m QuerySessionHistoryMessageReqMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m QuerySessionHistoryMessageReqMultiError) AllErrors() []error { return m } + +// QuerySessionHistoryMessageReqValidationError is the validation error +// returned by QuerySessionHistoryMessageReq.Validate if the designated +// constraints aren't met. +type QuerySessionHistoryMessageReqValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e QuerySessionHistoryMessageReqValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e QuerySessionHistoryMessageReqValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e QuerySessionHistoryMessageReqValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e QuerySessionHistoryMessageReqValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e QuerySessionHistoryMessageReqValidationError) ErrorName() string { + return "QuerySessionHistoryMessageReqValidationError" +} + +// Error satisfies the builtin error interface +func (e QuerySessionHistoryMessageReqValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sQuerySessionHistoryMessageReq.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = QuerySessionHistoryMessageReqValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = QuerySessionHistoryMessageReqValidationError{} + +// Validate checks the field values on QuerySessionHistoryMessageResp with the +// rules defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *QuerySessionHistoryMessageResp) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on QuerySessionHistoryMessageResp with +// the rules defined in the proto definition for this message. If any rules +// are violated, the result is a list of violation errors wrapped in +// QuerySessionHistoryMessageRespMultiError, or nil if none found. +func (m *QuerySessionHistoryMessageResp) ValidateAll() error { + return m.validate(true) +} + +func (m *QuerySessionHistoryMessageResp) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetError()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, QuerySessionHistoryMessageRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, QuerySessionHistoryMessageRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return QuerySessionHistoryMessageRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Total + + for idx, item := range m.GetMessages() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, QuerySessionHistoryMessageRespValidationError{ + field: fmt.Sprintf("Messages[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, QuerySessionHistoryMessageRespValidationError{ + field: fmt.Sprintf("Messages[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return QuerySessionHistoryMessageRespValidationError{ + field: fmt.Sprintf("Messages[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return QuerySessionHistoryMessageRespMultiError(errors) + } + + return nil +} + +// QuerySessionHistoryMessageRespMultiError is an error wrapping multiple +// validation errors returned by QuerySessionHistoryMessageResp.ValidateAll() +// if the designated constraints aren't met. +type QuerySessionHistoryMessageRespMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m QuerySessionHistoryMessageRespMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m QuerySessionHistoryMessageRespMultiError) AllErrors() []error { return m } + +// QuerySessionHistoryMessageRespValidationError is the validation error +// returned by QuerySessionHistoryMessageResp.Validate if the designated +// constraints aren't met. +type QuerySessionHistoryMessageRespValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e QuerySessionHistoryMessageRespValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e QuerySessionHistoryMessageRespValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e QuerySessionHistoryMessageRespValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e QuerySessionHistoryMessageRespValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e QuerySessionHistoryMessageRespValidationError) ErrorName() string { + return "QuerySessionHistoryMessageRespValidationError" +} + +// Error satisfies the builtin error interface +func (e QuerySessionHistoryMessageRespValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sQuerySessionHistoryMessageResp.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = QuerySessionHistoryMessageRespValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = QuerySessionHistoryMessageRespValidationError{} + +// Validate checks the field values on SyncHistoryMessageReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *SyncHistoryMessageReq) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SyncHistoryMessageReq with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// SyncHistoryMessageReqMultiError, or nil if none found. +func (m *SyncHistoryMessageReq) ValidateAll() error { + return m.validate(true) +} + +func (m *SyncHistoryMessageReq) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if m.GetUid() <= 0 { + err := SyncHistoryMessageReqValidationError{ + field: "Uid", + reason: "value must be greater than 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + if m.GetLastMsgId() <= 0 { + err := SyncHistoryMessageReqValidationError{ + field: "LastMsgId", + reason: "value must be greater than 0", + } + if !all { + return err + } + errors = append(errors, err) + } + + // no validation rules for Page + + if val := m.GetPageSize(); val < 1 || val > 100 { + err := SyncHistoryMessageReqValidationError{ + field: "PageSize", + reason: "value must be inside range [1, 100]", + } + if !all { + return err + } + errors = append(errors, err) + } + + if len(errors) > 0 { + return SyncHistoryMessageReqMultiError(errors) + } + + return nil +} + +// SyncHistoryMessageReqMultiError is an error wrapping multiple validation +// errors returned by SyncHistoryMessageReq.ValidateAll() if the designated +// constraints aren't met. +type SyncHistoryMessageReqMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SyncHistoryMessageReqMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SyncHistoryMessageReqMultiError) AllErrors() []error { return m } + +// SyncHistoryMessageReqValidationError is the validation error returned by +// SyncHistoryMessageReq.Validate if the designated constraints aren't met. +type SyncHistoryMessageReqValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SyncHistoryMessageReqValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SyncHistoryMessageReqValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SyncHistoryMessageReqValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SyncHistoryMessageReqValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SyncHistoryMessageReqValidationError) ErrorName() string { + return "SyncHistoryMessageReqValidationError" +} + +// Error satisfies the builtin error interface +func (e SyncHistoryMessageReqValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSyncHistoryMessageReq.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SyncHistoryMessageReqValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SyncHistoryMessageReqValidationError{} + +// Validate checks the field values on SyncHistoryMessageResp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *SyncHistoryMessageResp) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SyncHistoryMessageResp with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// SyncHistoryMessageRespMultiError, or nil if none found. +func (m *SyncHistoryMessageResp) ValidateAll() error { + return m.validate(true) +} + +func (m *SyncHistoryMessageResp) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetError()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, SyncHistoryMessageRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, SyncHistoryMessageRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SyncHistoryMessageRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Total + + for idx, item := range m.GetMessages() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, SyncHistoryMessageRespValidationError{ + field: fmt.Sprintf("Messages[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, SyncHistoryMessageRespValidationError{ + field: fmt.Sprintf("Messages[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SyncHistoryMessageRespValidationError{ + field: fmt.Sprintf("Messages[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return SyncHistoryMessageRespMultiError(errors) + } + + return nil +} + +// SyncHistoryMessageRespMultiError is an error wrapping multiple validation +// errors returned by SyncHistoryMessageResp.ValidateAll() if the designated +// constraints aren't met. +type SyncHistoryMessageRespMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SyncHistoryMessageRespMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SyncHistoryMessageRespMultiError) AllErrors() []error { return m } + +// SyncHistoryMessageRespValidationError is the validation error returned by +// SyncHistoryMessageResp.Validate if the designated constraints aren't met. +type SyncHistoryMessageRespValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SyncHistoryMessageRespValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SyncHistoryMessageRespValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SyncHistoryMessageRespValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SyncHistoryMessageRespValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SyncHistoryMessageRespValidationError) ErrorName() string { + return "SyncHistoryMessageRespValidationError" +} + +// Error satisfies the builtin error interface +func (e SyncHistoryMessageRespValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSyncHistoryMessageResp.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SyncHistoryMessageRespValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SyncHistoryMessageRespValidationError{} + +// Validate checks the field values on StorageMessage_Content with the rules +// defined in the proto definition for this message. If any rules are +// violated, the first error encountered is returned, or nil if there are no violations. +func (m *StorageMessage_Content) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on StorageMessage_Content with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// StorageMessage_ContentMultiError, or nil if none found. +func (m *StorageMessage_Content) ValidateAll() error { + return m.validate(true) +} + +func (m *StorageMessage_Content) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for ContentType + + // no validation rules for Content + + if len(errors) > 0 { + return StorageMessage_ContentMultiError(errors) + } + + return nil +} + +// StorageMessage_ContentMultiError is an error wrapping multiple validation +// errors returned by StorageMessage_Content.ValidateAll() if the designated +// constraints aren't met. +type StorageMessage_ContentMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m StorageMessage_ContentMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m StorageMessage_ContentMultiError) AllErrors() []error { return m } + +// StorageMessage_ContentValidationError is the validation error returned by +// StorageMessage_Content.Validate if the designated constraints aren't met. +type StorageMessage_ContentValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e StorageMessage_ContentValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e StorageMessage_ContentValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e StorageMessage_ContentValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e StorageMessage_ContentValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e StorageMessage_ContentValidationError) ErrorName() string { + return "StorageMessage_ContentValidationError" +} + +// Error satisfies the builtin error interface +func (e StorageMessage_ContentValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sStorageMessage_Content.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = StorageMessage_ContentValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = StorageMessage_ContentValidationError{} diff --git a/message/v1/message.proto b/message/v1/message.proto index 76d0824..9294b61 100644 --- a/message/v1/message.proto +++ b/message/v1/message.proto @@ -2,8 +2,8 @@ syntax = "proto3"; package api.message.v1; -import "transport/response/response.proto"; -import "user/session/v1/session.proto"; +import "google/protobuf/timestamp.proto"; +import "errors/errors.proto"; import "validate/validate.proto"; option go_package = "github.com/go-goim/api/message/v1"; @@ -14,11 +14,27 @@ enum MessageContentType { Voice = 2; } +// define session type and status +enum SessionType { + SingleChat = 0; + GroupChat = 1; + // broadcast actually not a standard chat type, but we still use it here + Broadcast = 2; + // Channel is for user subscribed channel msgs + Channel = 3; + // 255 at most +} + +enum MessageStatus { + Normal = 0; + Deleted = 1; +} + // SendMessageReq receive data from gateway message SendMessageReq { - string from = 1 [(validate.rules).string.min_len = 20]; - string to = 2 [(validate.rules).string.min_len = 20]; - user.session.v1.SessionType session_type = 3; + int64 from = 1 [(validate.rules).int64.gt = 0]; + int64 to = 2 [(validate.rules).int64.gt = 0]; + SessionType session_type = 3; optional string session_id = 4; MessageContentType content_type = 5 [(validate.rules).enum.defined_only = true]; string content = 6 [(validate.rules).string = { @@ -27,19 +43,13 @@ message SendMessageReq { }]; } -// SendMessageResp is response body for sendMessage -message SendMessageResp { - int64 session_id = 2; - int64 msg_id = 3; -} - // Message is definition of message message Message { int64 msg_id = 1; - string from = 2; - string to = 3; // to user id or group id - user.session.v1.SessionType session_type = 4; - int64 session_id = 5; + int64 from = 2; + int64 to = 3; // user id or group id or room id etc. + SessionType session_type = 4; + string session_id = 5; MessageContentType content_type = 6; string content = 7; int64 create_time = 8; @@ -49,12 +59,12 @@ message Message { message PushMessageReq { Message message = 1; // ToUsers is a list of user id who receive this message - repeated string to_users = 2; + repeated int64 to_users = 2; } message PushMessageResp { - transport.response.BaseResponse response = 1; - repeated string failed_users = 2; + errors.Error error = 1; + repeated int64 failed_users = 2; } service PushMessageService { @@ -62,7 +72,7 @@ service PushMessageService { } message QueryOfflineMessageReq { - string user_id = 1 [(validate.rules).string.min_len = 20]; + int64 uid = 1 [(validate.rules).int64.gt = 0]; int64 last_msg_id = 2 [(validate.rules).int64.gt = 0]; bool onlyCount = 3; int32 page = 4; @@ -73,11 +83,80 @@ message QueryOfflineMessageReq { } message QueryOfflineMessageResp { - transport.response.BaseResponse response = 1; + errors.Error error = 1; int32 total = 2; repeated Message messages = 3; } +message ConfirmLastMsgIDReq { + int64 uid = 1 [(validate.rules).int64.gt = 0]; + int64 last_msg_id = 2 [(validate.rules).int64.gt = 0]; +} + +message ConfirmLastMsgIDResp { + errors.Error error = 1; + int64 last_msg_id = 2; +} + service OfflineMessageService { rpc QueryOfflineMessage(QueryOfflineMessageReq) returns (QueryOfflineMessageResp); + rpc ConfirmLastMstID(ConfirmLastMsgIDReq) returns (ConfirmLastMsgIDResp); +} + +// storage message +message StorageMessage { + int64 msgID = 1; + string sessionID = 2; + SessionType session_type = 3; + int64 fromID = 4; + int64 toID = 5; + message Content { + MessageContentType contentType = 1; + string content = 2; + } + Content content = 6; + google.protobuf.Timestamp createTime = 7; + MessageStatus status = 8; +} + +// HistoryMessage + +message QuerySessionHistoryMessageReq { + int64 uid = 1 [(validate.rules).int64.gt = 0]; + string session_id = 2; + int64 last_msg_id = 3 [(validate.rules).int64.gt = 0]; + int32 page = 4; + int32 page_size = 5 [(validate.rules).int32 = { + gte: 1, + lte: 100 + }]; +} + +message QuerySessionHistoryMessageResp { + errors.Error error = 1; + int32 total = 2; + repeated Message messages = 3; +} + + +message SyncHistoryMessageReq { + int64 uid = 1 [(validate.rules).int64.gt = 0]; + int64 last_msg_id = 2 [(validate.rules).int64.gt = 0]; + int32 page = 3; + int32 page_size = 4 [(validate.rules).int32 = { + gte: 1, + lte: 100 + }]; +} + +message SyncHistoryMessageResp { + errors.Error error = 1; + int32 total = 2; + repeated Message messages = 3; +} + + +service HistoryMessageService { + rpc QuerySessionHistoryMessage(QuerySessionHistoryMessageReq) returns (QuerySessionHistoryMessageResp); + rpc SyncHistoryMessage(SyncHistoryMessageReq) returns (SyncHistoryMessageResp); } diff --git a/message/v1/message_grpc.pb.go b/message/v1/message_grpc.pb.go index 0e87907..9bbf2f9 100644 --- a/message/v1/message_grpc.pb.go +++ b/message/v1/message_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: message/v1/message.proto package v1 @@ -14,6 +18,10 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + PushMessageService_PushMessage_FullMethodName = "/api.message.v1.PushMessageService/PushMessage" +) + // PushMessageServiceClient is the client API for PushMessageService 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. @@ -31,7 +39,7 @@ func NewPushMessageServiceClient(cc grpc.ClientConnInterface) PushMessageService func (c *pushMessageServiceClient) PushMessage(ctx context.Context, in *PushMessageReq, opts ...grpc.CallOption) (*PushMessageResp, error) { out := new(PushMessageResp) - err := c.cc.Invoke(ctx, "/api.message.v1.PushMessageService/PushMessage", in, out, opts...) + err := c.cc.Invoke(ctx, PushMessageService_PushMessage_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -76,7 +84,7 @@ func _PushMessageService_PushMessage_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.message.v1.PushMessageService/PushMessage", + FullMethod: PushMessageService_PushMessage_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(PushMessageServiceServer).PushMessage(ctx, req.(*PushMessageReq)) @@ -100,11 +108,17 @@ var PushMessageService_ServiceDesc = grpc.ServiceDesc{ Metadata: "message/v1/message.proto", } +const ( + OfflineMessageService_QueryOfflineMessage_FullMethodName = "/api.message.v1.OfflineMessageService/QueryOfflineMessage" + OfflineMessageService_ConfirmLastMstID_FullMethodName = "/api.message.v1.OfflineMessageService/ConfirmLastMstID" +) + // OfflineMessageServiceClient is the client API for OfflineMessageService 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. type OfflineMessageServiceClient interface { QueryOfflineMessage(ctx context.Context, in *QueryOfflineMessageReq, opts ...grpc.CallOption) (*QueryOfflineMessageResp, error) + ConfirmLastMstID(ctx context.Context, in *ConfirmLastMsgIDReq, opts ...grpc.CallOption) (*ConfirmLastMsgIDResp, error) } type offlineMessageServiceClient struct { @@ -117,7 +131,16 @@ func NewOfflineMessageServiceClient(cc grpc.ClientConnInterface) OfflineMessageS func (c *offlineMessageServiceClient) QueryOfflineMessage(ctx context.Context, in *QueryOfflineMessageReq, opts ...grpc.CallOption) (*QueryOfflineMessageResp, error) { out := new(QueryOfflineMessageResp) - err := c.cc.Invoke(ctx, "/api.message.v1.OfflineMessageService/QueryOfflineMessage", in, out, opts...) + err := c.cc.Invoke(ctx, OfflineMessageService_QueryOfflineMessage_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *offlineMessageServiceClient) ConfirmLastMstID(ctx context.Context, in *ConfirmLastMsgIDReq, opts ...grpc.CallOption) (*ConfirmLastMsgIDResp, error) { + out := new(ConfirmLastMsgIDResp) + err := c.cc.Invoke(ctx, OfflineMessageService_ConfirmLastMstID_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -129,6 +152,7 @@ func (c *offlineMessageServiceClient) QueryOfflineMessage(ctx context.Context, i // for forward compatibility type OfflineMessageServiceServer interface { QueryOfflineMessage(context.Context, *QueryOfflineMessageReq) (*QueryOfflineMessageResp, error) + ConfirmLastMstID(context.Context, *ConfirmLastMsgIDReq) (*ConfirmLastMsgIDResp, error) mustEmbedUnimplementedOfflineMessageServiceServer() } @@ -139,6 +163,9 @@ type UnimplementedOfflineMessageServiceServer struct { func (UnimplementedOfflineMessageServiceServer) QueryOfflineMessage(context.Context, *QueryOfflineMessageReq) (*QueryOfflineMessageResp, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryOfflineMessage not implemented") } +func (UnimplementedOfflineMessageServiceServer) ConfirmLastMstID(context.Context, *ConfirmLastMsgIDReq) (*ConfirmLastMsgIDResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfirmLastMstID not implemented") +} func (UnimplementedOfflineMessageServiceServer) mustEmbedUnimplementedOfflineMessageServiceServer() {} // UnsafeOfflineMessageServiceServer may be embedded to opt out of forward compatibility for this service. @@ -162,7 +189,7 @@ func _OfflineMessageService_QueryOfflineMessage_Handler(srv interface{}, ctx con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.message.v1.OfflineMessageService/QueryOfflineMessage", + FullMethod: OfflineMessageService_QueryOfflineMessage_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(OfflineMessageServiceServer).QueryOfflineMessage(ctx, req.(*QueryOfflineMessageReq)) @@ -170,6 +197,24 @@ func _OfflineMessageService_QueryOfflineMessage_Handler(srv interface{}, ctx con return interceptor(ctx, in, info, handler) } +func _OfflineMessageService_ConfirmLastMstID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfirmLastMsgIDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfflineMessageServiceServer).ConfirmLastMstID(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OfflineMessageService_ConfirmLastMstID_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfflineMessageServiceServer).ConfirmLastMstID(ctx, req.(*ConfirmLastMsgIDReq)) + } + return interceptor(ctx, in, info, handler) +} + // OfflineMessageService_ServiceDesc is the grpc.ServiceDesc for OfflineMessageService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -181,6 +226,137 @@ var OfflineMessageService_ServiceDesc = grpc.ServiceDesc{ MethodName: "QueryOfflineMessage", Handler: _OfflineMessageService_QueryOfflineMessage_Handler, }, + { + MethodName: "ConfirmLastMstID", + Handler: _OfflineMessageService_ConfirmLastMstID_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "message/v1/message.proto", +} + +const ( + HistoryMessageService_QuerySessionHistoryMessage_FullMethodName = "/api.message.v1.HistoryMessageService/QuerySessionHistoryMessage" + HistoryMessageService_SyncHistoryMessage_FullMethodName = "/api.message.v1.HistoryMessageService/SyncHistoryMessage" +) + +// HistoryMessageServiceClient is the client API for HistoryMessageService 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. +type HistoryMessageServiceClient interface { + QuerySessionHistoryMessage(ctx context.Context, in *QuerySessionHistoryMessageReq, opts ...grpc.CallOption) (*QuerySessionHistoryMessageResp, error) + SyncHistoryMessage(ctx context.Context, in *SyncHistoryMessageReq, opts ...grpc.CallOption) (*SyncHistoryMessageResp, error) +} + +type historyMessageServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewHistoryMessageServiceClient(cc grpc.ClientConnInterface) HistoryMessageServiceClient { + return &historyMessageServiceClient{cc} +} + +func (c *historyMessageServiceClient) QuerySessionHistoryMessage(ctx context.Context, in *QuerySessionHistoryMessageReq, opts ...grpc.CallOption) (*QuerySessionHistoryMessageResp, error) { + out := new(QuerySessionHistoryMessageResp) + err := c.cc.Invoke(ctx, HistoryMessageService_QuerySessionHistoryMessage_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *historyMessageServiceClient) SyncHistoryMessage(ctx context.Context, in *SyncHistoryMessageReq, opts ...grpc.CallOption) (*SyncHistoryMessageResp, error) { + out := new(SyncHistoryMessageResp) + err := c.cc.Invoke(ctx, HistoryMessageService_SyncHistoryMessage_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// HistoryMessageServiceServer is the server API for HistoryMessageService service. +// All implementations must embed UnimplementedHistoryMessageServiceServer +// for forward compatibility +type HistoryMessageServiceServer interface { + QuerySessionHistoryMessage(context.Context, *QuerySessionHistoryMessageReq) (*QuerySessionHistoryMessageResp, error) + SyncHistoryMessage(context.Context, *SyncHistoryMessageReq) (*SyncHistoryMessageResp, error) + mustEmbedUnimplementedHistoryMessageServiceServer() +} + +// UnimplementedHistoryMessageServiceServer must be embedded to have forward compatible implementations. +type UnimplementedHistoryMessageServiceServer struct { +} + +func (UnimplementedHistoryMessageServiceServer) QuerySessionHistoryMessage(context.Context, *QuerySessionHistoryMessageReq) (*QuerySessionHistoryMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method QuerySessionHistoryMessage not implemented") +} +func (UnimplementedHistoryMessageServiceServer) SyncHistoryMessage(context.Context, *SyncHistoryMessageReq) (*SyncHistoryMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method SyncHistoryMessage not implemented") +} +func (UnimplementedHistoryMessageServiceServer) mustEmbedUnimplementedHistoryMessageServiceServer() {} + +// UnsafeHistoryMessageServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to HistoryMessageServiceServer will +// result in compilation errors. +type UnsafeHistoryMessageServiceServer interface { + mustEmbedUnimplementedHistoryMessageServiceServer() +} + +func RegisterHistoryMessageServiceServer(s grpc.ServiceRegistrar, srv HistoryMessageServiceServer) { + s.RegisterService(&HistoryMessageService_ServiceDesc, srv) +} + +func _HistoryMessageService_QuerySessionHistoryMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySessionHistoryMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HistoryMessageServiceServer).QuerySessionHistoryMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HistoryMessageService_QuerySessionHistoryMessage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HistoryMessageServiceServer).QuerySessionHistoryMessage(ctx, req.(*QuerySessionHistoryMessageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _HistoryMessageService_SyncHistoryMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SyncHistoryMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(HistoryMessageServiceServer).SyncHistoryMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: HistoryMessageService_SyncHistoryMessage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(HistoryMessageServiceServer).SyncHistoryMessage(ctx, req.(*SyncHistoryMessageReq)) + } + return interceptor(ctx, in, info, handler) +} + +// HistoryMessageService_ServiceDesc is the grpc.ServiceDesc for HistoryMessageService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var HistoryMessageService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.message.v1.HistoryMessageService", + HandlerType: (*HistoryMessageServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "QuerySessionHistoryMessage", + Handler: _HistoryMessageService_QuerySessionHistoryMessage_Handler, + }, + { + MethodName: "SyncHistoryMessage", + Handler: _HistoryMessageService_SyncHistoryMessage_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "message/v1/message.proto", diff --git a/third-party/validate/validate.proto b/third-party/validate/validate.proto new file mode 100644 index 0000000..5aa9653 --- /dev/null +++ b/third-party/validate/validate.proto @@ -0,0 +1,862 @@ +syntax = "proto2"; +package validate; + +option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; +option java_package = "io.envoyproxy.pgv.validate"; + +import "google/protobuf/descriptor.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +// Validation rules applied at the message level +extend google.protobuf.MessageOptions { + // Disabled nullifies any validation rules for this message, including any + // message fields associated with it that do support validation. + optional bool disabled = 1071; + // Ignore skips generation of validation methods for this message. + optional bool ignored = 1072; +} + +// Validation rules applied at the oneof level +extend google.protobuf.OneofOptions { + // Required ensures that exactly one the field options in a oneof is set; + // validation fails if no fields in the oneof are set. + optional bool required = 1071; +} + +// Validation rules applied at the field level +extend google.protobuf.FieldOptions { + // Rules specify the validations to be performed on this field. By default, + // no validation is performed against a field. + optional FieldRules rules = 1071; +} + +// FieldRules encapsulates the rules for each type of field. Depending on the +// field, the correct set should be used to ensure proper validations. +message FieldRules { + optional MessageRules message = 17; + oneof type { + // Scalar Field Types + FloatRules float = 1; + DoubleRules double = 2; + Int32Rules int32 = 3; + Int64Rules int64 = 4; + UInt32Rules uint32 = 5; + UInt64Rules uint64 = 6; + SInt32Rules sint32 = 7; + SInt64Rules sint64 = 8; + Fixed32Rules fixed32 = 9; + Fixed64Rules fixed64 = 10; + SFixed32Rules sfixed32 = 11; + SFixed64Rules sfixed64 = 12; + BoolRules bool = 13; + StringRules string = 14; + BytesRules bytes = 15; + + // Complex Field Types + EnumRules enum = 16; + RepeatedRules repeated = 18; + MapRules map = 19; + + // Well-Known Field Types + AnyRules any = 20; + DurationRules duration = 21; + TimestampRules timestamp = 22; + } +} + +// FloatRules describes the constraints applied to `float` values +message FloatRules { + // Const specifies that this field must be exactly the specified value + optional float const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional float lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional float lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional float gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional float gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated float in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated float not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// DoubleRules describes the constraints applied to `double` values +message DoubleRules { + // Const specifies that this field must be exactly the specified value + optional double const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional double lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional double lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional double gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional double gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated double in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated double not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Int32Rules describes the constraints applied to `int32` values +message Int32Rules { + // Const specifies that this field must be exactly the specified value + optional int32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional int32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional int32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional int32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional int32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated int32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated int32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Int64Rules describes the constraints applied to `int64` values +message Int64Rules { + // Const specifies that this field must be exactly the specified value + optional int64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional int64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional int64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional int64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional int64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated int64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated int64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// UInt32Rules describes the constraints applied to `uint32` values +message UInt32Rules { + // Const specifies that this field must be exactly the specified value + optional uint32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional uint32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional uint32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional uint32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional uint32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated uint32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated uint32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// UInt64Rules describes the constraints applied to `uint64` values +message UInt64Rules { + // Const specifies that this field must be exactly the specified value + optional uint64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional uint64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional uint64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional uint64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional uint64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated uint64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated uint64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SInt32Rules describes the constraints applied to `sint32` values +message SInt32Rules { + // Const specifies that this field must be exactly the specified value + optional sint32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sint32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sint32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sint32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sint32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sint32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sint32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SInt64Rules describes the constraints applied to `sint64` values +message SInt64Rules { + // Const specifies that this field must be exactly the specified value + optional sint64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sint64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sint64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sint64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sint64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sint64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sint64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Fixed32Rules describes the constraints applied to `fixed32` values +message Fixed32Rules { + // Const specifies that this field must be exactly the specified value + optional fixed32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional fixed32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional fixed32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional fixed32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional fixed32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated fixed32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated fixed32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// Fixed64Rules describes the constraints applied to `fixed64` values +message Fixed64Rules { + // Const specifies that this field must be exactly the specified value + optional fixed64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional fixed64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional fixed64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional fixed64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional fixed64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated fixed64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated fixed64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SFixed32Rules describes the constraints applied to `sfixed32` values +message SFixed32Rules { + // Const specifies that this field must be exactly the specified value + optional sfixed32 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sfixed32 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sfixed32 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sfixed32 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sfixed32 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sfixed32 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sfixed32 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// SFixed64Rules describes the constraints applied to `sfixed64` values +message SFixed64Rules { + // Const specifies that this field must be exactly the specified value + optional sfixed64 const = 1; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional sfixed64 lt = 2; + + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + optional sfixed64 lte = 3; + + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + optional sfixed64 gt = 4; + + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + optional sfixed64 gte = 5; + + // In specifies that this field must be equal to one of the specified + // values + repeated sfixed64 in = 6; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated sfixed64 not_in = 7; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 8; +} + +// BoolRules describes the constraints applied to `bool` values +message BoolRules { + // Const specifies that this field must be exactly the specified value + optional bool const = 1; +} + +// StringRules describe the constraints applied to `string` values +message StringRules { + // Const specifies that this field must be exactly the specified value + optional string const = 1; + + // Len specifies that this field must be the specified number of + // characters (Unicode code points). Note that the number of + // characters may differ from the number of bytes in the string. + optional uint64 len = 19; + + // MinLen specifies that this field must be the specified number of + // characters (Unicode code points) at a minimum. Note that the number of + // characters may differ from the number of bytes in the string. + optional uint64 min_len = 2; + + // MaxLen specifies that this field must be the specified number of + // characters (Unicode code points) at a maximum. Note that the number of + // characters may differ from the number of bytes in the string. + optional uint64 max_len = 3; + + // LenBytes specifies that this field must be the specified number of bytes + optional uint64 len_bytes = 20; + + // MinBytes specifies that this field must be the specified number of bytes + // at a minimum + optional uint64 min_bytes = 4; + + // MaxBytes specifies that this field must be the specified number of bytes + // at a maximum + optional uint64 max_bytes = 5; + + // Pattern specifies that this field must match against the specified + // regular expression (RE2 syntax). The included expression should elide + // any delimiters. + optional string pattern = 6; + + // Prefix specifies that this field must have the specified substring at + // the beginning of the string. + optional string prefix = 7; + + // Suffix specifies that this field must have the specified substring at + // the end of the string. + optional string suffix = 8; + + // Contains specifies that this field must have the specified substring + // anywhere in the string. + optional string contains = 9; + + // NotContains specifies that this field cannot have the specified substring + // anywhere in the string. + optional string not_contains = 23; + + // In specifies that this field must be equal to one of the specified + // values + repeated string in = 10; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated string not_in = 11; + + // WellKnown rules provide advanced constraints against common string + // patterns + oneof well_known { + // Email specifies that the field must be a valid email address as + // defined by RFC 5322 + bool email = 12; + + // Hostname specifies that the field must be a valid hostname as + // defined by RFC 1034. This constraint does not support + // internationalized domain names (IDNs). + bool hostname = 13; + + // Ip specifies that the field must be a valid IP (v4 or v6) address. + // Valid IPv6 addresses should not include surrounding square brackets. + bool ip = 14; + + // Ipv4 specifies that the field must be a valid IPv4 address. + bool ipv4 = 15; + + // Ipv6 specifies that the field must be a valid IPv6 address. Valid + // IPv6 addresses should not include surrounding square brackets. + bool ipv6 = 16; + + // Uri specifies that the field must be a valid, absolute URI as defined + // by RFC 3986 + bool uri = 17; + + // UriRef specifies that the field must be a valid URI as defined by RFC + // 3986 and may be relative or absolute. + bool uri_ref = 18; + + // Address specifies that the field must be either a valid hostname as + // defined by RFC 1034 (which does not support internationalized domain + // names or IDNs), or it can be a valid IP (v4 or v6). + bool address = 21; + + // Uuid specifies that the field must be a valid UUID as defined by + // RFC 4122 + bool uuid = 22; + + // WellKnownRegex specifies a common well known pattern defined as a regex. + KnownRegex well_known_regex = 24; + } + + // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable + // strict header validation. + // By default, this is true, and HTTP header validations are RFC-compliant. + // Setting to false will enable a looser validations that only disallows + // \r\n\0 characters, which can be used to bypass header matching rules. + optional bool strict = 25 [default = true]; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 26; +} + +// WellKnownRegex contain some well-known patterns. +enum KnownRegex { + UNKNOWN = 0; + + // HTTP header name as defined by RFC 7230. + HTTP_HEADER_NAME = 1; + + // HTTP header value as defined by RFC 7230. + HTTP_HEADER_VALUE = 2; +} + +// BytesRules describe the constraints applied to `bytes` values +message BytesRules { + // Const specifies that this field must be exactly the specified value + optional bytes const = 1; + + // Len specifies that this field must be the specified number of bytes + optional uint64 len = 13; + + // MinLen specifies that this field must be the specified number of bytes + // at a minimum + optional uint64 min_len = 2; + + // MaxLen specifies that this field must be the specified number of bytes + // at a maximum + optional uint64 max_len = 3; + + // Pattern specifies that this field must match against the specified + // regular expression (RE2 syntax). The included expression should elide + // any delimiters. + optional string pattern = 4; + + // Prefix specifies that this field must have the specified bytes at the + // beginning of the string. + optional bytes prefix = 5; + + // Suffix specifies that this field must have the specified bytes at the + // end of the string. + optional bytes suffix = 6; + + // Contains specifies that this field must have the specified bytes + // anywhere in the string. + optional bytes contains = 7; + + // In specifies that this field must be equal to one of the specified + // values + repeated bytes in = 8; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated bytes not_in = 9; + + // WellKnown rules provide advanced constraints against common byte + // patterns + oneof well_known { + // Ip specifies that the field must be a valid IP (v4 or v6) address in + // byte format + bool ip = 10; + + // Ipv4 specifies that the field must be a valid IPv4 address in byte + // format + bool ipv4 = 11; + + // Ipv6 specifies that the field must be a valid IPv6 address in byte + // format + bool ipv6 = 12; + } + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 14; +} + +// EnumRules describe the constraints applied to enum values +message EnumRules { + // Const specifies that this field must be exactly the specified value + optional int32 const = 1; + + // DefinedOnly specifies that this field must be only one of the defined + // values for this enum, failing on any undefined value. + optional bool defined_only = 2; + + // In specifies that this field must be equal to one of the specified + // values + repeated int32 in = 3; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated int32 not_in = 4; +} + +// MessageRules describe the constraints applied to embedded message values. +// For message-type fields, validation is performed recursively. +message MessageRules { + // Skip specifies that the validation rules of this field should not be + // evaluated + optional bool skip = 1; + + // Required specifies that this field must be set + optional bool required = 2; +} + +// RepeatedRules describe the constraints applied to `repeated` values +message RepeatedRules { + // MinItems specifies that this field must have the specified number of + // items at a minimum + optional uint64 min_items = 1; + + // MaxItems specifies that this field must have the specified number of + // items at a maximum + optional uint64 max_items = 2; + + // Unique specifies that all elements in this field must be unique. This + // constraint is only applicable to scalar and enum types (messages are not + // supported). + optional bool unique = 3; + + // Items specifies the constraints to be applied to each item in the field. + // Repeated message fields will still execute validation against each item + // unless skip is specified here. + optional FieldRules items = 4; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 5; +} + +// MapRules describe the constraints applied to `map` values +message MapRules { + // MinPairs specifies that this field must have the specified number of + // KVs at a minimum + optional uint64 min_pairs = 1; + + // MaxPairs specifies that this field must have the specified number of + // KVs at a maximum + optional uint64 max_pairs = 2; + + // NoSparse specifies values in this field cannot be unset. This only + // applies to map's with message value types. + optional bool no_sparse = 3; + + // Keys specifies the constraints to be applied to each key in the field. + optional FieldRules keys = 4; + + // Values specifies the constraints to be applied to the value of each key + // in the field. Message values will still have their validations evaluated + // unless skip is specified here. + optional FieldRules values = 5; + + // IgnoreEmpty specifies that the validation rules of this field should be + // evaluated only if the field is not empty + optional bool ignore_empty = 6; +} + +// AnyRules describe constraints applied exclusively to the +// `google.protobuf.Any` well-known type +message AnyRules { + // Required specifies that this field must be set + optional bool required = 1; + + // In specifies that this field's `type_url` must be equal to one of the + // specified values. + repeated string in = 2; + + // NotIn specifies that this field's `type_url` must not be equal to any of + // the specified values. + repeated string not_in = 3; +} + +// DurationRules describe the constraints applied exclusively to the +// `google.protobuf.Duration` well-known type +message DurationRules { + // Required specifies that this field must be set + optional bool required = 1; + + // Const specifies that this field must be exactly the specified value + optional google.protobuf.Duration const = 2; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional google.protobuf.Duration lt = 3; + + // Lt specifies that this field must be less than the specified value, + // inclusive + optional google.protobuf.Duration lte = 4; + + // Gt specifies that this field must be greater than the specified value, + // exclusive + optional google.protobuf.Duration gt = 5; + + // Gte specifies that this field must be greater than the specified value, + // inclusive + optional google.protobuf.Duration gte = 6; + + // In specifies that this field must be equal to one of the specified + // values + repeated google.protobuf.Duration in = 7; + + // NotIn specifies that this field cannot be equal to one of the specified + // values + repeated google.protobuf.Duration not_in = 8; +} + +// TimestampRules describe the constraints applied exclusively to the +// `google.protobuf.Timestamp` well-known type +message TimestampRules { + // Required specifies that this field must be set + optional bool required = 1; + + // Const specifies that this field must be exactly the specified value + optional google.protobuf.Timestamp const = 2; + + // Lt specifies that this field must be less than the specified value, + // exclusive + optional google.protobuf.Timestamp lt = 3; + + // Lte specifies that this field must be less than the specified value, + // inclusive + optional google.protobuf.Timestamp lte = 4; + + // Gt specifies that this field must be greater than the specified value, + // exclusive + optional google.protobuf.Timestamp gt = 5; + + // Gte specifies that this field must be greater than the specified value, + // inclusive + optional google.protobuf.Timestamp gte = 6; + + // LtNow specifies that this must be less than the current time. LtNow + // can only be used with the Within rule. + optional bool lt_now = 7; + + // GtNow specifies that this must be greater than the current time. GtNow + // can only be used with the Within rule. + optional bool gt_now = 8; + + // Within specifies that this field must be within this duration of the + // current time. This constraint can be used alone or with the LtNow and + // GtNow rules. + optional google.protobuf.Duration within = 9; +} diff --git a/transport/response/response.ext.go b/transport/response/response.ext.go deleted file mode 100644 index 71dee21..0000000 --- a/transport/response/response.ext.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code Written Manually - -package response - -import ( - "fmt" -) - -/* - * Define BaseResponse - */ - -var _ error = &BaseResponse{} - -func NewBaseResponse(code Code) *BaseResponse { - return &BaseResponse{ - Code: code, - Reason: code.String(), - } -} - -func NewBaseResponseWithMessage(code Code, msg string) *BaseResponse { - return &BaseResponse{ - Code: code, - Reason: code.String(), - Message: msg, - } -} - -func NewBaseResponseWithError(err error) *BaseResponse { - // check err is BaseResponse - if br, ok := err.(*BaseResponse); ok { - return br - } - - return &BaseResponse{ - Code: Code_InternalError, - Reason: Code_InternalError.String(), - Message: err.Error(), - } -} - -func (x *BaseResponse) Error() string { - return fmt.Sprintf("Code: %d, Reason: %s, Message: %s", x.Code, x.Reason, x.Message) -} - -func (x *BaseResponse) Success() bool { - return x.Code == Code_OK -} - -func (x *BaseResponse) SetMessage(msg string) *BaseResponse { - x.Message = msg - return x -} - -/* - * Code - */ - -func (x Code) BaseResponse() *BaseResponse { - return NewBaseResponse(x) -} - -func (x Code) BaseResponseWithMessage(msg string) *BaseResponse { - return NewBaseResponseWithMessage(x, msg) -} - -func (x Code) BaseResponseWithError(err error) *BaseResponse { - return NewBaseResponseWithMessage(x, err.Error()) -} diff --git a/transport/response/response.pb.go b/transport/response/response.pb.go deleted file mode 100644 index a21b093..0000000 --- a/transport/response/response.pb.go +++ /dev/null @@ -1,301 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc (unknown) -// source: transport/response/response.proto - -package response - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -type Code int32 - -const ( - Code_OK Code = 0 - // common error codes - Code_InternalError Code = 10001 - Code_InvalidParams Code = 10002 - Code_DBError Code = 10003 - Code_CacheError Code = 10004 - // user error codes - Code_UserNotExist Code = 20001 - Code_UserExist Code = 20002 - Code_InvalidUsernameOrPassword Code = 20003 - // relation error codes - Code_RelationNotExist Code = 30001 - Code_RelationExist Code = 30002 - Code_InvalidUpdateRelationAction Code = 30003 - // friend request error codes - Code_FriendRequestNotExist Code = 31001 - Code_FriendRequestStatusError Code = 31002 - // push server error codes - Code_UserNotOnline Code = 40001 - // group error codes - Code_GroupNotExist Code = 50001 - Code_GroupExist Code = 50002 - Code_NotGroupMember Code = 50003 - Code_NotGroupOwner Code = 50004 - Code_GroupLimitExceed Code = 50005 -) - -// Enum value maps for Code. -var ( - Code_name = map[int32]string{ - 0: "OK", - 10001: "InternalError", - 10002: "InvalidParams", - 10003: "DBError", - 10004: "CacheError", - 20001: "UserNotExist", - 20002: "UserExist", - 20003: "InvalidUsernameOrPassword", - 30001: "RelationNotExist", - 30002: "RelationExist", - 30003: "InvalidUpdateRelationAction", - 31001: "FriendRequestNotExist", - 31002: "FriendRequestStatusError", - 40001: "UserNotOnline", - 50001: "GroupNotExist", - 50002: "GroupExist", - 50003: "NotGroupMember", - 50004: "NotGroupOwner", - 50005: "GroupLimitExceed", - } - Code_value = map[string]int32{ - "OK": 0, - "InternalError": 10001, - "InvalidParams": 10002, - "DBError": 10003, - "CacheError": 10004, - "UserNotExist": 20001, - "UserExist": 20002, - "InvalidUsernameOrPassword": 20003, - "RelationNotExist": 30001, - "RelationExist": 30002, - "InvalidUpdateRelationAction": 30003, - "FriendRequestNotExist": 31001, - "FriendRequestStatusError": 31002, - "UserNotOnline": 40001, - "GroupNotExist": 50001, - "GroupExist": 50002, - "NotGroupMember": 50003, - "NotGroupOwner": 50004, - "GroupLimitExceed": 50005, - } -) - -func (x Code) Enum() *Code { - p := new(Code) - *p = x - return p -} - -func (x Code) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Code) Descriptor() protoreflect.EnumDescriptor { - return file_transport_response_response_proto_enumTypes[0].Descriptor() -} - -func (Code) Type() protoreflect.EnumType { - return &file_transport_response_response_proto_enumTypes[0] -} - -func (x Code) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Code.Descriptor instead. -func (Code) EnumDescriptor() ([]byte, []int) { - return file_transport_response_response_proto_rawDescGZIP(), []int{0} -} - -// BaseResponse use as define response code and message -type BaseResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Code Code `protobuf:"varint,1,opt,name=code,proto3,enum=api.transport.response.Code" json:"code,omitempty"` - Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"` - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` -} - -func (x *BaseResponse) Reset() { - *x = BaseResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_transport_response_response_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BaseResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BaseResponse) ProtoMessage() {} - -func (x *BaseResponse) ProtoReflect() protoreflect.Message { - mi := &file_transport_response_response_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) -} - -// Deprecated: Use BaseResponse.ProtoReflect.Descriptor instead. -func (*BaseResponse) Descriptor() ([]byte, []int) { - return file_transport_response_response_proto_rawDescGZIP(), []int{0} -} - -func (x *BaseResponse) GetCode() Code { - if x != nil { - return x.Code - } - return Code_OK -} - -func (x *BaseResponse) GetReason() string { - if x != nil { - return x.Reason - } - return "" -} - -func (x *BaseResponse) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -var File_transport_response_response_proto protoreflect.FileDescriptor - -var file_transport_response_response_proto_rawDesc = []byte{ - 0x0a, 0x21, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x16, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x72, 0x0a, 0x0c, 0x42, - 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, - 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, - 0xa7, 0x03, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x00, - 0x12, 0x12, 0x0a, 0x0d, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x10, 0x91, 0x4e, 0x12, 0x12, 0x0a, 0x0d, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x10, 0x92, 0x4e, 0x12, 0x0c, 0x0a, 0x07, 0x44, 0x42, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x10, 0x93, 0x4e, 0x12, 0x0f, 0x0a, 0x0a, 0x43, 0x61, 0x63, 0x68, 0x65, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x10, 0x94, 0x4e, 0x12, 0x12, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x4e, - 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xa1, 0x9c, 0x01, 0x12, 0x0f, 0x0a, 0x09, 0x55, - 0x73, 0x65, 0x72, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xa2, 0x9c, 0x01, 0x12, 0x1f, 0x0a, 0x19, - 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x4f, - 0x72, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x10, 0xa3, 0x9c, 0x01, 0x12, 0x16, 0x0a, - 0x10, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, - 0x74, 0x10, 0xb1, 0xea, 0x01, 0x12, 0x13, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0xb2, 0xea, 0x01, 0x12, 0x21, 0x0a, 0x1b, 0x49, 0x6e, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x10, 0xb3, 0xea, 0x01, 0x12, 0x1b, 0x0a, - 0x15, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4e, 0x6f, - 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0x99, 0xf2, 0x01, 0x12, 0x1e, 0x0a, 0x18, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x9a, 0xf2, 0x01, 0x12, 0x13, 0x0a, 0x0d, 0x55, 0x73, - 0x65, 0x72, 0x4e, 0x6f, 0x74, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x10, 0xc1, 0xb8, 0x02, 0x12, - 0x13, 0x0a, 0x0d, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4e, 0x6f, 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, - 0x10, 0xd1, 0x86, 0x03, 0x12, 0x10, 0x0a, 0x0a, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x45, 0x78, 0x69, - 0x73, 0x74, 0x10, 0xd2, 0x86, 0x03, 0x12, 0x14, 0x0a, 0x0e, 0x4e, 0x6f, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x10, 0xd3, 0x86, 0x03, 0x12, 0x13, 0x0a, 0x0d, - 0x4e, 0x6f, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x10, 0xd4, 0x86, - 0x03, 0x12, 0x16, 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x45, - 0x78, 0x63, 0x65, 0x65, 0x64, 0x10, 0xd5, 0x86, 0x03, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_transport_response_response_proto_rawDescOnce sync.Once - file_transport_response_response_proto_rawDescData = file_transport_response_response_proto_rawDesc -) - -func file_transport_response_response_proto_rawDescGZIP() []byte { - file_transport_response_response_proto_rawDescOnce.Do(func() { - file_transport_response_response_proto_rawDescData = protoimpl.X.CompressGZIP(file_transport_response_response_proto_rawDescData) - }) - return file_transport_response_response_proto_rawDescData -} - -var file_transport_response_response_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_transport_response_response_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_transport_response_response_proto_goTypes = []interface{}{ - (Code)(0), // 0: api.transport.response.Code - (*BaseResponse)(nil), // 1: api.transport.response.BaseResponse -} -var file_transport_response_response_proto_depIdxs = []int32{ - 0, // 0: api.transport.response.BaseResponse.code:type_name -> api.transport.response.Code - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_transport_response_response_proto_init() } -func file_transport_response_response_proto_init() { - if File_transport_response_response_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_transport_response_response_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BaseResponse); 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_transport_response_response_proto_rawDesc, - NumEnums: 1, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_transport_response_response_proto_goTypes, - DependencyIndexes: file_transport_response_response_proto_depIdxs, - EnumInfos: file_transport_response_response_proto_enumTypes, - MessageInfos: file_transport_response_response_proto_msgTypes, - }.Build() - File_transport_response_response_proto = out.File - file_transport_response_response_proto_rawDesc = nil - file_transport_response_response_proto_goTypes = nil - file_transport_response_response_proto_depIdxs = nil -} diff --git a/transport/response/response.pb.validate.go b/transport/response/response.pb.validate.go deleted file mode 100644 index 0810e92..0000000 --- a/transport/response/response.pb.validate.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: transport/response/response.proto - -package response - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) - -// Validate checks the field values on BaseResponse with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *BaseResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on BaseResponse with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in BaseResponseMultiError, or -// nil if none found. -func (m *BaseResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *BaseResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Code - - // no validation rules for Reason - - // no validation rules for Message - - if len(errors) > 0 { - return BaseResponseMultiError(errors) - } - - return nil -} - -// BaseResponseMultiError is an error wrapping multiple validation errors -// returned by BaseResponse.ValidateAll() if the designated constraints aren't met. -type BaseResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m BaseResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m BaseResponseMultiError) AllErrors() []error { return m } - -// BaseResponseValidationError is the validation error returned by -// BaseResponse.Validate if the designated constraints aren't met. -type BaseResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e BaseResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e BaseResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e BaseResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e BaseResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e BaseResponseValidationError) ErrorName() string { return "BaseResponseValidationError" } - -// Error satisfies the builtin error interface -func (e BaseResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sBaseResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = BaseResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = BaseResponseValidationError{} diff --git a/types/default_node.go b/types/default_node.go new file mode 100644 index 0000000..2eb35a5 --- /dev/null +++ b/types/default_node.go @@ -0,0 +1,23 @@ +package types + +import ( + "github.com/go-goim/api/types/snowflake" +) + +var ( + defaultNode *snowflake.Node +) + +func SetDefaultNode(nodeBit int64) { + var err error + defaultNode, err = snowflake.NewNode(nodeBit) + if err != nil { + panic(err) + } +} + +func assertDefaultNode() { + if defaultNode == nil { + panic("default node is not set") + } +} diff --git a/types/id.go b/types/id.go new file mode 100644 index 0000000..d60b7a1 --- /dev/null +++ b/types/id.go @@ -0,0 +1,275 @@ +package types + +import ( + "encoding/base64" + "encoding/binary" + "errors" + "fmt" + "strconv" +) + +const encodeBase32Map = "ybndrfg8ejkmcpqxot1uwisza345h769" + +var decodeBase32Map [256]byte + +const encodeBase58Map = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ" + +var decodeBase58Map [256]byte + +// Create maps for decoding Base58/Base32. +// This speeds up the process tremendously. +func init() { + for i := 0; i < len(decodeBase58Map); i++ { + decodeBase58Map[i] = 0xFF + } + + for i := 0; i < len(encodeBase58Map); i++ { + decodeBase58Map[encodeBase58Map[i]] = byte(i) + } + + for i := 0; i < len(decodeBase32Map); i++ { + decodeBase32Map[i] = 0xFF + } + + for i := 0; i < len(encodeBase32Map); i++ { + decodeBase32Map[encodeBase32Map[i]] = byte(i) + } +} + +// A JSONSyntaxError is returned from UnmarshalJSON if an invalid ID is provided. +type JSONSyntaxError struct{ original []byte } + +func (j JSONSyntaxError) Error() string { + return fmt.Sprintf("invalid snowflake ID %q", string(j.original)) +} + +// ErrInvalidBase58 is returned by ParseBase58 when given an invalid []byte +var ErrInvalidBase58 = errors.New("invalid base58") + +// ErrInvalidBase32 is returned by ParseBase32 when given an invalid []byte +var ErrInvalidBase32 = errors.New("invalid base32") + +// ID represents a unique snowflake ID. +type ID int64 + +// NewID returns a new snowflake ID +func NewID() ID { + assertDefaultNode() + return ID(defaultNode.Generate()) +} + +// Note: If you want to get string of base58, use Base58() instead. +// ID.String() returns string(int64) and Base58() returns base58 string. + +// Int64 returns an int64 of the snowflake ID +func (f *ID) Int64() int64 { + return int64(*f) +} + +// ParseInt64 converts an int64 into a snowflake ID +func ParseInt64(id int64) ID { + return ID(id) +} + +// String returns a string of the snowflake ID +func (f *ID) String() string { + return strconv.FormatInt(int64(*f), 10) +} + +// ParseString converts a string into a snowflake ID +func ParseString(id string) (ID, error) { + i, err := strconv.ParseInt(id, 10, 64) + return ID(i), err + +} + +// Base2 returns a string base2 of the snowflake ID +func (f *ID) Base2() string { + return strconv.FormatInt(int64(*f), 2) +} + +// ParseBase2 converts a Base2 string into a snowflake ID +func ParseBase2(id string) (ID, error) { + i, err := strconv.ParseInt(id, 2, 64) + return ID(i), err +} + +// Base8 returns a string base8 of the snowflake ID +func (f *ID) Base8() string { + return strconv.FormatInt(int64(*f), 8) +} + +// ParseBase8 converts a Base8 string into a snowflake ID +func ParseBase8(id string) (ID, error) { + i, err := strconv.ParseInt(id, 8, 64) + return ID(i), err +} + +// Base16 returns a string base16 of the snowflake ID +func (f *ID) Base16() string { + return strconv.FormatInt(int64(*f), 16) +} + +// ParseBase16 converts a Base16 string into a snowflake ID +func ParseBase16(id string) (ID, error) { + i, err := strconv.ParseInt(id, 16, 64) + return ID(i), err +} + +// Base32 uses the z-base-32 character set but encodes and decodes similar +// to base58, allowing it to create an even smaller result string. +// NOTE: There are many base32 implementations so be careful when +// doing any interoperation. +func (f *ID) Base32() string { + id := *f + if id < 32 { + return string(encodeBase32Map[id]) + } + + b := make([]byte, 0, 12) + for id >= 32 { + b = append(b, encodeBase32Map[id%32]) + id /= 32 + } + b = append(b, encodeBase32Map[id]) + + for x, y := 0, len(b)-1; x < y; x, y = x+1, y-1 { + b[x], b[y] = b[y], b[x] + } + + return string(b) +} + +// ParseBase32 parses a base32 []byte into a snowflake ID +// NOTE: There are many base32 implementations so be careful when +// doing any interoperation. +func ParseBase32(b []byte) (ID, error) { + var id int64 + + for i := range b { + if decodeBase32Map[b[i]] == 0xFF { + return -1, ErrInvalidBase32 + } + id = id*32 + int64(decodeBase32Map[b[i]]) + } + + return ID(id), nil +} + +// Base36 returns a base36 string of the snowflake ID +func (f *ID) Base36() string { + return strconv.FormatInt(int64(*f), 36) +} + +// ParseBase36 converts a Base36 string into a snowflake ID +func ParseBase36(id string) (ID, error) { + i, err := strconv.ParseInt(id, 36, 64) + return ID(i), err +} + +// Base58 returns a base58 string of the snowflake ID +func (f *ID) Base58() string { + id := *f + if id < 58 { + return string(encodeBase58Map[id]) + } + + b := make([]byte, 0, 11) + for id >= 58 { + b = append(b, encodeBase58Map[id%58]) + id /= 58 + } + b = append(b, encodeBase58Map[id]) + + for x, y := 0, len(b)-1; x < y; x, y = x+1, y-1 { + b[x], b[y] = b[y], b[x] + } + + return string(b) +} + +// ParseBase58 parses a base58 []byte into a snowflake ID +func ParseBase58(b []byte) (ID, error) { + var id int64 + + for i := range b { + if decodeBase58Map[b[i]] == 0xFF { + return -1, ErrInvalidBase58 + } + id = id*58 + int64(decodeBase58Map[b[i]]) + } + + return ID(id), nil +} + +// Base64 returns a base64 string of the snowflake ID +func (f *ID) Base64() string { + return base64.StdEncoding.EncodeToString(f.Bytes()) +} + +// ParseBase64 converts a base64 string into a snowflake ID +func ParseBase64(id string) (ID, error) { + b, err := base64.StdEncoding.DecodeString(id) + if err != nil { + return -1, err + } + return ParseBytes(b) + +} + +// Bytes returns a byte slice of the snowflake ID +func (f *ID) Bytes() []byte { + return []byte(f.String()) +} + +// ParseBytes converts a byte slice into a snowflake ID +func ParseBytes(id []byte) (ID, error) { + i, err := strconv.ParseInt(string(id), 10, 64) + return ID(i), err +} + +// IntBytes returns an array of bytes of the snowflake ID, encoded as a +// big endian integer. +func (f *ID) IntBytes() [8]byte { + var b [8]byte + binary.BigEndian.PutUint64(b[:], uint64(*f)) + return b +} + +// ParseIntBytes converts an array of bytes encoded as big endian integer as +// a snowflake ID +func ParseIntBytes(id [8]byte) ID { + return ID(int64(binary.BigEndian.Uint64(id[:]))) +} + +// We use int64 in internal services and use base58 for external services(like clients). +// So those marshal/unmarshal methods are converts to/from base58. + +// MarshalJSON returns a json byte array string of the snowflake ID. +// Note: this is not regular MarshalJSON, it converts the ID to a base58 string, +// instead of a regular strconv.FormatInt(id,10). +func (f *ID) MarshalJSON() ([]byte, error) { + b58 := f.Base58() + buff := make([]byte, 0, len(b58)+2) + buff = append(buff, '"') + buff = append(buff, b58...) + buff = append(buff, '"') + return buff, nil +} + +// UnmarshalJSON converts a json byte array of a snowflake ID into an ID type. +// Note: this is not regular UnmarshalJSON, it converts the ID from a base58, +// instead of a regular strconv.ParseInt(id,10). +func (f *ID) UnmarshalJSON(b []byte) error { + if len(b) < 3 || b[0] != '"' || b[len(b)-1] != '"' { + return JSONSyntaxError{b} + } + + id, err := ParseBase58(b[1 : len(b)-1]) + if err != nil { + return err + } + + *f = id + return nil +} diff --git a/types/id_test.go b/types/id_test.go new file mode 100644 index 0000000..9f5cfaa --- /dev/null +++ b/types/id_test.go @@ -0,0 +1,72 @@ +package types + +import ( + "testing" + + "github.com/go-goim/api/types/snowflake" +) + +func TestID_Formats(t *testing.T) { + n, err := snowflake.NewNode(1) + if err != nil { + t.Fatal(err) + } + + id := ID(n.Generate()) + if id == 0 { + t.Fatal("id should not be 0") + } + + t.Log(id.String()) + t.Log(snowflake.TimeFromID(id.Int64())) + t.Log("base2", id.Base2()) + t.Log("base8", id.Base8()) + t.Log("base16", id.Base16()) + t.Log("base32", id.Base32()) + t.Log("base36", id.Base36()) + t.Log("base58", id.Base58()) + t.Log("base64", id.Base64()) + id2, err := ParseBase58([]byte(id.Base58())) + if err != nil { + t.Fatal(err) + } + if id != id2 { + t.Fatal("id should be equal to id2") + } + for i := 0; i < 10; i++ { + t.Log(n.Generate()) + } +} + +func TestID_UnmarshalJSON(t *testing.T) { + type args struct { + b []byte + } + tests := []struct { + name string + f ID + args args + wantID ID + wantErr bool + }{ + { + name: "base58", + f: ID(0), + args: args{ + b: []byte(`"aGgX1UU9Cq"`), + }, + wantErr: false, + wantID: ID(72006666064760832), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if err := tt.f.UnmarshalJSON(tt.args.b); (err != nil) != tt.wantErr { + t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) + } + if tt.f != tt.wantID { + t.Errorf("UnmarshalJSON() = %v, want %v", tt.f, tt.wantID) + } + }) + } +} diff --git a/types/snowflake/snowflake.go b/types/snowflake/snowflake.go new file mode 100644 index 0000000..50092d2 --- /dev/null +++ b/types/snowflake/snowflake.go @@ -0,0 +1,113 @@ +// Package snowflake provides a very simple Twitter snowflake generator and parser. +package snowflake + +import ( + "errors" + "strconv" + "sync" + "time" +) + +var ( + // Epoch is set to the twitter snowflake epoch of Jan 01 2022 00:00:00 UTC in milliseconds + // You may customize this to set a different epoch for your application. + Epoch int64 = 1640966400000 + + // NodeBits holds the number of bits to use for Node + // Remember, you have a total 22 bits to share between Node/Step + NodeBits uint8 = 10 + + // StepBits holds the number of bits to use for Step + // Remember, you have a total 22 bits to share between Node/Step + StepBits uint8 = 12 + + nodeMax int64 = -1 ^ (-1 << NodeBits) + nodeMask = nodeMax << StepBits + stepMask int64 = -1 ^ (-1 << StepBits) + timeShift = NodeBits + StepBits + nodeShift = StepBits +) + +// A Node struct holds the basic information needed for a snowflake generator +// node +type Node struct { + mu sync.Mutex + epoch time.Time + time int64 + node int64 + step int64 + + nodeMax int64 + nodeMask int64 + stepMask int64 + timeShift uint8 + nodeShift uint8 +} + +// NewNode returns a new snowflake node that can be used to generate snowflake +// IDs +func NewNode(node int64) (*Node, error) { + n := Node{} + n.node = node + n.nodeMax = -1 ^ (-1 << NodeBits) + n.nodeMask = n.nodeMax << StepBits + n.stepMask = -1 ^ (-1 << StepBits) + n.timeShift = NodeBits + StepBits + n.nodeShift = StepBits + + if n.node < 0 || n.node > n.nodeMax { + return nil, errors.New("Node number must be between 0 and " + strconv.FormatInt(n.nodeMax, 10)) + } + + var curTime = time.Now() + // add time.Duration to curTime to make sure we use the monotonic clock if available + n.epoch = curTime.Add(time.Unix(Epoch/1e3, (Epoch%1e3)*1e6).Sub(curTime)) + + return &n, nil +} + +// Generate creates and returns a unique snowflake ID +// To help guarantee uniqueness +// - Make sure your system is keeping accurate system time +// - Make sure you never have multiple nodes running with the same node ID +func (n *Node) Generate() int64 { + n.mu.Lock() + + now := time.Since(n.epoch).Milliseconds() + + if now == n.time { + n.step = (n.step + 1) & n.stepMask + + if n.step == 0 { + for now <= n.time { + now = time.Since(n.epoch).Milliseconds() + } + } + } else { + n.step = 0 + } + + n.time = now + + r := (now)<> timeShift) + Epoch +} + +// NodeFromID returns an int64 of the snowflake ID node number +func NodeFromID(id int64) int64 { + return id & nodeMask >> nodeShift +} + +// StepFromID returns an int64 of the snowflake step (or sequence) number +func StepFromID(id int64) int64 { + return id & stepMask +} diff --git a/types/snowflake/snowflake_test.go b/types/snowflake/snowflake_test.go new file mode 100644 index 0000000..3aea391 --- /dev/null +++ b/types/snowflake/snowflake_test.go @@ -0,0 +1,55 @@ +package snowflake + +import ( + "sync" + "testing" +) + +func BenchmarkGenerate(b *testing.B) { + n, err := NewNode(1) + if err != nil { + b.Fatal(err) + } + + for i := 0; i < b.N; i++ { + n.Generate() + } +} + +func TestIdDuplicate(t *testing.T) { + n, err := NewNode(1) + if err != nil { + t.Fatal(err) + } + + n2, err := NewNode(2) + if err != nil { + t.Fatal(err) + } + var ( + m sync.Map + wg sync.WaitGroup + fail bool + ) + f := func(node *Node) { + defer wg.Done() + for i := 0; i < 500_000; i++ { + id := node.Generate() + if _, ok := m.Load(id); ok { + fail = true + break + } + m.Store(id, id) + } + } + + wg.Add(2) + go f(n) + go f(n2) + wg.Wait() + if fail { + t.Fatal("duplicate id found") + } + + t.Log("ok") +} diff --git a/user/friend/v1/friend.pb.go b/user/friend/v1/friend.pb.go index bb82283..c681085 100644 --- a/user/friend/v1/friend.pb.go +++ b/user/friend/v1/friend.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: user/friend/v1/friend.proto @@ -8,8 +8,8 @@ package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" - response "github.com/go-goim/api/transport/response" - v1 "github.com/go-goim/api/user/session/v1" + errors "github.com/go-goim/api/errors" + v1 "github.com/go-goim/api/message/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -238,8 +238,8 @@ type Friend struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - FriendUid string `protobuf:"bytes,2,opt,name=friend_uid,json=friendUid,proto3" json:"friend_uid,omitempty"` + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + FriendUid int64 `protobuf:"varint,2,opt,name=friend_uid,json=friendUid,proto3" json:"friend_uid,omitempty"` FriendName string `protobuf:"bytes,3,opt,name=friend_name,json=friendName,proto3" json:"friend_name,omitempty"` FriendAvatar string `protobuf:"bytes,4,opt,name=friend_avatar,json=friendAvatar,proto3" json:"friend_avatar,omitempty"` Status FriendStatus `protobuf:"varint,5,opt,name=status,proto3,enum=api.user.friend.v1.FriendStatus" json:"status,omitempty"` @@ -279,18 +279,18 @@ func (*Friend) Descriptor() ([]byte, []int) { return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{0} } -func (x *Friend) GetUid() string { +func (x *Friend) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } -func (x *Friend) GetFriendUid() string { +func (x *Friend) GetFriendUid() int64 { if x != nil { return x.FriendUid } - return "" + return 0 } func (x *Friend) GetFriendName() string { @@ -388,8 +388,8 @@ type GetFriendResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Friend *Friend `protobuf:"bytes,2,opt,name=friend,proto3" json:"friend,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Friend *Friend `protobuf:"bytes,2,opt,name=friend,proto3" json:"friend,omitempty"` } func (x *GetFriendResponse) Reset() { @@ -424,9 +424,9 @@ func (*GetFriendResponse) Descriptor() ([]byte, []int) { return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{2} } -func (x *GetFriendResponse) GetResponse() *response.BaseResponse { +func (x *GetFriendResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } @@ -443,7 +443,7 @@ type QueryFriendListRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *QueryFriendListRequest) Reset() { @@ -478,11 +478,11 @@ func (*QueryFriendListRequest) Descriptor() ([]byte, []int) { return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{3} } -func (x *QueryFriendListRequest) GetUid() string { +func (x *QueryFriendListRequest) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } type QueryFriendListResponse struct { @@ -490,8 +490,8 @@ type QueryFriendListResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - FriendList []*Friend `protobuf:"bytes,2,rep,name=friend_list,json=friendList,proto3" json:"friend_list,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + FriendList []*Friend `protobuf:"bytes,2,rep,name=friend_list,json=friendList,proto3" json:"friend_list,omitempty"` } func (x *QueryFriendListResponse) Reset() { @@ -526,9 +526,9 @@ func (*QueryFriendListResponse) Descriptor() ([]byte, []int) { return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{4} } -func (x *QueryFriendListResponse) GetResponse() *response.BaseResponse { +func (x *QueryFriendListResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } @@ -546,9 +546,9 @@ type FriendRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` - FriendUid string `protobuf:"bytes,3,opt,name=friend_uid,json=friendUid,proto3" json:"friend_uid,omitempty"` + Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Uid int64 `protobuf:"varint,2,opt,name=uid,proto3" json:"uid,omitempty"` + FriendUid int64 `protobuf:"varint,3,opt,name=friend_uid,json=friendUid,proto3" json:"friend_uid,omitempty"` Status FriendRequestStatus `protobuf:"varint,4,opt,name=status,proto3,enum=api.user.friend.v1.FriendRequestStatus" json:"status,omitempty"` CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` @@ -589,25 +589,25 @@ func (*FriendRequest) Descriptor() ([]byte, []int) { return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{5} } -func (x *FriendRequest) GetId() int64 { +func (x *FriendRequest) GetId() uint64 { if x != nil { return x.Id } return 0 } -func (x *FriendRequest) GetUid() string { +func (x *FriendRequest) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } -func (x *FriendRequest) GetFriendUid() string { +func (x *FriendRequest) GetFriendUid() int64 { if x != nil { return x.FriendUid } - return "" + return 0 } func (x *FriendRequest) GetStatus() FriendRequestStatus { @@ -645,74 +645,19 @@ func (x *FriendRequest) GetFriendAvatar() string { return "" } -type AddFriendRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - FriendUid string `protobuf:"bytes,2,opt,name=friend_uid,json=friendUid,proto3" json:"friend_uid,omitempty"` -} - -func (x *AddFriendRequest) Reset() { - *x = AddFriendRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_user_friend_v1_friend_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddFriendRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddFriendRequest) ProtoMessage() {} - -func (x *AddFriendRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_friend_v1_friend_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) -} - -// Deprecated: Use AddFriendRequest.ProtoReflect.Descriptor instead. -func (*AddFriendRequest) Descriptor() ([]byte, []int) { - return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{6} -} - -func (x *AddFriendRequest) GetUid() string { - if x != nil { - return x.Uid - } - return "" -} - -func (x *AddFriendRequest) GetFriendUid() string { - if x != nil { - return x.FriendUid - } - return "" -} - type BaseFriendRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - FriendUid string `protobuf:"bytes,2,opt,name=friend_uid,json=friendUid,proto3" json:"friend_uid,omitempty"` + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + FriendUid int64 `protobuf:"varint,2,opt,name=friend_uid,json=friendUid,proto3" json:"friend_uid,omitempty"` } func (x *BaseFriendRequest) Reset() { *x = BaseFriendRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_friend_v1_friend_proto_msgTypes[7] + mi := &file_user_friend_v1_friend_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -725,7 +670,7 @@ func (x *BaseFriendRequest) String() string { func (*BaseFriendRequest) ProtoMessage() {} func (x *BaseFriendRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_friend_v1_friend_proto_msgTypes[7] + mi := &file_user_friend_v1_friend_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -738,21 +683,21 @@ func (x *BaseFriendRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BaseFriendRequest.ProtoReflect.Descriptor instead. func (*BaseFriendRequest) Descriptor() ([]byte, []int) { - return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{7} + return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{6} } -func (x *BaseFriendRequest) GetUid() string { +func (x *BaseFriendRequest) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } -func (x *BaseFriendRequest) GetFriendUid() string { +func (x *BaseFriendRequest) GetFriendUid() int64 { if x != nil { return x.FriendUid } - return "" + return 0 } type AddFriendResponse struct { @@ -760,14 +705,14 @@ type AddFriendResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Result *AddFriendResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Result *AddFriendResult `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"` } func (x *AddFriendResponse) Reset() { *x = AddFriendResponse{} if protoimpl.UnsafeEnabled { - mi := &file_user_friend_v1_friend_proto_msgTypes[8] + mi := &file_user_friend_v1_friend_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -780,7 +725,7 @@ func (x *AddFriendResponse) String() string { func (*AddFriendResponse) ProtoMessage() {} func (x *AddFriendResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_friend_v1_friend_proto_msgTypes[8] + mi := &file_user_friend_v1_friend_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -793,12 +738,12 @@ func (x *AddFriendResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddFriendResponse.ProtoReflect.Descriptor instead. func (*AddFriendResponse) Descriptor() ([]byte, []int) { - return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{8} + return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{7} } -func (x *AddFriendResponse) GetResponse() *response.BaseResponse { +func (x *AddFriendResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } @@ -822,7 +767,7 @@ type AddFriendResult struct { func (x *AddFriendResult) Reset() { *x = AddFriendResult{} if protoimpl.UnsafeEnabled { - mi := &file_user_friend_v1_friend_proto_msgTypes[9] + mi := &file_user_friend_v1_friend_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -835,7 +780,7 @@ func (x *AddFriendResult) String() string { func (*AddFriendResult) ProtoMessage() {} func (x *AddFriendResult) ProtoReflect() protoreflect.Message { - mi := &file_user_friend_v1_friend_proto_msgTypes[9] + mi := &file_user_friend_v1_friend_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -848,7 +793,7 @@ func (x *AddFriendResult) ProtoReflect() protoreflect.Message { // Deprecated: Use AddFriendResult.ProtoReflect.Descriptor instead. func (*AddFriendResult) Descriptor() ([]byte, []int) { - return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{9} + return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{8} } func (x *AddFriendResult) GetStatus() AddFriendStatus { @@ -865,33 +810,33 @@ func (x *AddFriendResult) GetFriendRequest() *FriendRequest { return nil } -type ConfirmFriendRequestReq struct { +type ConfirmFriendRequestRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - FriendRequestId int64 `protobuf:"varint,2,opt,name=friend_request_id,json=friendRequestId,proto3" json:"friend_request_id,omitempty"` + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + FriendRequestId uint64 `protobuf:"varint,2,opt,name=friend_request_id,json=friendRequestId,proto3" json:"friend_request_id,omitempty"` Action ConfirmFriendRequestAction `protobuf:"varint,3,opt,name=action,proto3,enum=api.user.friend.v1.ConfirmFriendRequestAction" json:"action,omitempty"` } -func (x *ConfirmFriendRequestReq) Reset() { - *x = ConfirmFriendRequestReq{} +func (x *ConfirmFriendRequestRequest) Reset() { + *x = ConfirmFriendRequestRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_friend_v1_friend_proto_msgTypes[10] + mi := &file_user_friend_v1_friend_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *ConfirmFriendRequestReq) String() string { +func (x *ConfirmFriendRequestRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ConfirmFriendRequestReq) ProtoMessage() {} +func (*ConfirmFriendRequestRequest) ProtoMessage() {} -func (x *ConfirmFriendRequestReq) ProtoReflect() protoreflect.Message { - mi := &file_user_friend_v1_friend_proto_msgTypes[10] +func (x *ConfirmFriendRequestRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_friend_v1_friend_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -902,26 +847,26 @@ func (x *ConfirmFriendRequestReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ConfirmFriendRequestReq.ProtoReflect.Descriptor instead. -func (*ConfirmFriendRequestReq) Descriptor() ([]byte, []int) { - return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{10} +// Deprecated: Use ConfirmFriendRequestRequest.ProtoReflect.Descriptor instead. +func (*ConfirmFriendRequestRequest) Descriptor() ([]byte, []int) { + return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{9} } -func (x *ConfirmFriendRequestReq) GetUid() string { +func (x *ConfirmFriendRequestRequest) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } -func (x *ConfirmFriendRequestReq) GetFriendRequestId() int64 { +func (x *ConfirmFriendRequestRequest) GetFriendRequestId() uint64 { if x != nil { return x.FriendRequestId } return 0 } -func (x *ConfirmFriendRequestReq) GetAction() ConfirmFriendRequestAction { +func (x *ConfirmFriendRequestRequest) GetAction() ConfirmFriendRequestAction { if x != nil { return x.Action } @@ -933,14 +878,14 @@ type GetFriendRequestResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - FriendRequest *FriendRequest `protobuf:"bytes,2,opt,name=friend_request,json=friendRequest,proto3" json:"friend_request,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + FriendRequest *FriendRequest `protobuf:"bytes,2,opt,name=friend_request,json=friendRequest,proto3" json:"friend_request,omitempty"` } func (x *GetFriendRequestResponse) Reset() { *x = GetFriendRequestResponse{} if protoimpl.UnsafeEnabled { - mi := &file_user_friend_v1_friend_proto_msgTypes[11] + mi := &file_user_friend_v1_friend_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -953,7 +898,7 @@ func (x *GetFriendRequestResponse) String() string { func (*GetFriendRequestResponse) ProtoMessage() {} func (x *GetFriendRequestResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_friend_v1_friend_proto_msgTypes[11] + mi := &file_user_friend_v1_friend_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -966,12 +911,12 @@ func (x *GetFriendRequestResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetFriendRequestResponse.ProtoReflect.Descriptor instead. func (*GetFriendRequestResponse) Descriptor() ([]byte, []int) { - return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{11} + return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{10} } -func (x *GetFriendRequestResponse) GetResponse() *response.BaseResponse { +func (x *GetFriendRequestResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } @@ -988,14 +933,14 @@ type QueryFriendRequestListRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Status FriendRequestStatus `protobuf:"varint,2,opt,name=status,proto3,enum=api.user.friend.v1.FriendRequestStatus" json:"status,omitempty"` } func (x *QueryFriendRequestListRequest) Reset() { *x = QueryFriendRequestListRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_friend_v1_friend_proto_msgTypes[12] + mi := &file_user_friend_v1_friend_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1008,7 +953,7 @@ func (x *QueryFriendRequestListRequest) String() string { func (*QueryFriendRequestListRequest) ProtoMessage() {} func (x *QueryFriendRequestListRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_friend_v1_friend_proto_msgTypes[12] + mi := &file_user_friend_v1_friend_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1021,14 +966,14 @@ func (x *QueryFriendRequestListRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryFriendRequestListRequest.ProtoReflect.Descriptor instead. func (*QueryFriendRequestListRequest) Descriptor() ([]byte, []int) { - return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{12} + return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{11} } -func (x *QueryFriendRequestListRequest) GetUid() string { +func (x *QueryFriendRequestListRequest) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } func (x *QueryFriendRequestListRequest) GetStatus() FriendRequestStatus { @@ -1043,14 +988,14 @@ type QueryFriendRequestListResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - FriendRequestList []*FriendRequest `protobuf:"bytes,2,rep,name=friend_request_list,json=friendRequestList,proto3" json:"friend_request_list,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + FriendRequestList []*FriendRequest `protobuf:"bytes,2,rep,name=friend_request_list,json=friendRequestList,proto3" json:"friend_request_list,omitempty"` } func (x *QueryFriendRequestListResponse) Reset() { *x = QueryFriendRequestListResponse{} if protoimpl.UnsafeEnabled { - mi := &file_user_friend_v1_friend_proto_msgTypes[13] + mi := &file_user_friend_v1_friend_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1063,7 +1008,7 @@ func (x *QueryFriendRequestListResponse) String() string { func (*QueryFriendRequestListResponse) ProtoMessage() {} func (x *QueryFriendRequestListResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_friend_v1_friend_proto_msgTypes[13] + mi := &file_user_friend_v1_friend_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1076,12 +1021,12 @@ func (x *QueryFriendRequestListResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryFriendRequestListResponse.ProtoReflect.Descriptor instead. func (*QueryFriendRequestListResponse) Descriptor() ([]byte, []int) { - return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{13} + return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{12} } -func (x *QueryFriendRequestListResponse) GetResponse() *response.BaseResponse { +func (x *QueryFriendRequestListResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } @@ -1099,15 +1044,15 @@ type CheckSendMessageAbilityRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FromUid string `protobuf:"bytes,1,opt,name=from_uid,json=fromUid,proto3" json:"from_uid,omitempty"` - ToUid string `protobuf:"bytes,2,opt,name=to_uid,json=toUid,proto3" json:"to_uid,omitempty"` - SessionType v1.SessionType `protobuf:"varint,3,opt,name=session_type,json=sessionType,proto3,enum=api.user.session.v1.SessionType" json:"session_type,omitempty"` + FromUid int64 `protobuf:"varint,1,opt,name=from_uid,json=fromUid,proto3" json:"from_uid,omitempty"` + ToUid int64 `protobuf:"varint,2,opt,name=to_uid,json=toUid,proto3" json:"to_uid,omitempty"` + SessionType v1.SessionType `protobuf:"varint,3,opt,name=session_type,json=sessionType,proto3,enum=api.message.v1.SessionType" json:"session_type,omitempty"` } func (x *CheckSendMessageAbilityRequest) Reset() { *x = CheckSendMessageAbilityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_friend_v1_friend_proto_msgTypes[14] + mi := &file_user_friend_v1_friend_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1120,7 +1065,7 @@ func (x *CheckSendMessageAbilityRequest) String() string { func (*CheckSendMessageAbilityRequest) ProtoMessage() {} func (x *CheckSendMessageAbilityRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_friend_v1_friend_proto_msgTypes[14] + mi := &file_user_friend_v1_friend_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1133,28 +1078,28 @@ func (x *CheckSendMessageAbilityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckSendMessageAbilityRequest.ProtoReflect.Descriptor instead. func (*CheckSendMessageAbilityRequest) Descriptor() ([]byte, []int) { - return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{14} + return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{13} } -func (x *CheckSendMessageAbilityRequest) GetFromUid() string { +func (x *CheckSendMessageAbilityRequest) GetFromUid() int64 { if x != nil { return x.FromUid } - return "" + return 0 } -func (x *CheckSendMessageAbilityRequest) GetToUid() string { +func (x *CheckSendMessageAbilityRequest) GetToUid() int64 { if x != nil { return x.ToUid } - return "" + return 0 } func (x *CheckSendMessageAbilityRequest) GetSessionType() v1.SessionType { if x != nil { return x.SessionType } - return v1.SessionType_SingleChat + return v1.SessionType(0) } type CheckSendMessageAbilityResponse struct { @@ -1162,14 +1107,14 @@ type CheckSendMessageAbilityResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - SessionId *int64 `protobuf:"varint,2,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + SessionId *string `protobuf:"bytes,2,opt,name=session_id,json=sessionId,proto3,oneof" json:"session_id,omitempty"` } func (x *CheckSendMessageAbilityResponse) Reset() { *x = CheckSendMessageAbilityResponse{} if protoimpl.UnsafeEnabled { - mi := &file_user_friend_v1_friend_proto_msgTypes[15] + mi := &file_user_friend_v1_friend_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1182,7 +1127,7 @@ func (x *CheckSendMessageAbilityResponse) String() string { func (*CheckSendMessageAbilityResponse) ProtoMessage() {} func (x *CheckSendMessageAbilityResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_friend_v1_friend_proto_msgTypes[15] + mi := &file_user_friend_v1_friend_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1195,21 +1140,21 @@ func (x *CheckSendMessageAbilityResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckSendMessageAbilityResponse.ProtoReflect.Descriptor instead. func (*CheckSendMessageAbilityResponse) Descriptor() ([]byte, []int) { - return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{15} + return file_user_friend_v1_friend_proto_rawDescGZIP(), []int{14} } -func (x *CheckSendMessageAbilityResponse) GetResponse() *response.BaseResponse { +func (x *CheckSendMessageAbilityResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } -func (x *CheckSendMessageAbilityResponse) GetSessionId() int64 { +func (x *CheckSendMessageAbilityResponse) GetSessionId() string { if x != nil && x.SessionId != nil { return *x.SessionId } - return 0 + return "" } var File_user_friend_v1_friend_proto protoreflect.FileDescriptor @@ -1218,255 +1163,234 @@ var file_user_friend_v1_friend_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, - 0x31, 0x1a, 0x21, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x01, 0x0a, - 0x06, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x55, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, - 0x6e, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x5f, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x38, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x90, 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x46, 0x72, 0x69, 0x65, - 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, - 0x38, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x89, 0x01, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x40, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, - 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x32, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x06, 0x66, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x35, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1b, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, - 0x06, 0x72, 0x04, 0x10, 0x14, 0x18, 0x18, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x98, 0x01, 0x0a, - 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x66, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x0a, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x95, 0x02, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, - 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, - 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x55, 0x69, 0x64, 0x12, 0x3f, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, - 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, - 0x59, 0x0a, 0x10, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x14, 0x18, 0x18, 0x52, 0x03, 0x75, 0x69, 0x64, - 0x12, 0x28, 0x0a, 0x0a, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x14, 0x18, 0x18, 0x52, - 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x55, 0x69, 0x64, 0x22, 0x5a, 0x0a, 0x11, 0x42, 0x61, - 0x73, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1b, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, - 0x06, 0x72, 0x04, 0x10, 0x14, 0x18, 0x18, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x0a, - 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x14, 0x18, 0x18, 0x52, 0x09, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x55, 0x69, 0x64, 0x22, 0x92, 0x01, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, - 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x98, 0x01, 0x0a, 0x0f, - 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, - 0x3b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x48, 0x0a, 0x0e, - 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x31, 0x1a, 0x18, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x13, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, + 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x01, 0x0a, 0x06, 0x46, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x55, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x5f, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x38, 0x0a, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, + 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x22, 0x90, 0x01, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x39, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x38, 0x0a, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x70, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x32, 0x0a, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xbd, 0x01, 0x0a, 0x17, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x72, 0x6d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x14, 0x18, 0x18, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, + 0x52, 0x06, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x22, 0x33, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x7f, 0x0a, + 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x73, 0x74, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x52, 0x0a, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x95, + 0x02, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, + 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x75, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x55, 0x69, + 0x64, 0x12, 0x3f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, + 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x61, 0x76, 0x61, 0x74, + 0x61, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x56, 0x0a, 0x11, 0x42, 0x61, 0x73, 0x65, 0x46, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, + 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0a, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, + 0x02, 0x20, 0x00, 0x52, 0x09, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x55, 0x69, 0x64, 0x22, 0x79, + 0x0a, 0x11, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x3b, 0x0a, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x98, 0x01, 0x0a, 0x0f, 0x41, 0x64, + 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x3b, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x48, 0x0a, 0x0e, 0x66, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x22, 0xbf, 0x01, 0x0a, 0x1b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x33, 0x0a, 0x11, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, + 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x20, 0x00, 0x52, 0x0f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x50, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xa6, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x46, 0x72, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x8d, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, - 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x87, 0x01, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x1b, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, - 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x14, 0x18, 0x18, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x49, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x27, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x82, 0x01, 0x02, 0x10, - 0x01, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xb5, 0x01, 0x0a, 0x1e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, - 0x0a, 0x13, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x11, - 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, - 0x74, 0x22, 0xad, 0x01, 0x0a, 0x1e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x6e, 0x64, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x75, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x14, 0x18, - 0x18, 0x52, 0x07, 0x66, 0x72, 0x6f, 0x6d, 0x55, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x06, 0x74, 0x6f, - 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, - 0x04, 0x10, 0x14, 0x18, 0x18, 0x52, 0x05, 0x74, 0x6f, 0x55, 0x69, 0x64, 0x12, 0x43, 0x0a, 0x0c, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, - 0x65, 0x22, 0x96, 0x01, 0x0a, 0x1f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x6e, 0x64, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x09, 0x73, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x2a, 0x44, 0x0a, 0x0c, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x52, - 0x49, 0x45, 0x4e, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x52, 0x41, 0x4e, 0x47, - 0x45, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, - 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x03, - 0x2a, 0x40, 0x0a, 0x13, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x51, 0x55, 0x45, - 0x53, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, - 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, - 0x10, 0x02, 0x2a, 0x87, 0x01, 0x0a, 0x0f, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x45, 0x4e, 0x44, 0x5f, 0x52, - 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, - 0x12, 0x18, 0x0a, 0x14, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x53, 0x45, 0x4e, 0x54, - 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x44, - 0x44, 0x5f, 0x46, 0x52, 0x49, 0x45, 0x4e, 0x44, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, - 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x5f, 0x42, 0x59, - 0x5f, 0x4d, 0x45, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, - 0x5f, 0x42, 0x59, 0x5f, 0x46, 0x52, 0x49, 0x45, 0x4e, 0x44, 0x10, 0x04, 0x2a, 0x34, 0x0a, 0x1a, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, - 0x43, 0x45, 0x50, 0x54, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, - 0x10, 0x01, 0x32, 0xce, 0x07, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x58, 0x0a, 0x09, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x12, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, + 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x48, 0x0a, 0x0e, + 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x85, 0x01, 0x0a, 0x1d, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x03, + 0x75, 0x69, 0x64, 0x12, 0x49, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x08, 0xfa, 0x42, + 0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x9c, + 0x01, 0x0a, 0x1e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x51, 0x0a, 0x13, 0x66, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6c, 0x69, 0x73, + 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x11, 0x66, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xa4, 0x01, + 0x0a, 0x1e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x22, 0x0a, 0x08, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x07, 0x66, 0x72, 0x6f, + 0x6d, 0x55, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x06, 0x74, 0x6f, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x05, 0x74, + 0x6f, 0x55, 0x69, 0x64, 0x12, 0x3e, 0x0a, 0x0c, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, + 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x22, 0x7d, 0x0a, 0x1f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x6e, + 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x12, 0x22, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x09, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, + 0x64, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x2a, 0x44, 0x0a, 0x0c, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x52, 0x49, 0x45, 0x4e, 0x44, 0x10, 0x00, 0x12, + 0x0c, 0x0a, 0x08, 0x53, 0x54, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, + 0x07, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, + 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x03, 0x2a, 0x40, 0x0a, 0x13, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, + 0x08, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x2a, 0x87, 0x01, 0x0a, 0x0f, + 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, + 0x18, 0x0a, 0x14, 0x53, 0x45, 0x4e, 0x44, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x5f, + 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14, 0x41, 0x4c, 0x52, + 0x45, 0x41, 0x44, 0x59, 0x5f, 0x53, 0x45, 0x4e, 0x54, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, + 0x54, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x44, 0x44, 0x5f, 0x46, 0x52, 0x49, 0x45, 0x4e, + 0x44, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x42, + 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x5f, 0x42, 0x59, 0x5f, 0x4d, 0x45, 0x10, 0x03, 0x12, 0x15, + 0x0a, 0x11, 0x42, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x5f, 0x42, 0x59, 0x5f, 0x46, 0x52, 0x49, + 0x45, 0x4e, 0x44, 0x10, 0x04, 0x2a, 0x34, 0x0a, 0x1a, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x43, 0x45, 0x50, 0x54, 0x10, 0x00, 0x12, + 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x01, 0x32, 0x9a, 0x07, 0x0a, 0x0d, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x59, 0x0a, + 0x09, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x42, 0x61, 0x73, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, - 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, - 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x52, 0x65, 0x71, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, - 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x67, 0x0a, 0x10, 0x47, 0x65, 0x74, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x7f, 0x0a, 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x31, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x32, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x69, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, - 0x0a, 0x08, 0x49, 0x73, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, + 0x12, 0x2f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x46, 0x72, 0x69, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x67, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, + 0x73, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7f, 0x0a, + 0x16, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x31, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x42, 0x61, 0x73, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, - 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x46, 0x72, - 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x47, 0x65, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x6a, 0x0a, 0x0f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, - 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, - 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, - 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x82, - 0x01, 0x0a, 0x17, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x32, 0x2e, 0x61, 0x70, 0x69, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, + 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x12, 0x2d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, + 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x44, 0x0a, 0x08, 0x49, 0x73, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, + 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x46, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x59, 0x0a, 0x09, + 0x47, 0x65, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x61, 0x73, 0x65, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, + 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6a, 0x0a, 0x0f, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, - 0x65, 0x72, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x82, 0x01, 0x0a, 0x17, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x6e, + 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, + 0x32, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, 0x72, 0x69, 0x65, 0x6e, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x66, + 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, + 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x2f, 0x76, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1482,7 +1406,7 @@ func file_user_friend_v1_friend_proto_rawDescGZIP() []byte { } var file_user_friend_v1_friend_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_user_friend_v1_friend_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_user_friend_v1_friend_proto_msgTypes = make([]protoimpl.MessageInfo, 15) var file_user_friend_v1_friend_proto_goTypes = []interface{}{ (FriendStatus)(0), // 0: api.user.friend.v1.FriendStatus (FriendRequestStatus)(0), // 1: api.user.friend.v1.FriendRequestStatus @@ -1494,58 +1418,57 @@ var file_user_friend_v1_friend_proto_goTypes = []interface{}{ (*QueryFriendListRequest)(nil), // 7: api.user.friend.v1.QueryFriendListRequest (*QueryFriendListResponse)(nil), // 8: api.user.friend.v1.QueryFriendListResponse (*FriendRequest)(nil), // 9: api.user.friend.v1.FriendRequest - (*AddFriendRequest)(nil), // 10: api.user.friend.v1.AddFriendRequest - (*BaseFriendRequest)(nil), // 11: api.user.friend.v1.BaseFriendRequest - (*AddFriendResponse)(nil), // 12: api.user.friend.v1.AddFriendResponse - (*AddFriendResult)(nil), // 13: api.user.friend.v1.AddFriendResult - (*ConfirmFriendRequestReq)(nil), // 14: api.user.friend.v1.ConfirmFriendRequestReq - (*GetFriendRequestResponse)(nil), // 15: api.user.friend.v1.GetFriendRequestResponse - (*QueryFriendRequestListRequest)(nil), // 16: api.user.friend.v1.QueryFriendRequestListRequest - (*QueryFriendRequestListResponse)(nil), // 17: api.user.friend.v1.QueryFriendRequestListResponse - (*CheckSendMessageAbilityRequest)(nil), // 18: api.user.friend.v1.CheckSendMessageAbilityRequest - (*CheckSendMessageAbilityResponse)(nil), // 19: api.user.friend.v1.CheckSendMessageAbilityResponse - (*response.BaseResponse)(nil), // 20: api.transport.response.BaseResponse - (v1.SessionType)(0), // 21: api.user.session.v1.SessionType + (*BaseFriendRequest)(nil), // 10: api.user.friend.v1.BaseFriendRequest + (*AddFriendResponse)(nil), // 11: api.user.friend.v1.AddFriendResponse + (*AddFriendResult)(nil), // 12: api.user.friend.v1.AddFriendResult + (*ConfirmFriendRequestRequest)(nil), // 13: api.user.friend.v1.ConfirmFriendRequestRequest + (*GetFriendRequestResponse)(nil), // 14: api.user.friend.v1.GetFriendRequestResponse + (*QueryFriendRequestListRequest)(nil), // 15: api.user.friend.v1.QueryFriendRequestListRequest + (*QueryFriendRequestListResponse)(nil), // 16: api.user.friend.v1.QueryFriendRequestListResponse + (*CheckSendMessageAbilityRequest)(nil), // 17: api.user.friend.v1.CheckSendMessageAbilityRequest + (*CheckSendMessageAbilityResponse)(nil), // 18: api.user.friend.v1.CheckSendMessageAbilityResponse + (*errors.Error)(nil), // 19: api.errors.Error + (v1.SessionType)(0), // 20: api.message.v1.SessionType } var file_user_friend_v1_friend_proto_depIdxs = []int32{ 0, // 0: api.user.friend.v1.Friend.status:type_name -> api.user.friend.v1.FriendStatus - 11, // 1: api.user.friend.v1.UpdateFriendStatusRequest.info:type_name -> api.user.friend.v1.BaseFriendRequest + 10, // 1: api.user.friend.v1.UpdateFriendStatusRequest.info:type_name -> api.user.friend.v1.BaseFriendRequest 0, // 2: api.user.friend.v1.UpdateFriendStatusRequest.status:type_name -> api.user.friend.v1.FriendStatus - 20, // 3: api.user.friend.v1.GetFriendResponse.response:type_name -> api.transport.response.BaseResponse + 19, // 3: api.user.friend.v1.GetFriendResponse.error:type_name -> api.errors.Error 4, // 4: api.user.friend.v1.GetFriendResponse.friend:type_name -> api.user.friend.v1.Friend - 20, // 5: api.user.friend.v1.QueryFriendListResponse.response:type_name -> api.transport.response.BaseResponse + 19, // 5: api.user.friend.v1.QueryFriendListResponse.error:type_name -> api.errors.Error 4, // 6: api.user.friend.v1.QueryFriendListResponse.friend_list:type_name -> api.user.friend.v1.Friend 1, // 7: api.user.friend.v1.FriendRequest.status:type_name -> api.user.friend.v1.FriendRequestStatus - 20, // 8: api.user.friend.v1.AddFriendResponse.response:type_name -> api.transport.response.BaseResponse - 13, // 9: api.user.friend.v1.AddFriendResponse.result:type_name -> api.user.friend.v1.AddFriendResult + 19, // 8: api.user.friend.v1.AddFriendResponse.error:type_name -> api.errors.Error + 12, // 9: api.user.friend.v1.AddFriendResponse.result:type_name -> api.user.friend.v1.AddFriendResult 2, // 10: api.user.friend.v1.AddFriendResult.status:type_name -> api.user.friend.v1.AddFriendStatus 9, // 11: api.user.friend.v1.AddFriendResult.friend_request:type_name -> api.user.friend.v1.FriendRequest - 3, // 12: api.user.friend.v1.ConfirmFriendRequestReq.action:type_name -> api.user.friend.v1.ConfirmFriendRequestAction - 20, // 13: api.user.friend.v1.GetFriendRequestResponse.response:type_name -> api.transport.response.BaseResponse + 3, // 12: api.user.friend.v1.ConfirmFriendRequestRequest.action:type_name -> api.user.friend.v1.ConfirmFriendRequestAction + 19, // 13: api.user.friend.v1.GetFriendRequestResponse.error:type_name -> api.errors.Error 9, // 14: api.user.friend.v1.GetFriendRequestResponse.friend_request:type_name -> api.user.friend.v1.FriendRequest 1, // 15: api.user.friend.v1.QueryFriendRequestListRequest.status:type_name -> api.user.friend.v1.FriendRequestStatus - 20, // 16: api.user.friend.v1.QueryFriendRequestListResponse.response:type_name -> api.transport.response.BaseResponse + 19, // 16: api.user.friend.v1.QueryFriendRequestListResponse.error:type_name -> api.errors.Error 9, // 17: api.user.friend.v1.QueryFriendRequestListResponse.friend_request_list:type_name -> api.user.friend.v1.FriendRequest - 21, // 18: api.user.friend.v1.CheckSendMessageAbilityRequest.session_type:type_name -> api.user.session.v1.SessionType - 20, // 19: api.user.friend.v1.CheckSendMessageAbilityResponse.response:type_name -> api.transport.response.BaseResponse - 10, // 20: api.user.friend.v1.FriendService.AddFriend:input_type -> api.user.friend.v1.AddFriendRequest - 14, // 21: api.user.friend.v1.FriendService.ConfirmFriendRequest:input_type -> api.user.friend.v1.ConfirmFriendRequestReq - 11, // 22: api.user.friend.v1.FriendService.GetFriendRequest:input_type -> api.user.friend.v1.BaseFriendRequest - 16, // 23: api.user.friend.v1.FriendService.QueryFriendRequestList:input_type -> api.user.friend.v1.QueryFriendRequestListRequest + 20, // 18: api.user.friend.v1.CheckSendMessageAbilityRequest.session_type:type_name -> api.message.v1.SessionType + 19, // 19: api.user.friend.v1.CheckSendMessageAbilityResponse.error:type_name -> api.errors.Error + 10, // 20: api.user.friend.v1.FriendService.AddFriend:input_type -> api.user.friend.v1.BaseFriendRequest + 13, // 21: api.user.friend.v1.FriendService.ConfirmFriendRequest:input_type -> api.user.friend.v1.ConfirmFriendRequestRequest + 10, // 22: api.user.friend.v1.FriendService.GetFriendRequest:input_type -> api.user.friend.v1.BaseFriendRequest + 15, // 23: api.user.friend.v1.FriendService.QueryFriendRequestList:input_type -> api.user.friend.v1.QueryFriendRequestListRequest 5, // 24: api.user.friend.v1.FriendService.UpdateFriendStatus:input_type -> api.user.friend.v1.UpdateFriendStatusRequest - 11, // 25: api.user.friend.v1.FriendService.IsFriend:input_type -> api.user.friend.v1.BaseFriendRequest - 11, // 26: api.user.friend.v1.FriendService.GetFriend:input_type -> api.user.friend.v1.BaseFriendRequest + 10, // 25: api.user.friend.v1.FriendService.IsFriend:input_type -> api.user.friend.v1.BaseFriendRequest + 10, // 26: api.user.friend.v1.FriendService.GetFriend:input_type -> api.user.friend.v1.BaseFriendRequest 7, // 27: api.user.friend.v1.FriendService.QueryFriendList:input_type -> api.user.friend.v1.QueryFriendListRequest - 18, // 28: api.user.friend.v1.FriendService.CheckSendMessageAbility:input_type -> api.user.friend.v1.CheckSendMessageAbilityRequest - 12, // 29: api.user.friend.v1.FriendService.AddFriend:output_type -> api.user.friend.v1.AddFriendResponse - 20, // 30: api.user.friend.v1.FriendService.ConfirmFriendRequest:output_type -> api.transport.response.BaseResponse - 15, // 31: api.user.friend.v1.FriendService.GetFriendRequest:output_type -> api.user.friend.v1.GetFriendRequestResponse - 17, // 32: api.user.friend.v1.FriendService.QueryFriendRequestList:output_type -> api.user.friend.v1.QueryFriendRequestListResponse - 20, // 33: api.user.friend.v1.FriendService.UpdateFriendStatus:output_type -> api.transport.response.BaseResponse - 20, // 34: api.user.friend.v1.FriendService.IsFriend:output_type -> api.transport.response.BaseResponse + 17, // 28: api.user.friend.v1.FriendService.CheckSendMessageAbility:input_type -> api.user.friend.v1.CheckSendMessageAbilityRequest + 11, // 29: api.user.friend.v1.FriendService.AddFriend:output_type -> api.user.friend.v1.AddFriendResponse + 19, // 30: api.user.friend.v1.FriendService.ConfirmFriendRequest:output_type -> api.errors.Error + 14, // 31: api.user.friend.v1.FriendService.GetFriendRequest:output_type -> api.user.friend.v1.GetFriendRequestResponse + 16, // 32: api.user.friend.v1.FriendService.QueryFriendRequestList:output_type -> api.user.friend.v1.QueryFriendRequestListResponse + 19, // 33: api.user.friend.v1.FriendService.UpdateFriendStatus:output_type -> api.errors.Error + 19, // 34: api.user.friend.v1.FriendService.IsFriend:output_type -> api.errors.Error 6, // 35: api.user.friend.v1.FriendService.GetFriend:output_type -> api.user.friend.v1.GetFriendResponse 8, // 36: api.user.friend.v1.FriendService.QueryFriendList:output_type -> api.user.friend.v1.QueryFriendListResponse - 19, // 37: api.user.friend.v1.FriendService.CheckSendMessageAbility:output_type -> api.user.friend.v1.CheckSendMessageAbilityResponse + 18, // 37: api.user.friend.v1.FriendService.CheckSendMessageAbility:output_type -> api.user.friend.v1.CheckSendMessageAbilityResponse 29, // [29:38] is the sub-list for method output_type 20, // [20:29] is the sub-list for method input_type 20, // [20:20] is the sub-list for extension type_name @@ -1632,7 +1555,7 @@ func file_user_friend_v1_friend_proto_init() { } } file_user_friend_v1_friend_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddFriendRequest); i { + switch v := v.(*BaseFriendRequest); i { case 0: return &v.state case 1: @@ -1644,7 +1567,7 @@ func file_user_friend_v1_friend_proto_init() { } } file_user_friend_v1_friend_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BaseFriendRequest); i { + switch v := v.(*AddFriendResponse); i { case 0: return &v.state case 1: @@ -1656,7 +1579,7 @@ func file_user_friend_v1_friend_proto_init() { } } file_user_friend_v1_friend_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddFriendResponse); i { + switch v := v.(*AddFriendResult); i { case 0: return &v.state case 1: @@ -1668,7 +1591,7 @@ func file_user_friend_v1_friend_proto_init() { } } file_user_friend_v1_friend_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddFriendResult); i { + switch v := v.(*ConfirmFriendRequestRequest); i { case 0: return &v.state case 1: @@ -1680,18 +1603,6 @@ func file_user_friend_v1_friend_proto_init() { } } file_user_friend_v1_friend_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConfirmFriendRequestReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_user_friend_v1_friend_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetFriendRequestResponse); i { case 0: return &v.state @@ -1703,7 +1614,7 @@ func file_user_friend_v1_friend_proto_init() { return nil } } - file_user_friend_v1_friend_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_user_friend_v1_friend_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryFriendRequestListRequest); i { case 0: return &v.state @@ -1715,7 +1626,7 @@ func file_user_friend_v1_friend_proto_init() { return nil } } - file_user_friend_v1_friend_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_user_friend_v1_friend_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryFriendRequestListResponse); i { case 0: return &v.state @@ -1727,7 +1638,7 @@ func file_user_friend_v1_friend_proto_init() { return nil } } - file_user_friend_v1_friend_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_user_friend_v1_friend_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckSendMessageAbilityRequest); i { case 0: return &v.state @@ -1739,7 +1650,7 @@ func file_user_friend_v1_friend_proto_init() { return nil } } - file_user_friend_v1_friend_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_user_friend_v1_friend_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckSendMessageAbilityResponse); i { case 0: return &v.state @@ -1752,14 +1663,14 @@ func file_user_friend_v1_friend_proto_init() { } } } - file_user_friend_v1_friend_proto_msgTypes[15].OneofWrappers = []interface{}{} + file_user_friend_v1_friend_proto_msgTypes[14].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_friend_v1_friend_proto_rawDesc, NumEnums: 4, - NumMessages: 16, + NumMessages: 15, NumExtensions: 0, NumServices: 1, }, diff --git a/user/friend/v1/friend.pb.validate.go b/user/friend/v1/friend.pb.validate.go index bb3b04d..8fe18ab 100644 --- a/user/friend/v1/friend.pb.validate.go +++ b/user/friend/v1/friend.pb.validate.go @@ -17,6 +17,8 @@ import ( "unicode/utf8" "google.golang.org/protobuf/types/known/anypb" + + v1 "github.com/go-goim/api/message/v1" ) // ensure the imports are used @@ -33,6 +35,8 @@ var ( _ = (*mail.Address)(nil) _ = anypb.Any{} _ = sort.Sort + + _ = v1.SessionType(0) ) // Validate checks the field values on Friend with the rules defined in the @@ -303,11 +307,11 @@ func (m *GetFriendResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, GetFriendResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -315,16 +319,16 @@ func (m *GetFriendResponse) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, GetFriendResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return GetFriendResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -462,10 +466,10 @@ func (m *QueryFriendListRequest) validate(all bool) error { var errors []error - if l := utf8.RuneCountInString(m.GetUid()); l < 20 || l > 24 { + if m.GetUid() <= 0 { err := QueryFriendListRequestValidationError{ field: "Uid", - reason: "value length must be between 20 and 24 runes, inclusive", + reason: "value must be greater than 0", } if !all { return err @@ -576,11 +580,11 @@ func (m *QueryFriendListResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, QueryFriendListResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -588,16 +592,16 @@ func (m *QueryFriendListResponse) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, QueryFriendListResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return QueryFriendListResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -834,128 +838,6 @@ var _ interface { ErrorName() string } = FriendRequestValidationError{} -// Validate checks the field values on AddFriendRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *AddFriendRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddFriendRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// AddFriendRequestMultiError, or nil if none found. -func (m *AddFriendRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AddFriendRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if l := utf8.RuneCountInString(m.GetUid()); l < 20 || l > 24 { - err := AddFriendRequestValidationError{ - field: "Uid", - reason: "value length must be between 20 and 24 runes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - if l := utf8.RuneCountInString(m.GetFriendUid()); l < 20 || l > 24 { - err := AddFriendRequestValidationError{ - field: "FriendUid", - reason: "value length must be between 20 and 24 runes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - if len(errors) > 0 { - return AddFriendRequestMultiError(errors) - } - - return nil -} - -// AddFriendRequestMultiError is an error wrapping multiple validation errors -// returned by AddFriendRequest.ValidateAll() if the designated constraints -// aren't met. -type AddFriendRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddFriendRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m AddFriendRequestMultiError) AllErrors() []error { return m } - -// AddFriendRequestValidationError is the validation error returned by -// AddFriendRequest.Validate if the designated constraints aren't met. -type AddFriendRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddFriendRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddFriendRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddFriendRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddFriendRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddFriendRequestValidationError) ErrorName() string { return "AddFriendRequestValidationError" } - -// Error satisfies the builtin error interface -func (e AddFriendRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sAddFriendRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddFriendRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddFriendRequestValidationError{} - // Validate checks the field values on BaseFriendRequest with the rules defined // in the proto definition for this message. If any rules are violated, the // first error encountered is returned, or nil if there are no violations. @@ -978,10 +860,10 @@ func (m *BaseFriendRequest) validate(all bool) error { var errors []error - if l := utf8.RuneCountInString(m.GetUid()); l < 20 || l > 24 { + if m.GetUid() <= 0 { err := BaseFriendRequestValidationError{ field: "Uid", - reason: "value length must be between 20 and 24 runes, inclusive", + reason: "value must be greater than 0", } if !all { return err @@ -989,10 +871,10 @@ func (m *BaseFriendRequest) validate(all bool) error { errors = append(errors, err) } - if l := utf8.RuneCountInString(m.GetFriendUid()); l < 20 || l > 24 { + if m.GetFriendUid() <= 0 { err := BaseFriendRequestValidationError{ field: "FriendUid", - reason: "value length must be between 20 and 24 runes, inclusive", + reason: "value must be greater than 0", } if !all { return err @@ -1103,11 +985,11 @@ func (m *AddFriendResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, AddFriendResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -1115,16 +997,16 @@ func (m *AddFriendResponse) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, AddFriendResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AddFriendResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -1371,32 +1253,32 @@ var _ interface { ErrorName() string } = AddFriendResultValidationError{} -// Validate checks the field values on ConfirmFriendRequestReq with the rules -// defined in the proto definition for this message. If any rules are +// Validate checks the field values on ConfirmFriendRequestRequest with the +// rules defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. -func (m *ConfirmFriendRequestReq) Validate() error { +func (m *ConfirmFriendRequestRequest) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on ConfirmFriendRequestReq with the +// ValidateAll checks the field values on ConfirmFriendRequestRequest with the // rules defined in the proto definition for this message. If any rules are // violated, the result is a list of violation errors wrapped in -// ConfirmFriendRequestReqMultiError, or nil if none found. -func (m *ConfirmFriendRequestReq) ValidateAll() error { +// ConfirmFriendRequestRequestMultiError, or nil if none found. +func (m *ConfirmFriendRequestRequest) ValidateAll() error { return m.validate(true) } -func (m *ConfirmFriendRequestReq) validate(all bool) error { +func (m *ConfirmFriendRequestRequest) validate(all bool) error { if m == nil { return nil } var errors []error - if l := utf8.RuneCountInString(m.GetUid()); l < 20 || l > 24 { - err := ConfirmFriendRequestReqValidationError{ + if m.GetUid() <= 0 { + err := ConfirmFriendRequestRequestValidationError{ field: "Uid", - reason: "value length must be between 20 and 24 runes, inclusive", + reason: "value must be greater than 0", } if !all { return err @@ -1405,7 +1287,7 @@ func (m *ConfirmFriendRequestReq) validate(all bool) error { } if m.GetFriendRequestId() <= 0 { - err := ConfirmFriendRequestReqValidationError{ + err := ConfirmFriendRequestRequestValidationError{ field: "FriendRequestId", reason: "value must be greater than 0", } @@ -1416,7 +1298,7 @@ func (m *ConfirmFriendRequestReq) validate(all bool) error { } if _, ok := ConfirmFriendRequestAction_name[int32(m.GetAction())]; !ok { - err := ConfirmFriendRequestReqValidationError{ + err := ConfirmFriendRequestRequestValidationError{ field: "Action", reason: "value must be one of the defined enum values", } @@ -1427,19 +1309,19 @@ func (m *ConfirmFriendRequestReq) validate(all bool) error { } if len(errors) > 0 { - return ConfirmFriendRequestReqMultiError(errors) + return ConfirmFriendRequestRequestMultiError(errors) } return nil } -// ConfirmFriendRequestReqMultiError is an error wrapping multiple validation -// errors returned by ConfirmFriendRequestReq.ValidateAll() if the designated -// constraints aren't met. -type ConfirmFriendRequestReqMultiError []error +// ConfirmFriendRequestRequestMultiError is an error wrapping multiple +// validation errors returned by ConfirmFriendRequestRequest.ValidateAll() if +// the designated constraints aren't met. +type ConfirmFriendRequestRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m ConfirmFriendRequestReqMultiError) Error() string { +func (m ConfirmFriendRequestRequestMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -1448,11 +1330,12 @@ func (m ConfirmFriendRequestReqMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m ConfirmFriendRequestReqMultiError) AllErrors() []error { return m } +func (m ConfirmFriendRequestRequestMultiError) AllErrors() []error { return m } -// ConfirmFriendRequestReqValidationError is the validation error returned by -// ConfirmFriendRequestReq.Validate if the designated constraints aren't met. -type ConfirmFriendRequestReqValidationError struct { +// ConfirmFriendRequestRequestValidationError is the validation error returned +// by ConfirmFriendRequestRequest.Validate if the designated constraints +// aren't met. +type ConfirmFriendRequestRequestValidationError struct { field string reason string cause error @@ -1460,24 +1343,24 @@ type ConfirmFriendRequestReqValidationError struct { } // Field function returns field value. -func (e ConfirmFriendRequestReqValidationError) Field() string { return e.field } +func (e ConfirmFriendRequestRequestValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e ConfirmFriendRequestReqValidationError) Reason() string { return e.reason } +func (e ConfirmFriendRequestRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e ConfirmFriendRequestReqValidationError) Cause() error { return e.cause } +func (e ConfirmFriendRequestRequestValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e ConfirmFriendRequestReqValidationError) Key() bool { return e.key } +func (e ConfirmFriendRequestRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e ConfirmFriendRequestReqValidationError) ErrorName() string { - return "ConfirmFriendRequestReqValidationError" +func (e ConfirmFriendRequestRequestValidationError) ErrorName() string { + return "ConfirmFriendRequestRequestValidationError" } // Error satisfies the builtin error interface -func (e ConfirmFriendRequestReqValidationError) Error() string { +func (e ConfirmFriendRequestRequestValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -1489,14 +1372,14 @@ func (e ConfirmFriendRequestReqValidationError) Error() string { } return fmt.Sprintf( - "invalid %sConfirmFriendRequestReq.%s: %s%s", + "invalid %sConfirmFriendRequestRequest.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = ConfirmFriendRequestReqValidationError{} +var _ error = ConfirmFriendRequestRequestValidationError{} var _ interface { Field() string @@ -1504,7 +1387,7 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = ConfirmFriendRequestReqValidationError{} +} = ConfirmFriendRequestRequestValidationError{} // Validate checks the field values on GetFriendRequestResponse with the rules // defined in the proto definition for this message. If any rules are @@ -1529,11 +1412,11 @@ func (m *GetFriendRequestResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, GetFriendRequestResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -1541,16 +1424,16 @@ func (m *GetFriendRequestResponse) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, GetFriendRequestResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return GetFriendRequestResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -1688,10 +1571,10 @@ func (m *QueryFriendRequestListRequest) validate(all bool) error { var errors []error - if l := utf8.RuneCountInString(m.GetUid()); l < 20 || l > 24 { + if m.GetUid() <= 0 { err := QueryFriendRequestListRequestValidationError{ field: "Uid", - reason: "value length must be between 20 and 24 runes, inclusive", + reason: "value must be greater than 0", } if !all { return err @@ -1814,11 +1697,11 @@ func (m *QueryFriendRequestListResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, QueryFriendRequestListResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -1826,16 +1709,16 @@ func (m *QueryFriendRequestListResponse) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, QueryFriendRequestListResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return QueryFriendRequestListResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -1979,10 +1862,10 @@ func (m *CheckSendMessageAbilityRequest) validate(all bool) error { var errors []error - if l := utf8.RuneCountInString(m.GetFromUid()); l < 20 || l > 24 { + if m.GetFromUid() <= 0 { err := CheckSendMessageAbilityRequestValidationError{ field: "FromUid", - reason: "value length must be between 20 and 24 runes, inclusive", + reason: "value must be greater than 0", } if !all { return err @@ -1990,10 +1873,10 @@ func (m *CheckSendMessageAbilityRequest) validate(all bool) error { errors = append(errors, err) } - if l := utf8.RuneCountInString(m.GetToUid()); l < 20 || l > 24 { + if m.GetToUid() <= 0 { err := CheckSendMessageAbilityRequestValidationError{ field: "ToUid", - reason: "value length must be between 20 and 24 runes, inclusive", + reason: "value must be greater than 0", } if !all { return err @@ -2107,11 +1990,11 @@ func (m *CheckSendMessageAbilityResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CheckSendMessageAbilityResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -2119,16 +2002,16 @@ func (m *CheckSendMessageAbilityResponse) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CheckSendMessageAbilityResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CheckSendMessageAbilityResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } diff --git a/user/friend/v1/friend.proto b/user/friend/v1/friend.proto index 1653660..563fc72 100644 --- a/user/friend/v1/friend.proto +++ b/user/friend/v1/friend.proto @@ -2,15 +2,15 @@ syntax = "proto3"; package api.user.friend.v1; -import "transport/response/response.proto"; -import "user/session/v1/session.proto"; +import "message/v1/message.proto"; +import "errors/errors.proto"; import "validate/validate.proto"; option go_package = "github.com/go-goim/api/user/friend/v1"; message Friend { - string uid = 1; - string friend_uid = 2; + int64 uid = 1; + int64 friend_uid = 2; string friend_name = 3; string friend_avatar = 4; FriendStatus status = 5; @@ -36,19 +36,18 @@ message UpdateFriendStatusRequest { } message GetFriendResponse { - transport.response.BaseResponse response = 1; + errors.Error error = 1; Friend friend = 2; } message QueryFriendListRequest { - string uid = 1 [(validate.rules).string = { - min_len: 20, - max_len: 24 + int64 uid = 1 [(validate.rules).int64 = { + gt: 0 }]; } message QueryFriendListResponse { - transport.response.BaseResponse response = 1; + errors.Error error = 1; repeated Friend friend_list = 2; } @@ -58,9 +57,9 @@ message QueryFriendListResponse { // FriendRequest is the request data for adding friend message FriendRequest { - int64 id = 1; - string uid = 2; - string friend_uid = 3; + uint64 id = 1; + int64 uid = 2; + int64 friend_uid = 3; FriendRequestStatus status = 4; int64 created_at = 5; int64 updated_at = 6; @@ -78,30 +77,17 @@ enum FriendRequestStatus { REJECTED = 2; } -message AddFriendRequest { - string uid = 1 [(validate.rules).string = { - min_len: 20, - max_len: 24 - }]; - string friend_uid = 2 [(validate.rules).string = { - min_len: 20, - max_len: 24 - }]; -} - message BaseFriendRequest { - string uid = 1 [(validate.rules).string = { - min_len: 20, - max_len: 24 + int64 uid = 1 [(validate.rules).int64 = { + gt: 0 }]; - string friend_uid = 2 [(validate.rules).string = { - min_len: 20, - max_len: 24 + int64 friend_uid = 2 [(validate.rules).int64 = { + gt: 0 }]; } message AddFriendResponse { - transport.response.BaseResponse response = 1; + errors.Error error = 1; AddFriendResult result = 2; } @@ -118,12 +104,11 @@ enum AddFriendStatus { BLOCKED_BY_FRIEND = 4; } -message ConfirmFriendRequestReq { - string uid = 1 [(validate.rules).string = { - min_len: 20, - max_len: 24 +message ConfirmFriendRequestRequest { + int64 uid = 1 [(validate.rules).int64 = { + gt: 0 }]; - int64 friend_request_id = 2 [(validate.rules).int64.gt = 0]; + uint64 friend_request_id = 2 [(validate.rules).uint64.gt = 0]; ConfirmFriendRequestAction action = 3 [(validate.rules).enum.defined_only = true]; } @@ -133,51 +118,48 @@ enum ConfirmFriendRequestAction { } message GetFriendRequestResponse { - transport.response.BaseResponse response = 1; + errors.Error error = 1; FriendRequest friend_request = 2; } message QueryFriendRequestListRequest { - string uid = 1 [(validate.rules).string = { - min_len: 20, - max_len: 24 + int64 uid = 1 [(validate.rules).int64 = { + gt: 0 }]; FriendRequestStatus status = 2 [(validate.rules).enum.defined_only = true]; } message QueryFriendRequestListResponse { - transport.response.BaseResponse response = 1; + errors.Error error = 1; repeated FriendRequest friend_request_list = 2; } // CheckSendMessageAbilityRequest is the request data for checking send message ability. message CheckSendMessageAbilityRequest { - string from_uid = 1 [(validate.rules).string = { - min_len: 20, - max_len: 24 + int64 from_uid = 1 [(validate.rules).int64 = { + gt: 0 }]; - string to_uid = 2 [(validate.rules).string = { - min_len: 20, - max_len: 24 + int64 to_uid = 2 [(validate.rules).int64 = { + gt: 0 }]; - user.session.v1.SessionType session_type = 3; + api.message.v1.SessionType session_type = 3; } message CheckSendMessageAbilityResponse { - transport.response.BaseResponse response = 1; - optional int64 session_id = 2; + errors.Error error = 1; + optional string session_id = 2; } service FriendService { // friend request - rpc AddFriend(AddFriendRequest) returns (AddFriendResponse); - rpc ConfirmFriendRequest(ConfirmFriendRequestReq) returns (transport.response.BaseResponse); + rpc AddFriend(BaseFriendRequest) returns (AddFriendResponse); + rpc ConfirmFriendRequest(ConfirmFriendRequestRequest) returns (errors.Error); rpc GetFriendRequest(BaseFriendRequest) returns (GetFriendRequestResponse); rpc QueryFriendRequestList(QueryFriendRequestListRequest) returns (QueryFriendRequestListResponse); // friend - rpc UpdateFriendStatus(UpdateFriendStatusRequest) returns (transport.response.BaseResponse); - rpc IsFriend(BaseFriendRequest) returns (transport.response.BaseResponse); + rpc UpdateFriendStatus(UpdateFriendStatusRequest) returns (errors.Error); + rpc IsFriend(BaseFriendRequest) returns (errors.Error); rpc GetFriend(BaseFriendRequest) returns (GetFriendResponse); rpc QueryFriendList(QueryFriendListRequest) returns (QueryFriendListResponse); // check send message ability diff --git a/user/friend/v1/friend_grpc.pb.go b/user/friend/v1/friend_grpc.pb.go index dec4ab6..4901f7a 100644 --- a/user/friend/v1/friend_grpc.pb.go +++ b/user/friend/v1/friend_grpc.pb.go @@ -1,10 +1,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: user/friend/v1/friend.proto package v1 import ( context "context" - response "github.com/go-goim/api/transport/response" + errors "github.com/go-goim/api/errors" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -15,18 +19,30 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + FriendService_AddFriend_FullMethodName = "/api.user.friend.v1.FriendService/AddFriend" + FriendService_ConfirmFriendRequest_FullMethodName = "/api.user.friend.v1.FriendService/ConfirmFriendRequest" + FriendService_GetFriendRequest_FullMethodName = "/api.user.friend.v1.FriendService/GetFriendRequest" + FriendService_QueryFriendRequestList_FullMethodName = "/api.user.friend.v1.FriendService/QueryFriendRequestList" + FriendService_UpdateFriendStatus_FullMethodName = "/api.user.friend.v1.FriendService/UpdateFriendStatus" + FriendService_IsFriend_FullMethodName = "/api.user.friend.v1.FriendService/IsFriend" + FriendService_GetFriend_FullMethodName = "/api.user.friend.v1.FriendService/GetFriend" + FriendService_QueryFriendList_FullMethodName = "/api.user.friend.v1.FriendService/QueryFriendList" + FriendService_CheckSendMessageAbility_FullMethodName = "/api.user.friend.v1.FriendService/CheckSendMessageAbility" +) + // FriendServiceClient is the client API for FriendService 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. type FriendServiceClient interface { // friend request - AddFriend(ctx context.Context, in *AddFriendRequest, opts ...grpc.CallOption) (*AddFriendResponse, error) - ConfirmFriendRequest(ctx context.Context, in *ConfirmFriendRequestReq, opts ...grpc.CallOption) (*response.BaseResponse, error) + AddFriend(ctx context.Context, in *BaseFriendRequest, opts ...grpc.CallOption) (*AddFriendResponse, error) + ConfirmFriendRequest(ctx context.Context, in *ConfirmFriendRequestRequest, opts ...grpc.CallOption) (*errors.Error, error) GetFriendRequest(ctx context.Context, in *BaseFriendRequest, opts ...grpc.CallOption) (*GetFriendRequestResponse, error) QueryFriendRequestList(ctx context.Context, in *QueryFriendRequestListRequest, opts ...grpc.CallOption) (*QueryFriendRequestListResponse, error) // friend - UpdateFriendStatus(ctx context.Context, in *UpdateFriendStatusRequest, opts ...grpc.CallOption) (*response.BaseResponse, error) - IsFriend(ctx context.Context, in *BaseFriendRequest, opts ...grpc.CallOption) (*response.BaseResponse, error) + UpdateFriendStatus(ctx context.Context, in *UpdateFriendStatusRequest, opts ...grpc.CallOption) (*errors.Error, error) + IsFriend(ctx context.Context, in *BaseFriendRequest, opts ...grpc.CallOption) (*errors.Error, error) GetFriend(ctx context.Context, in *BaseFriendRequest, opts ...grpc.CallOption) (*GetFriendResponse, error) QueryFriendList(ctx context.Context, in *QueryFriendListRequest, opts ...grpc.CallOption) (*QueryFriendListResponse, error) // check send message ability @@ -43,18 +59,18 @@ func NewFriendServiceClient(cc grpc.ClientConnInterface) FriendServiceClient { return &friendServiceClient{cc} } -func (c *friendServiceClient) AddFriend(ctx context.Context, in *AddFriendRequest, opts ...grpc.CallOption) (*AddFriendResponse, error) { +func (c *friendServiceClient) AddFriend(ctx context.Context, in *BaseFriendRequest, opts ...grpc.CallOption) (*AddFriendResponse, error) { out := new(AddFriendResponse) - err := c.cc.Invoke(ctx, "/api.user.friend.v1.FriendService/AddFriend", in, out, opts...) + err := c.cc.Invoke(ctx, FriendService_AddFriend_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *friendServiceClient) ConfirmFriendRequest(ctx context.Context, in *ConfirmFriendRequestReq, opts ...grpc.CallOption) (*response.BaseResponse, error) { - out := new(response.BaseResponse) - err := c.cc.Invoke(ctx, "/api.user.friend.v1.FriendService/ConfirmFriendRequest", in, out, opts...) +func (c *friendServiceClient) ConfirmFriendRequest(ctx context.Context, in *ConfirmFriendRequestRequest, opts ...grpc.CallOption) (*errors.Error, error) { + out := new(errors.Error) + err := c.cc.Invoke(ctx, FriendService_ConfirmFriendRequest_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -63,7 +79,7 @@ func (c *friendServiceClient) ConfirmFriendRequest(ctx context.Context, in *Conf func (c *friendServiceClient) GetFriendRequest(ctx context.Context, in *BaseFriendRequest, opts ...grpc.CallOption) (*GetFriendRequestResponse, error) { out := new(GetFriendRequestResponse) - err := c.cc.Invoke(ctx, "/api.user.friend.v1.FriendService/GetFriendRequest", in, out, opts...) + err := c.cc.Invoke(ctx, FriendService_GetFriendRequest_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -72,25 +88,25 @@ func (c *friendServiceClient) GetFriendRequest(ctx context.Context, in *BaseFrie func (c *friendServiceClient) QueryFriendRequestList(ctx context.Context, in *QueryFriendRequestListRequest, opts ...grpc.CallOption) (*QueryFriendRequestListResponse, error) { out := new(QueryFriendRequestListResponse) - err := c.cc.Invoke(ctx, "/api.user.friend.v1.FriendService/QueryFriendRequestList", in, out, opts...) + err := c.cc.Invoke(ctx, FriendService_QueryFriendRequestList_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *friendServiceClient) UpdateFriendStatus(ctx context.Context, in *UpdateFriendStatusRequest, opts ...grpc.CallOption) (*response.BaseResponse, error) { - out := new(response.BaseResponse) - err := c.cc.Invoke(ctx, "/api.user.friend.v1.FriendService/UpdateFriendStatus", in, out, opts...) +func (c *friendServiceClient) UpdateFriendStatus(ctx context.Context, in *UpdateFriendStatusRequest, opts ...grpc.CallOption) (*errors.Error, error) { + out := new(errors.Error) + err := c.cc.Invoke(ctx, FriendService_UpdateFriendStatus_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *friendServiceClient) IsFriend(ctx context.Context, in *BaseFriendRequest, opts ...grpc.CallOption) (*response.BaseResponse, error) { - out := new(response.BaseResponse) - err := c.cc.Invoke(ctx, "/api.user.friend.v1.FriendService/IsFriend", in, out, opts...) +func (c *friendServiceClient) IsFriend(ctx context.Context, in *BaseFriendRequest, opts ...grpc.CallOption) (*errors.Error, error) { + out := new(errors.Error) + err := c.cc.Invoke(ctx, FriendService_IsFriend_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -99,7 +115,7 @@ func (c *friendServiceClient) IsFriend(ctx context.Context, in *BaseFriendReques func (c *friendServiceClient) GetFriend(ctx context.Context, in *BaseFriendRequest, opts ...grpc.CallOption) (*GetFriendResponse, error) { out := new(GetFriendResponse) - err := c.cc.Invoke(ctx, "/api.user.friend.v1.FriendService/GetFriend", in, out, opts...) + err := c.cc.Invoke(ctx, FriendService_GetFriend_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -108,7 +124,7 @@ func (c *friendServiceClient) GetFriend(ctx context.Context, in *BaseFriendReque func (c *friendServiceClient) QueryFriendList(ctx context.Context, in *QueryFriendListRequest, opts ...grpc.CallOption) (*QueryFriendListResponse, error) { out := new(QueryFriendListResponse) - err := c.cc.Invoke(ctx, "/api.user.friend.v1.FriendService/QueryFriendList", in, out, opts...) + err := c.cc.Invoke(ctx, FriendService_QueryFriendList_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -117,7 +133,7 @@ func (c *friendServiceClient) QueryFriendList(ctx context.Context, in *QueryFrie func (c *friendServiceClient) CheckSendMessageAbility(ctx context.Context, in *CheckSendMessageAbilityRequest, opts ...grpc.CallOption) (*CheckSendMessageAbilityResponse, error) { out := new(CheckSendMessageAbilityResponse) - err := c.cc.Invoke(ctx, "/api.user.friend.v1.FriendService/CheckSendMessageAbility", in, out, opts...) + err := c.cc.Invoke(ctx, FriendService_CheckSendMessageAbility_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -129,13 +145,13 @@ func (c *friendServiceClient) CheckSendMessageAbility(ctx context.Context, in *C // for forward compatibility type FriendServiceServer interface { // friend request - AddFriend(context.Context, *AddFriendRequest) (*AddFriendResponse, error) - ConfirmFriendRequest(context.Context, *ConfirmFriendRequestReq) (*response.BaseResponse, error) + AddFriend(context.Context, *BaseFriendRequest) (*AddFriendResponse, error) + ConfirmFriendRequest(context.Context, *ConfirmFriendRequestRequest) (*errors.Error, error) GetFriendRequest(context.Context, *BaseFriendRequest) (*GetFriendRequestResponse, error) QueryFriendRequestList(context.Context, *QueryFriendRequestListRequest) (*QueryFriendRequestListResponse, error) // friend - UpdateFriendStatus(context.Context, *UpdateFriendStatusRequest) (*response.BaseResponse, error) - IsFriend(context.Context, *BaseFriendRequest) (*response.BaseResponse, error) + UpdateFriendStatus(context.Context, *UpdateFriendStatusRequest) (*errors.Error, error) + IsFriend(context.Context, *BaseFriendRequest) (*errors.Error, error) GetFriend(context.Context, *BaseFriendRequest) (*GetFriendResponse, error) QueryFriendList(context.Context, *QueryFriendListRequest) (*QueryFriendListResponse, error) // check send message ability @@ -149,10 +165,10 @@ type FriendServiceServer interface { type UnimplementedFriendServiceServer struct { } -func (UnimplementedFriendServiceServer) AddFriend(context.Context, *AddFriendRequest) (*AddFriendResponse, error) { +func (UnimplementedFriendServiceServer) AddFriend(context.Context, *BaseFriendRequest) (*AddFriendResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddFriend not implemented") } -func (UnimplementedFriendServiceServer) ConfirmFriendRequest(context.Context, *ConfirmFriendRequestReq) (*response.BaseResponse, error) { +func (UnimplementedFriendServiceServer) ConfirmFriendRequest(context.Context, *ConfirmFriendRequestRequest) (*errors.Error, error) { return nil, status.Errorf(codes.Unimplemented, "method ConfirmFriendRequest not implemented") } func (UnimplementedFriendServiceServer) GetFriendRequest(context.Context, *BaseFriendRequest) (*GetFriendRequestResponse, error) { @@ -161,10 +177,10 @@ func (UnimplementedFriendServiceServer) GetFriendRequest(context.Context, *BaseF func (UnimplementedFriendServiceServer) QueryFriendRequestList(context.Context, *QueryFriendRequestListRequest) (*QueryFriendRequestListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryFriendRequestList not implemented") } -func (UnimplementedFriendServiceServer) UpdateFriendStatus(context.Context, *UpdateFriendStatusRequest) (*response.BaseResponse, error) { +func (UnimplementedFriendServiceServer) UpdateFriendStatus(context.Context, *UpdateFriendStatusRequest) (*errors.Error, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateFriendStatus not implemented") } -func (UnimplementedFriendServiceServer) IsFriend(context.Context, *BaseFriendRequest) (*response.BaseResponse, error) { +func (UnimplementedFriendServiceServer) IsFriend(context.Context, *BaseFriendRequest) (*errors.Error, error) { return nil, status.Errorf(codes.Unimplemented, "method IsFriend not implemented") } func (UnimplementedFriendServiceServer) GetFriend(context.Context, *BaseFriendRequest) (*GetFriendResponse, error) { @@ -190,7 +206,7 @@ func RegisterFriendServiceServer(s grpc.ServiceRegistrar, srv FriendServiceServe } func _FriendService_AddFriend_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddFriendRequest) + in := new(BaseFriendRequest) if err := dec(in); err != nil { return nil, err } @@ -199,16 +215,16 @@ func _FriendService_AddFriend_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.friend.v1.FriendService/AddFriend", + FullMethod: FriendService_AddFriend_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FriendServiceServer).AddFriend(ctx, req.(*AddFriendRequest)) + return srv.(FriendServiceServer).AddFriend(ctx, req.(*BaseFriendRequest)) } return interceptor(ctx, in, info, handler) } func _FriendService_ConfirmFriendRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ConfirmFriendRequestReq) + in := new(ConfirmFriendRequestRequest) if err := dec(in); err != nil { return nil, err } @@ -217,10 +233,10 @@ func _FriendService_ConfirmFriendRequest_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.friend.v1.FriendService/ConfirmFriendRequest", + FullMethod: FriendService_ConfirmFriendRequest_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(FriendServiceServer).ConfirmFriendRequest(ctx, req.(*ConfirmFriendRequestReq)) + return srv.(FriendServiceServer).ConfirmFriendRequest(ctx, req.(*ConfirmFriendRequestRequest)) } return interceptor(ctx, in, info, handler) } @@ -235,7 +251,7 @@ func _FriendService_GetFriendRequest_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.friend.v1.FriendService/GetFriendRequest", + FullMethod: FriendService_GetFriendRequest_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FriendServiceServer).GetFriendRequest(ctx, req.(*BaseFriendRequest)) @@ -253,7 +269,7 @@ func _FriendService_QueryFriendRequestList_Handler(srv interface{}, ctx context. } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.friend.v1.FriendService/QueryFriendRequestList", + FullMethod: FriendService_QueryFriendRequestList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FriendServiceServer).QueryFriendRequestList(ctx, req.(*QueryFriendRequestListRequest)) @@ -271,7 +287,7 @@ func _FriendService_UpdateFriendStatus_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.friend.v1.FriendService/UpdateFriendStatus", + FullMethod: FriendService_UpdateFriendStatus_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FriendServiceServer).UpdateFriendStatus(ctx, req.(*UpdateFriendStatusRequest)) @@ -289,7 +305,7 @@ func _FriendService_IsFriend_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.friend.v1.FriendService/IsFriend", + FullMethod: FriendService_IsFriend_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FriendServiceServer).IsFriend(ctx, req.(*BaseFriendRequest)) @@ -307,7 +323,7 @@ func _FriendService_GetFriend_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.friend.v1.FriendService/GetFriend", + FullMethod: FriendService_GetFriend_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FriendServiceServer).GetFriend(ctx, req.(*BaseFriendRequest)) @@ -325,7 +341,7 @@ func _FriendService_QueryFriendList_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.friend.v1.FriendService/QueryFriendList", + FullMethod: FriendService_QueryFriendList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FriendServiceServer).QueryFriendList(ctx, req.(*QueryFriendListRequest)) @@ -343,7 +359,7 @@ func _FriendService_CheckSendMessageAbility_Handler(srv interface{}, ctx context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.friend.v1.FriendService/CheckSendMessageAbility", + FullMethod: FriendService_CheckSendMessageAbility_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FriendServiceServer).CheckSendMessageAbility(ctx, req.(*CheckSendMessageAbilityRequest)) diff --git a/user/group/v1/group.pb.go b/user/group/v1/group.pb.go index f332102..0fa2d90 100644 --- a/user/group/v1/group.pb.go +++ b/user/group/v1/group.pb.go @@ -1,13 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: user/group/v1/group.proto package v1 import ( - response "github.com/go-goim/api/transport/response" + errors "github.com/go-goim/api/errors" v1 "github.com/go-goim/api/user/v1" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -165,12 +165,11 @@ type Group struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Gid string `protobuf:"bytes,2,opt,name=gid,proto3" json:"gid,omitempty"` + Gid int64 `protobuf:"varint,2,opt,name=gid,proto3" json:"gid,omitempty"` Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` - OwnerUid string `protobuf:"bytes,6,opt,name=owner_uid,json=ownerUid,proto3" json:"owner_uid,omitempty"` + OwnerUid int64 `protobuf:"varint,6,opt,name=owner_uid,json=ownerUid,proto3" json:"owner_uid,omitempty"` Owner *GroupMember `protobuf:"bytes,7,opt,name=owner,proto3,oneof" json:"owner,omitempty"` Members []*GroupMember `protobuf:"bytes,8,rep,name=members,proto3" json:"members,omitempty"` MaxMembers int32 `protobuf:"varint,9,opt,name=max_members,json=maxMembers,proto3" json:"max_members,omitempty"` @@ -210,18 +209,11 @@ func (*Group) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{0} } -func (x *Group) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Group) GetGid() string { +func (x *Group) GetGid() int64 { if x != nil { return x.Gid } - return "" + return 0 } func (x *Group) GetName() string { @@ -245,11 +237,11 @@ func (x *Group) GetAvatar() string { return "" } -func (x *Group) GetOwnerUid() string { +func (x *Group) GetOwnerUid() int64 { if x != nil { return x.OwnerUid } - return "" + return 0 } func (x *Group) GetOwner() *GroupMember { @@ -292,9 +284,8 @@ type GroupMember struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // use as session id - Gid string `protobuf:"bytes,2,opt,name=gid,proto3" json:"gid,omitempty"` - Uid string `protobuf:"bytes,3,opt,name=uid,proto3" json:"uid,omitempty"` + Gid int64 `protobuf:"varint,2,opt,name=gid,proto3" json:"gid,omitempty"` + Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` User *v1.User `protobuf:"bytes,4,opt,name=user,proto3,oneof" json:"user,omitempty"` Status GroupMember_Status `protobuf:"varint,5,opt,name=status,proto3,enum=api.user.group.v1.GroupMember_Status" json:"status,omitempty"` Type GroupMember_Type `protobuf:"varint,6,opt,name=type,proto3,enum=api.user.group.v1.GroupMember_Type" json:"type,omitempty"` @@ -332,25 +323,18 @@ func (*GroupMember) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{1} } -func (x *GroupMember) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *GroupMember) GetGid() string { +func (x *GroupMember) GetGid() int64 { if x != nil { return x.Gid } - return "" + return 0 } -func (x *GroupMember) GetUid() string { +func (x *GroupMember) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } func (x *GroupMember) GetUser() *v1.User { @@ -379,8 +363,10 @@ type GetGroupRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Gid string `protobuf:"bytes,1,opt,name=gid,proto3" json:"gid,omitempty"` - WithMembers bool `protobuf:"varint,2,opt,name=with_members,json=withMembers,proto3" json:"with_members,omitempty"` + Gid int64 `protobuf:"varint,1,opt,name=gid,proto3" json:"gid,omitempty"` + OwnerUid int64 `protobuf:"varint,2,opt,name=owner_uid,json=ownerUid,proto3" json:"owner_uid,omitempty"` + WithMembers bool `protobuf:"varint,3,opt,name=with_members,json=withMembers,proto3" json:"with_members,omitempty"` + WithInfo bool `protobuf:"varint,4,opt,name=with_info,json=withInfo,proto3" json:"with_info,omitempty"` } func (x *GetGroupRequest) Reset() { @@ -415,11 +401,18 @@ func (*GetGroupRequest) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{2} } -func (x *GetGroupRequest) GetGid() string { +func (x *GetGroupRequest) GetGid() int64 { if x != nil { return x.Gid } - return "" + return 0 +} + +func (x *GetGroupRequest) GetOwnerUid() int64 { + if x != nil { + return x.OwnerUid + } + return 0 } func (x *GetGroupRequest) GetWithMembers() bool { @@ -429,13 +422,20 @@ func (x *GetGroupRequest) GetWithMembers() bool { return false } +func (x *GetGroupRequest) GetWithInfo() bool { + if x != nil { + return x.WithInfo + } + return false +} + type GetGroupResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Group *Group `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Group *Group `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` } func (x *GetGroupResponse) Reset() { @@ -470,9 +470,9 @@ func (*GetGroupResponse) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{3} } -func (x *GetGroupResponse) GetResponse() *response.BaseResponse { +func (x *GetGroupResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } @@ -490,9 +490,9 @@ type ListGroupsRequest struct { unknownFields protoimpl.UnknownFields // list all groups no matter user is member or owner. - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` - PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + Page int32 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` + PageSize int32 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` } func (x *ListGroupsRequest) Reset() { @@ -527,11 +527,11 @@ func (*ListGroupsRequest) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{4} } -func (x *ListGroupsRequest) GetUid() string { +func (x *ListGroupsRequest) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } func (x *ListGroupsRequest) GetPage() int32 { @@ -553,8 +553,8 @@ type ListGroupsResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Groups []*Group `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Groups []*Group `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"` } func (x *ListGroupsResponse) Reset() { @@ -589,9 +589,9 @@ func (*ListGroupsResponse) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{5} } -func (x *ListGroupsResponse) GetResponse() *response.BaseResponse { +func (x *ListGroupsResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } @@ -608,11 +608,11 @@ type CreateGroupRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` - OwnerUid string `protobuf:"bytes,4,opt,name=owner_uid,json=ownerUid,proto3" json:"owner_uid,omitempty"` - MembersUid []string `protobuf:"bytes,5,rep,name=members_uid,json=membersUid,proto3" json:"members_uid,omitempty"` // todo: limit to small number + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Avatar string `protobuf:"bytes,3,opt,name=avatar,proto3" json:"avatar,omitempty"` + OwnerUid int64 `protobuf:"varint,4,opt,name=owner_uid,json=ownerUid,proto3" json:"owner_uid,omitempty"` + MembersUid []int64 `protobuf:"varint,5,rep,packed,name=members_uid,json=membersUid,proto3" json:"members_uid,omitempty"` } func (x *CreateGroupRequest) Reset() { @@ -668,14 +668,14 @@ func (x *CreateGroupRequest) GetAvatar() string { return "" } -func (x *CreateGroupRequest) GetOwnerUid() string { +func (x *CreateGroupRequest) GetOwnerUid() int64 { if x != nil { return x.OwnerUid } - return "" + return 0 } -func (x *CreateGroupRequest) GetMembersUid() []string { +func (x *CreateGroupRequest) GetMembersUid() []int64 { if x != nil { return x.MembersUid } @@ -687,8 +687,8 @@ type CreateGroupResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Group *Group `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Group *Group `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` } func (x *CreateGroupResponse) Reset() { @@ -723,9 +723,9 @@ func (*CreateGroupResponse) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{7} } -func (x *CreateGroupResponse) GetResponse() *response.BaseResponse { +func (x *CreateGroupResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } @@ -742,11 +742,11 @@ type UpdateGroupRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Gid string `protobuf:"bytes,1,opt,name=gid,proto3" json:"gid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` - Uid string `protobuf:"bytes,5,opt,name=uid,proto3" json:"uid,omitempty"` // current user id + Gid int64 `protobuf:"varint,1,opt,name=gid,proto3" json:"gid,omitempty"` + Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` + Description *string `protobuf:"bytes,3,opt,name=description,proto3,oneof" json:"description,omitempty"` + Avatar *string `protobuf:"bytes,4,opt,name=avatar,proto3,oneof" json:"avatar,omitempty"` + OwnerUid int64 `protobuf:"varint,5,opt,name=owner_uid,json=ownerUid,proto3" json:"owner_uid,omitempty"` // current user id } func (x *UpdateGroupRequest) Reset() { @@ -781,39 +781,39 @@ func (*UpdateGroupRequest) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{8} } -func (x *UpdateGroupRequest) GetGid() string { +func (x *UpdateGroupRequest) GetGid() int64 { if x != nil { return x.Gid } - return "" + return 0 } func (x *UpdateGroupRequest) GetName() string { - if x != nil { - return x.Name + if x != nil && x.Name != nil { + return *x.Name } return "" } func (x *UpdateGroupRequest) GetDescription() string { - if x != nil { - return x.Description + if x != nil && x.Description != nil { + return *x.Description } return "" } func (x *UpdateGroupRequest) GetAvatar() string { - if x != nil { - return x.Avatar + if x != nil && x.Avatar != nil { + return *x.Avatar } return "" } -func (x *UpdateGroupRequest) GetUid() string { +func (x *UpdateGroupRequest) GetOwnerUid() int64 { if x != nil { - return x.Uid + return x.OwnerUid } - return "" + return 0 } type UpdateGroupResponse struct { @@ -821,8 +821,8 @@ type UpdateGroupResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Group *Group `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Group *Group `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"` } func (x *UpdateGroupResponse) Reset() { @@ -857,9 +857,9 @@ func (*UpdateGroupResponse) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{9} } -func (x *UpdateGroupResponse) GetResponse() *response.BaseResponse { +func (x *UpdateGroupResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } @@ -876,8 +876,8 @@ type DeleteGroupRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Gid string `protobuf:"bytes,1,opt,name=gid,proto3" json:"gid,omitempty"` - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` + Gid int64 `protobuf:"varint,1,opt,name=gid,proto3" json:"gid,omitempty"` + OwnerUid int64 `protobuf:"varint,2,opt,name=owner_uid,json=ownerUid,proto3" json:"owner_uid,omitempty"` } func (x *DeleteGroupRequest) Reset() { @@ -912,31 +912,33 @@ func (*DeleteGroupRequest) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{10} } -func (x *DeleteGroupRequest) GetGid() string { +func (x *DeleteGroupRequest) GetGid() int64 { if x != nil { return x.Gid } - return "" + return 0 } -func (x *DeleteGroupRequest) GetUid() string { +func (x *DeleteGroupRequest) GetOwnerUid() int64 { if x != nil { - return x.Uid + return x.OwnerUid } - return "" + return 0 } -type AddGroupMemberRequest struct { +// ChangeGroupMemberRequest add or remove group member +type ChangeGroupMemberRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Gid string `protobuf:"bytes,1,opt,name=gid,proto3" json:"gid,omitempty"` - Uid []string `protobuf:"bytes,2,rep,name=uid,proto3" json:"uid,omitempty"` + Gid int64 `protobuf:"varint,1,opt,name=gid,proto3" json:"gid,omitempty"` + OwnerUid int64 `protobuf:"varint,2,opt,name=owner_uid,json=ownerUid,proto3" json:"owner_uid,omitempty"` + Uids []int64 `protobuf:"varint,3,rep,packed,name=uids,proto3" json:"uids,omitempty"` } -func (x *AddGroupMemberRequest) Reset() { - *x = AddGroupMemberRequest{} +func (x *ChangeGroupMemberRequest) Reset() { + *x = ChangeGroupMemberRequest{} if protoimpl.UnsafeEnabled { mi := &file_user_group_v1_group_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -944,13 +946,13 @@ func (x *AddGroupMemberRequest) Reset() { } } -func (x *AddGroupMemberRequest) String() string { +func (x *ChangeGroupMemberRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*AddGroupMemberRequest) ProtoMessage() {} +func (*ChangeGroupMemberRequest) ProtoMessage() {} -func (x *AddGroupMemberRequest) ProtoReflect() protoreflect.Message { +func (x *ChangeGroupMemberRequest) ProtoReflect() protoreflect.Message { mi := &file_user_group_v1_group_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -962,161 +964,58 @@ func (x *AddGroupMemberRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AddGroupMemberRequest.ProtoReflect.Descriptor instead. -func (*AddGroupMemberRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use ChangeGroupMemberRequest.ProtoReflect.Descriptor instead. +func (*ChangeGroupMemberRequest) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{11} } -func (x *AddGroupMemberRequest) GetGid() string { +func (x *ChangeGroupMemberRequest) GetGid() int64 { if x != nil { return x.Gid } - return "" -} - -func (x *AddGroupMemberRequest) GetUid() []string { - if x != nil { - return x.Uid - } - return nil -} - -type AddGroupMemberResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Added int32 `protobuf:"varint,2,opt,name=added,proto3" json:"added,omitempty"` -} - -func (x *AddGroupMemberResponse) Reset() { - *x = AddGroupMemberResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_user_group_v1_group_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddGroupMemberResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddGroupMemberResponse) ProtoMessage() {} - -func (x *AddGroupMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_group_v1_group_proto_msgTypes[12] - 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) -} - -// Deprecated: Use AddGroupMemberResponse.ProtoReflect.Descriptor instead. -func (*AddGroupMemberResponse) Descriptor() ([]byte, []int) { - return file_user_group_v1_group_proto_rawDescGZIP(), []int{12} -} - -func (x *AddGroupMemberResponse) GetResponse() *response.BaseResponse { - if x != nil { - return x.Response - } - return nil -} - -func (x *AddGroupMemberResponse) GetAdded() int32 { - if x != nil { - return x.Added - } return 0 } -type RemoveGroupMemberRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Gid string `protobuf:"bytes,1,opt,name=gid,proto3" json:"gid,omitempty"` - Uid []string `protobuf:"bytes,2,rep,name=uid,proto3" json:"uid,omitempty"` -} - -func (x *RemoveGroupMemberRequest) Reset() { - *x = RemoveGroupMemberRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_user_group_v1_group_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveGroupMemberRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveGroupMemberRequest) ProtoMessage() {} - -func (x *RemoveGroupMemberRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_group_v1_group_proto_msgTypes[13] - 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) -} - -// Deprecated: Use RemoveGroupMemberRequest.ProtoReflect.Descriptor instead. -func (*RemoveGroupMemberRequest) Descriptor() ([]byte, []int) { - return file_user_group_v1_group_proto_rawDescGZIP(), []int{13} -} - -func (x *RemoveGroupMemberRequest) GetGid() string { +func (x *ChangeGroupMemberRequest) GetOwnerUid() int64 { if x != nil { - return x.Gid + return x.OwnerUid } - return "" + return 0 } -func (x *RemoveGroupMemberRequest) GetUid() []string { +func (x *ChangeGroupMemberRequest) GetUids() []int64 { if x != nil { - return x.Uid + return x.Uids } return nil } -type RemoveGroupMemberResponse struct { +type ChangeGroupMemberResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - Removed int32 `protobuf:"varint,2,opt,name=removed,proto3" json:"removed,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + Count int32 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` // count of members changed } -func (x *RemoveGroupMemberResponse) Reset() { - *x = RemoveGroupMemberResponse{} +func (x *ChangeGroupMemberResponse) Reset() { + *x = ChangeGroupMemberResponse{} if protoimpl.UnsafeEnabled { - mi := &file_user_group_v1_group_proto_msgTypes[14] + mi := &file_user_group_v1_group_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *RemoveGroupMemberResponse) String() string { +func (x *ChangeGroupMemberResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RemoveGroupMemberResponse) ProtoMessage() {} +func (*ChangeGroupMemberResponse) ProtoMessage() {} -func (x *RemoveGroupMemberResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_group_v1_group_proto_msgTypes[14] +func (x *ChangeGroupMemberResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_group_v1_group_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1127,21 +1026,21 @@ func (x *RemoveGroupMemberResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use RemoveGroupMemberResponse.ProtoReflect.Descriptor instead. -func (*RemoveGroupMemberResponse) Descriptor() ([]byte, []int) { - return file_user_group_v1_group_proto_rawDescGZIP(), []int{14} +// Deprecated: Use ChangeGroupMemberResponse.ProtoReflect.Descriptor instead. +func (*ChangeGroupMemberResponse) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{12} } -func (x *RemoveGroupMemberResponse) GetResponse() *response.BaseResponse { +func (x *ChangeGroupMemberResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } -func (x *RemoveGroupMemberResponse) GetRemoved() int32 { +func (x *ChangeGroupMemberResponse) GetCount() int32 { if x != nil { - return x.Removed + return x.Count } return 0 } @@ -1151,194 +1050,181 @@ var File_user_group_v1_group_proto protoreflect.FileDescriptor var file_user_group_v1_group_proto_rawDesc = []byte{ 0x0a, 0x19, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x61, 0x70, 0x69, - 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x21, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x12, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8f, 0x03, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x67, 0x69, - 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, - 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, - 0x1b, 0x0a, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x69, 0x64, 0x12, 0x39, 0x0a, 0x05, - 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x48, 0x00, 0x52, 0x05, 0x6f, - 0x77, 0x6e, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x08, 0x0a, - 0x06, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0xc3, 0x02, 0x0a, 0x0b, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x48, 0x00, 0x52, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x1a, 0x13, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xff, 0x02, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x67, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, + 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, + 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x69, 0x64, 0x12, 0x39, + 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x48, 0x00, 0x52, + 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x07, 0x6d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x61, 0x78, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x4d, 0x65, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x62, + 0x65, 0x72, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, - 0x2c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x69, 0x6c, 0x65, 0x6e, 0x74, 0x10, 0x01, 0x22, 0x25, 0x0a, - 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x79, 0x70, 0x65, 0x4f, 0x77, 0x6e, - 0x65, 0x72, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x4d, 0x65, 0x6d, 0x62, - 0x65, 0x72, 0x10, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x22, 0x46, 0x0a, - 0x0f, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x67, + 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, + 0x08, 0x0a, 0x06, 0x5f, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x22, 0xb3, 0x02, 0x0a, 0x0b, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2a, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x48, 0x00, + 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x22, 0x2c, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x10, 0x0a, 0x0c, 0x53, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, 0x00, 0x12, 0x10, 0x0a, + 0x0c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x53, 0x69, 0x6c, 0x65, 0x6e, 0x74, 0x10, 0x01, 0x22, + 0x25, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x79, 0x70, 0x65, 0x4f, + 0x77, 0x6e, 0x65, 0x72, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x10, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x22, + 0x80, 0x01, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x75, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x6d, 0x65, 0x6d, 0x62, 0x65, - 0x72, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x4d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0x84, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x56, 0x0a, 0x11, - 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, - 0x53, 0x69, 0x7a, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, - 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, - 0xa0, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, - 0x61, 0x74, 0x61, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x75, 0x69, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x69, - 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x75, 0x69, 0x64, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x55, - 0x69, 0x64, 0x22, 0x87, 0x01, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x86, 0x01, 0x0a, - 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, - 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, - 0x74, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x87, 0x01, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, - 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x72, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x77, 0x69, 0x74, 0x68, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x77, 0x69, 0x74, 0x68, 0x49, 0x6e, + 0x66, 0x6f, 0x22, 0x6b, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2e, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, - 0x38, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x3b, 0x0a, 0x15, 0x41, 0x64, 0x64, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x67, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x70, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, - 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x64, 0x64, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x05, 0x61, 0x64, 0x64, 0x65, 0x64, 0x22, 0x3e, 0x0a, 0x18, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x77, 0x0a, 0x19, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, - 0x64, 0x2a, 0x25, 0x0a, 0x0b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, - 0x53, 0x69, 0x6c, 0x65, 0x6e, 0x74, 0x10, 0x01, 0x32, 0xad, 0x05, 0x0a, 0x0c, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x47, 0x65, 0x74, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, - 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x24, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0b, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, + 0x56, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, + 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, + 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x6f, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x22, 0xa0, 0x01, 0x0a, 0x12, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1b, 0x0a, + 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x73, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x05, 0x20, 0x03, 0x28, 0x03, 0x52, + 0x0a, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x55, 0x69, 0x64, 0x22, 0x6e, 0x0a, 0x13, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2e, 0x0a, 0x05, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0xc4, 0x01, 0x0a, 0x12, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x03, 0x67, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x88, 0x01, + 0x01, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, 0x69, 0x64, 0x42, 0x07, + 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, 0x76, 0x61, 0x74, + 0x61, 0x72, 0x22, 0x6e, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x2e, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x22, 0x43, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x77, + 0x6e, 0x65, 0x72, 0x5f, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, + 0x77, 0x6e, 0x65, 0x72, 0x55, 0x69, 0x64, 0x22, 0x5d, 0x0a, 0x18, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x03, 0x67, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x5f, 0x75, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x55, + 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x69, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x03, + 0x52, 0x04, 0x75, 0x69, 0x64, 0x73, 0x22, 0x5a, 0x0a, 0x19, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x2a, 0x25, 0x0a, 0x0b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, + 0x06, 0x53, 0x69, 0x6c, 0x65, 0x6e, 0x74, 0x10, 0x01, 0x32, 0xa0, 0x05, 0x0a, 0x0c, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x08, 0x47, 0x65, + 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x59, 0x0a, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x65, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x12, 0x28, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, - 0x31, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, - 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2b, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, - 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x26, 0x5a, 0x24, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x76, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0b, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x26, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, + 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, + 0x6b, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x2b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x11, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, + 0x72, 0x12, 0x2b, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, + 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x26, 0x5a, 0x24, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x6f, + 0x69, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1354,7 +1240,7 @@ func file_user_group_v1_group_proto_rawDescGZIP() []byte { } var file_user_group_v1_group_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_user_group_v1_group_proto_msgTypes = make([]protoimpl.MessageInfo, 15) +var file_user_group_v1_group_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_user_group_v1_group_proto_goTypes = []interface{}{ (GroupStatus)(0), // 0: api.user.group.v1.GroupStatus (GroupMember_Status)(0), // 1: api.user.group.v1.GroupMember.Status @@ -1370,49 +1256,46 @@ var file_user_group_v1_group_proto_goTypes = []interface{}{ (*UpdateGroupRequest)(nil), // 11: api.user.group.v1.UpdateGroupRequest (*UpdateGroupResponse)(nil), // 12: api.user.group.v1.UpdateGroupResponse (*DeleteGroupRequest)(nil), // 13: api.user.group.v1.DeleteGroupRequest - (*AddGroupMemberRequest)(nil), // 14: api.user.group.v1.AddGroupMemberRequest - (*AddGroupMemberResponse)(nil), // 15: api.user.group.v1.AddGroupMemberResponse - (*RemoveGroupMemberRequest)(nil), // 16: api.user.group.v1.RemoveGroupMemberRequest - (*RemoveGroupMemberResponse)(nil), // 17: api.user.group.v1.RemoveGroupMemberResponse - (*v1.User)(nil), // 18: api.user.v1.User - (*response.BaseResponse)(nil), // 19: api.transport.response.BaseResponse + (*ChangeGroupMemberRequest)(nil), // 14: api.user.group.v1.ChangeGroupMemberRequest + (*ChangeGroupMemberResponse)(nil), // 15: api.user.group.v1.ChangeGroupMemberResponse + (*v1.User)(nil), // 16: api.user.v1.User + (*errors.Error)(nil), // 17: api.errors.Error } var file_user_group_v1_group_proto_depIdxs = []int32{ 4, // 0: api.user.group.v1.Group.owner:type_name -> api.user.group.v1.GroupMember 4, // 1: api.user.group.v1.Group.members:type_name -> api.user.group.v1.GroupMember 0, // 2: api.user.group.v1.Group.status:type_name -> api.user.group.v1.GroupStatus - 18, // 3: api.user.group.v1.GroupMember.user:type_name -> api.user.v1.User + 16, // 3: api.user.group.v1.GroupMember.user:type_name -> api.user.v1.User 1, // 4: api.user.group.v1.GroupMember.status:type_name -> api.user.group.v1.GroupMember.Status 2, // 5: api.user.group.v1.GroupMember.type:type_name -> api.user.group.v1.GroupMember.Type - 19, // 6: api.user.group.v1.GetGroupResponse.response:type_name -> api.transport.response.BaseResponse + 17, // 6: api.user.group.v1.GetGroupResponse.error:type_name -> api.errors.Error 3, // 7: api.user.group.v1.GetGroupResponse.group:type_name -> api.user.group.v1.Group - 19, // 8: api.user.group.v1.ListGroupsResponse.response:type_name -> api.transport.response.BaseResponse + 17, // 8: api.user.group.v1.ListGroupsResponse.error:type_name -> api.errors.Error 3, // 9: api.user.group.v1.ListGroupsResponse.groups:type_name -> api.user.group.v1.Group - 19, // 10: api.user.group.v1.CreateGroupResponse.response:type_name -> api.transport.response.BaseResponse + 17, // 10: api.user.group.v1.CreateGroupResponse.error:type_name -> api.errors.Error 3, // 11: api.user.group.v1.CreateGroupResponse.group:type_name -> api.user.group.v1.Group - 19, // 12: api.user.group.v1.UpdateGroupResponse.response:type_name -> api.transport.response.BaseResponse + 17, // 12: api.user.group.v1.UpdateGroupResponse.error:type_name -> api.errors.Error 3, // 13: api.user.group.v1.UpdateGroupResponse.group:type_name -> api.user.group.v1.Group - 19, // 14: api.user.group.v1.AddGroupMemberResponse.response:type_name -> api.transport.response.BaseResponse - 19, // 15: api.user.group.v1.RemoveGroupMemberResponse.response:type_name -> api.transport.response.BaseResponse - 5, // 16: api.user.group.v1.GroupService.GetGroup:input_type -> api.user.group.v1.GetGroupRequest - 7, // 17: api.user.group.v1.GroupService.ListGroups:input_type -> api.user.group.v1.ListGroupsRequest - 9, // 18: api.user.group.v1.GroupService.CreateGroup:input_type -> api.user.group.v1.CreateGroupRequest - 11, // 19: api.user.group.v1.GroupService.UpdateGroup:input_type -> api.user.group.v1.UpdateGroupRequest - 13, // 20: api.user.group.v1.GroupService.DeleteGroup:input_type -> api.user.group.v1.DeleteGroupRequest - 14, // 21: api.user.group.v1.GroupService.AddGroupMember:input_type -> api.user.group.v1.AddGroupMemberRequest - 16, // 22: api.user.group.v1.GroupService.RemoveGroupMember:input_type -> api.user.group.v1.RemoveGroupMemberRequest - 6, // 23: api.user.group.v1.GroupService.GetGroup:output_type -> api.user.group.v1.GetGroupResponse - 8, // 24: api.user.group.v1.GroupService.ListGroups:output_type -> api.user.group.v1.ListGroupsResponse - 10, // 25: api.user.group.v1.GroupService.CreateGroup:output_type -> api.user.group.v1.CreateGroupResponse - 12, // 26: api.user.group.v1.GroupService.UpdateGroup:output_type -> api.user.group.v1.UpdateGroupResponse - 19, // 27: api.user.group.v1.GroupService.DeleteGroup:output_type -> api.transport.response.BaseResponse - 15, // 28: api.user.group.v1.GroupService.AddGroupMember:output_type -> api.user.group.v1.AddGroupMemberResponse - 17, // 29: api.user.group.v1.GroupService.RemoveGroupMember:output_type -> api.user.group.v1.RemoveGroupMemberResponse - 23, // [23:30] is the sub-list for method output_type - 16, // [16:23] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 17, // 14: api.user.group.v1.ChangeGroupMemberResponse.error:type_name -> api.errors.Error + 5, // 15: api.user.group.v1.GroupService.GetGroup:input_type -> api.user.group.v1.GetGroupRequest + 7, // 16: api.user.group.v1.GroupService.ListGroups:input_type -> api.user.group.v1.ListGroupsRequest + 9, // 17: api.user.group.v1.GroupService.CreateGroup:input_type -> api.user.group.v1.CreateGroupRequest + 11, // 18: api.user.group.v1.GroupService.UpdateGroup:input_type -> api.user.group.v1.UpdateGroupRequest + 13, // 19: api.user.group.v1.GroupService.DeleteGroup:input_type -> api.user.group.v1.DeleteGroupRequest + 14, // 20: api.user.group.v1.GroupService.AddGroupMember:input_type -> api.user.group.v1.ChangeGroupMemberRequest + 14, // 21: api.user.group.v1.GroupService.RemoveGroupMember:input_type -> api.user.group.v1.ChangeGroupMemberRequest + 6, // 22: api.user.group.v1.GroupService.GetGroup:output_type -> api.user.group.v1.GetGroupResponse + 8, // 23: api.user.group.v1.GroupService.ListGroups:output_type -> api.user.group.v1.ListGroupsResponse + 10, // 24: api.user.group.v1.GroupService.CreateGroup:output_type -> api.user.group.v1.CreateGroupResponse + 12, // 25: api.user.group.v1.GroupService.UpdateGroup:output_type -> api.user.group.v1.UpdateGroupResponse + 17, // 26: api.user.group.v1.GroupService.DeleteGroup:output_type -> api.errors.Error + 15, // 27: api.user.group.v1.GroupService.AddGroupMember:output_type -> api.user.group.v1.ChangeGroupMemberResponse + 15, // 28: api.user.group.v1.GroupService.RemoveGroupMember:output_type -> api.user.group.v1.ChangeGroupMemberResponse + 22, // [22:29] is the sub-list for method output_type + 15, // [15:22] is the sub-list for method input_type + 15, // [15:15] is the sub-list for extension type_name + 15, // [15:15] is the sub-list for extension extendee + 0, // [0:15] is the sub-list for field type_name } func init() { file_user_group_v1_group_proto_init() } @@ -1554,7 +1437,7 @@ func file_user_group_v1_group_proto_init() { } } file_user_group_v1_group_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddGroupMemberRequest); i { + switch v := v.(*ChangeGroupMemberRequest); i { case 0: return &v.state case 1: @@ -1566,31 +1449,7 @@ func file_user_group_v1_group_proto_init() { } } file_user_group_v1_group_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddGroupMemberResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_user_group_v1_group_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveGroupMemberRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_user_group_v1_group_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveGroupMemberResponse); i { + switch v := v.(*ChangeGroupMemberResponse); i { case 0: return &v.state case 1: @@ -1604,13 +1463,14 @@ func file_user_group_v1_group_proto_init() { } file_user_group_v1_group_proto_msgTypes[0].OneofWrappers = []interface{}{} file_user_group_v1_group_proto_msgTypes[1].OneofWrappers = []interface{}{} + file_user_group_v1_group_proto_msgTypes[8].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_group_v1_group_proto_rawDesc, NumEnums: 3, - NumMessages: 15, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, diff --git a/user/group/v1/group.pb.validate.go b/user/group/v1/group.pb.validate.go index 0f32dce..a17d46f 100644 --- a/user/group/v1/group.pb.validate.go +++ b/user/group/v1/group.pb.validate.go @@ -56,8 +56,6 @@ func (m *Group) validate(all bool) error { var errors []error - // no validation rules for Id - // no validation rules for Gid // no validation rules for Name @@ -240,8 +238,6 @@ func (m *GroupMember) validate(all bool) error { var errors []error - // no validation rules for Id - // no validation rules for Gid // no validation rules for Uid @@ -384,8 +380,12 @@ func (m *GetGroupRequest) validate(all bool) error { // no validation rules for Gid + // no validation rules for OwnerUid + // no validation rules for WithMembers + // no validation rules for WithInfo + if len(errors) > 0 { return GetGroupRequestMultiError(errors) } @@ -487,11 +487,11 @@ func (m *GetGroupResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, GetGroupResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -499,16 +499,16 @@ func (m *GetGroupResponse) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, GetGroupResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return GetGroupResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -753,11 +753,11 @@ func (m *ListGroupsResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListGroupsResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -765,16 +765,16 @@ func (m *ListGroupsResponse) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, ListGroupsResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ListGroupsResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -1028,11 +1028,11 @@ func (m *CreateGroupResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CreateGroupResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -1040,16 +1040,16 @@ func (m *CreateGroupResponse) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, CreateGroupResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CreateGroupResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -1189,13 +1189,19 @@ func (m *UpdateGroupRequest) validate(all bool) error { // no validation rules for Gid - // no validation rules for Name + // no validation rules for OwnerUid - // no validation rules for Description + if m.Name != nil { + // no validation rules for Name + } - // no validation rules for Avatar + if m.Description != nil { + // no validation rules for Description + } - // no validation rules for Uid + if m.Avatar != nil { + // no validation rules for Avatar + } if len(errors) > 0 { return UpdateGroupRequestMultiError(errors) @@ -1300,11 +1306,11 @@ func (m *UpdateGroupResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, UpdateGroupResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) @@ -1312,16 +1318,16 @@ func (m *UpdateGroupResponse) validate(all bool) error { case interface{ Validate() error }: if err := v.Validate(); err != nil { errors = append(errors, UpdateGroupResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpdateGroupResponseValidationError{ - field: "Response", + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -1461,7 +1467,7 @@ func (m *DeleteGroupRequest) validate(all bool) error { // no validation rules for Gid - // no validation rules for Uid + // no validation rules for OwnerUid if len(errors) > 0 { return DeleteGroupRequestMultiError(errors) @@ -1543,259 +1549,22 @@ var _ interface { ErrorName() string } = DeleteGroupRequestValidationError{} -// Validate checks the field values on AddGroupMemberRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *AddGroupMemberRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on AddGroupMemberRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// AddGroupMemberRequestMultiError, or nil if none found. -func (m *AddGroupMemberRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *AddGroupMemberRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Gid - - if len(errors) > 0 { - return AddGroupMemberRequestMultiError(errors) - } - - return nil -} - -// AddGroupMemberRequestMultiError is an error wrapping multiple validation -// errors returned by AddGroupMemberRequest.ValidateAll() if the designated -// constraints aren't met. -type AddGroupMemberRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddGroupMemberRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m AddGroupMemberRequestMultiError) AllErrors() []error { return m } - -// AddGroupMemberRequestValidationError is the validation error returned by -// AddGroupMemberRequest.Validate if the designated constraints aren't met. -type AddGroupMemberRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddGroupMemberRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddGroupMemberRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddGroupMemberRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddGroupMemberRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddGroupMemberRequestValidationError) ErrorName() string { - return "AddGroupMemberRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e AddGroupMemberRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sAddGroupMemberRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddGroupMemberRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddGroupMemberRequestValidationError{} - -// Validate checks the field values on AddGroupMemberResponse with the rules +// Validate checks the field values on ChangeGroupMemberRequest with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. -func (m *AddGroupMemberResponse) Validate() error { +func (m *ChangeGroupMemberRequest) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on AddGroupMemberResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// AddGroupMemberResponseMultiError, or nil if none found. -func (m *AddGroupMemberResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *AddGroupMemberResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if all { - switch v := interface{}(m.GetResponse()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, AddGroupMemberResponseValidationError{ - field: "Response", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, AddGroupMemberResponseValidationError{ - field: "Response", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return AddGroupMemberResponseValidationError{ - field: "Response", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for Added - - if len(errors) > 0 { - return AddGroupMemberResponseMultiError(errors) - } - - return nil -} - -// AddGroupMemberResponseMultiError is an error wrapping multiple validation -// errors returned by AddGroupMemberResponse.ValidateAll() if the designated -// constraints aren't met. -type AddGroupMemberResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m AddGroupMemberResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m AddGroupMemberResponseMultiError) AllErrors() []error { return m } - -// AddGroupMemberResponseValidationError is the validation error returned by -// AddGroupMemberResponse.Validate if the designated constraints aren't met. -type AddGroupMemberResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e AddGroupMemberResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e AddGroupMemberResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e AddGroupMemberResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e AddGroupMemberResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e AddGroupMemberResponseValidationError) ErrorName() string { - return "AddGroupMemberResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e AddGroupMemberResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sAddGroupMemberResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = AddGroupMemberResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = AddGroupMemberResponseValidationError{} - -// Validate checks the field values on RemoveGroupMemberRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *RemoveGroupMemberRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on RemoveGroupMemberRequest with the +// ValidateAll checks the field values on ChangeGroupMemberRequest with the // rules defined in the proto definition for this message. If any rules are // violated, the result is a list of violation errors wrapped in -// RemoveGroupMemberRequestMultiError, or nil if none found. -func (m *RemoveGroupMemberRequest) ValidateAll() error { +// ChangeGroupMemberRequestMultiError, or nil if none found. +func (m *ChangeGroupMemberRequest) ValidateAll() error { return m.validate(true) } -func (m *RemoveGroupMemberRequest) validate(all bool) error { +func (m *ChangeGroupMemberRequest) validate(all bool) error { if m == nil { return nil } @@ -1804,20 +1573,22 @@ func (m *RemoveGroupMemberRequest) validate(all bool) error { // no validation rules for Gid + // no validation rules for OwnerUid + if len(errors) > 0 { - return RemoveGroupMemberRequestMultiError(errors) + return ChangeGroupMemberRequestMultiError(errors) } return nil } -// RemoveGroupMemberRequestMultiError is an error wrapping multiple validation -// errors returned by RemoveGroupMemberRequest.ValidateAll() if the designated +// ChangeGroupMemberRequestMultiError is an error wrapping multiple validation +// errors returned by ChangeGroupMemberRequest.ValidateAll() if the designated // constraints aren't met. -type RemoveGroupMemberRequestMultiError []error +type ChangeGroupMemberRequestMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m RemoveGroupMemberRequestMultiError) Error() string { +func (m ChangeGroupMemberRequestMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -1826,11 +1597,11 @@ func (m RemoveGroupMemberRequestMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m RemoveGroupMemberRequestMultiError) AllErrors() []error { return m } +func (m ChangeGroupMemberRequestMultiError) AllErrors() []error { return m } -// RemoveGroupMemberRequestValidationError is the validation error returned by -// RemoveGroupMemberRequest.Validate if the designated constraints aren't met. -type RemoveGroupMemberRequestValidationError struct { +// ChangeGroupMemberRequestValidationError is the validation error returned by +// ChangeGroupMemberRequest.Validate if the designated constraints aren't met. +type ChangeGroupMemberRequestValidationError struct { field string reason string cause error @@ -1838,24 +1609,24 @@ type RemoveGroupMemberRequestValidationError struct { } // Field function returns field value. -func (e RemoveGroupMemberRequestValidationError) Field() string { return e.field } +func (e ChangeGroupMemberRequestValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e RemoveGroupMemberRequestValidationError) Reason() string { return e.reason } +func (e ChangeGroupMemberRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e RemoveGroupMemberRequestValidationError) Cause() error { return e.cause } +func (e ChangeGroupMemberRequestValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e RemoveGroupMemberRequestValidationError) Key() bool { return e.key } +func (e ChangeGroupMemberRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e RemoveGroupMemberRequestValidationError) ErrorName() string { - return "RemoveGroupMemberRequestValidationError" +func (e ChangeGroupMemberRequestValidationError) ErrorName() string { + return "ChangeGroupMemberRequestValidationError" } // Error satisfies the builtin error interface -func (e RemoveGroupMemberRequestValidationError) Error() string { +func (e ChangeGroupMemberRequestValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -1867,14 +1638,14 @@ func (e RemoveGroupMemberRequestValidationError) Error() string { } return fmt.Sprintf( - "invalid %sRemoveGroupMemberRequest.%s: %s%s", + "invalid %sChangeGroupMemberRequest.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = RemoveGroupMemberRequestValidationError{} +var _ error = ChangeGroupMemberRequestValidationError{} var _ interface { Field() string @@ -1882,24 +1653,24 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = RemoveGroupMemberRequestValidationError{} +} = ChangeGroupMemberRequestValidationError{} -// Validate checks the field values on RemoveGroupMemberResponse with the rules +// Validate checks the field values on ChangeGroupMemberResponse with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. -func (m *RemoveGroupMemberResponse) Validate() error { +func (m *ChangeGroupMemberResponse) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on RemoveGroupMemberResponse with the +// ValidateAll checks the field values on ChangeGroupMemberResponse with the // rules defined in the proto definition for this message. If any rules are // violated, the result is a list of violation errors wrapped in -// RemoveGroupMemberResponseMultiError, or nil if none found. -func (m *RemoveGroupMemberResponse) ValidateAll() error { +// ChangeGroupMemberResponseMultiError, or nil if none found. +func (m *ChangeGroupMemberResponse) ValidateAll() error { return m.validate(true) } -func (m *RemoveGroupMemberResponse) validate(all bool) error { +func (m *ChangeGroupMemberResponse) validate(all bool) error { if m == nil { return nil } @@ -1907,50 +1678,50 @@ func (m *RemoveGroupMemberResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, RemoveGroupMemberResponseValidationError{ - field: "Response", + errors = append(errors, ChangeGroupMemberResponseValidationError{ + field: "Error", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, RemoveGroupMemberResponseValidationError{ - field: "Response", + errors = append(errors, ChangeGroupMemberResponseValidationError{ + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return RemoveGroupMemberResponseValidationError{ - field: "Response", + return ChangeGroupMemberResponseValidationError{ + field: "Error", reason: "embedded message failed validation", cause: err, } } } - // no validation rules for Removed + // no validation rules for Count if len(errors) > 0 { - return RemoveGroupMemberResponseMultiError(errors) + return ChangeGroupMemberResponseMultiError(errors) } return nil } -// RemoveGroupMemberResponseMultiError is an error wrapping multiple validation -// errors returned by RemoveGroupMemberResponse.ValidateAll() if the +// ChangeGroupMemberResponseMultiError is an error wrapping multiple validation +// errors returned by ChangeGroupMemberResponse.ValidateAll() if the // designated constraints aren't met. -type RemoveGroupMemberResponseMultiError []error +type ChangeGroupMemberResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m RemoveGroupMemberResponseMultiError) Error() string { +func (m ChangeGroupMemberResponseMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -1959,11 +1730,11 @@ func (m RemoveGroupMemberResponseMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m RemoveGroupMemberResponseMultiError) AllErrors() []error { return m } +func (m ChangeGroupMemberResponseMultiError) AllErrors() []error { return m } -// RemoveGroupMemberResponseValidationError is the validation error returned by -// RemoveGroupMemberResponse.Validate if the designated constraints aren't met. -type RemoveGroupMemberResponseValidationError struct { +// ChangeGroupMemberResponseValidationError is the validation error returned by +// ChangeGroupMemberResponse.Validate if the designated constraints aren't met. +type ChangeGroupMemberResponseValidationError struct { field string reason string cause error @@ -1971,24 +1742,24 @@ type RemoveGroupMemberResponseValidationError struct { } // Field function returns field value. -func (e RemoveGroupMemberResponseValidationError) Field() string { return e.field } +func (e ChangeGroupMemberResponseValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e RemoveGroupMemberResponseValidationError) Reason() string { return e.reason } +func (e ChangeGroupMemberResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e RemoveGroupMemberResponseValidationError) Cause() error { return e.cause } +func (e ChangeGroupMemberResponseValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e RemoveGroupMemberResponseValidationError) Key() bool { return e.key } +func (e ChangeGroupMemberResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e RemoveGroupMemberResponseValidationError) ErrorName() string { - return "RemoveGroupMemberResponseValidationError" +func (e ChangeGroupMemberResponseValidationError) ErrorName() string { + return "ChangeGroupMemberResponseValidationError" } // Error satisfies the builtin error interface -func (e RemoveGroupMemberResponseValidationError) Error() string { +func (e ChangeGroupMemberResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -2000,14 +1771,14 @@ func (e RemoveGroupMemberResponseValidationError) Error() string { } return fmt.Sprintf( - "invalid %sRemoveGroupMemberResponse.%s: %s%s", + "invalid %sChangeGroupMemberResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = RemoveGroupMemberResponseValidationError{} +var _ error = ChangeGroupMemberResponseValidationError{} var _ interface { Field() string @@ -2015,4 +1786,4 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = RemoveGroupMemberResponseValidationError{} +} = ChangeGroupMemberResponseValidationError{} diff --git a/user/group/v1/group.proto b/user/group/v1/group.proto index 8f0083b..79bf5ad 100644 --- a/user/group/v1/group.proto +++ b/user/group/v1/group.proto @@ -2,18 +2,17 @@ syntax = "proto3"; package api.user.group.v1; -import "transport/response/response.proto"; +import "errors/errors.proto"; import "user/v1/user.proto"; option go_package = "github.com/go-goim/api/user/group/v1"; message Group { - int64 id = 1; - string gid = 2; + int64 gid = 2; string name = 3; string description = 4; string avatar = 5; - string owner_uid = 6; + int64 owner_uid = 6; optional GroupMember owner = 7; repeated GroupMember members = 8; int32 max_members = 9; @@ -28,9 +27,8 @@ enum GroupStatus { } message GroupMember { - int64 id = 1; // use as session id - string gid = 2; - string uid = 3; + int64 gid = 2; + int64 uid = 3; optional user.v1.User user = 4; enum Status { StatusActive = 0; @@ -49,12 +47,14 @@ message GroupMember { // GetGroup message GetGroupRequest { - string gid = 1; - bool with_members = 2; + int64 gid = 1; + int64 owner_uid = 2; + bool with_members = 3; + bool with_info = 4; } message GetGroupResponse { - transport.response.BaseResponse response = 1; + errors.Error error = 1; Group group = 2; } @@ -62,13 +62,13 @@ message GetGroupResponse { message ListGroupsRequest { // list all groups no matter user is member or owner. - string uid = 1; + int64 uid = 1; int32 page = 2; int32 page_size = 3; } message ListGroupsResponse { - transport.response.BaseResponse response = 1; + errors.Error error = 1; repeated Group groups = 2; } @@ -78,59 +78,47 @@ message CreateGroupRequest { string name = 1; string description = 2; string avatar = 3; - string owner_uid = 4; - repeated string members_uid = 5; // todo: limit to small number + int64 owner_uid = 4; + repeated int64 members_uid = 5; } message CreateGroupResponse { - transport.response.BaseResponse response = 1; + errors.Error error = 1; Group group = 2; } // UpdateGroup message UpdateGroupRequest { - string gid = 1; - string name = 2; - string description = 3; - string avatar = 4; - string uid = 5; // current user id + int64 gid = 1; + optional string name = 2; + optional string description = 3; + optional string avatar = 4; + int64 owner_uid = 5; // current user id } message UpdateGroupResponse { - transport.response.BaseResponse response = 1; + errors.Error error = 1; Group group = 2; } // DeleteGroup message DeleteGroupRequest { - string gid = 1; - string uid = 2; + int64 gid = 1; + int64 owner_uid = 2; } -// AddGroupMember - -message AddGroupMemberRequest { - string gid = 1; - repeated string uid = 2; -} - -message AddGroupMemberResponse { - transport.response.BaseResponse response = 1; - int32 added = 2; -} - -// RemoveGroupMember - -message RemoveGroupMemberRequest { - string gid = 1; - repeated string uid = 2; +// ChangeGroupMemberRequest add or remove group member +message ChangeGroupMemberRequest { + int64 gid = 1; + int64 owner_uid = 2; + repeated int64 uids = 3; } -message RemoveGroupMemberResponse { - transport.response.BaseResponse response = 1; - int32 removed = 2; +message ChangeGroupMemberResponse { + errors.Error error = 1; + int32 count = 2; // count of members changed } service GroupService { @@ -138,7 +126,7 @@ service GroupService { rpc ListGroups(ListGroupsRequest) returns (ListGroupsResponse); rpc CreateGroup(CreateGroupRequest) returns (CreateGroupResponse); rpc UpdateGroup(UpdateGroupRequest) returns (UpdateGroupResponse); - rpc DeleteGroup(DeleteGroupRequest) returns (transport.response.BaseResponse); - rpc AddGroupMember(AddGroupMemberRequest) returns (AddGroupMemberResponse); - rpc RemoveGroupMember(RemoveGroupMemberRequest) returns (RemoveGroupMemberResponse); + rpc DeleteGroup(DeleteGroupRequest) returns (errors.Error); + rpc AddGroupMember(ChangeGroupMemberRequest) returns (ChangeGroupMemberResponse); + rpc RemoveGroupMember(ChangeGroupMemberRequest) returns (ChangeGroupMemberResponse); } diff --git a/user/group/v1/group_grpc.pb.go b/user/group/v1/group_grpc.pb.go index 1ec16cd..27e95e9 100644 --- a/user/group/v1/group_grpc.pb.go +++ b/user/group/v1/group_grpc.pb.go @@ -1,10 +1,14 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: user/group/v1/group.proto package v1 import ( context "context" - response "github.com/go-goim/api/transport/response" + errors "github.com/go-goim/api/errors" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -15,6 +19,16 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + GroupService_GetGroup_FullMethodName = "/api.user.group.v1.GroupService/GetGroup" + GroupService_ListGroups_FullMethodName = "/api.user.group.v1.GroupService/ListGroups" + GroupService_CreateGroup_FullMethodName = "/api.user.group.v1.GroupService/CreateGroup" + GroupService_UpdateGroup_FullMethodName = "/api.user.group.v1.GroupService/UpdateGroup" + GroupService_DeleteGroup_FullMethodName = "/api.user.group.v1.GroupService/DeleteGroup" + GroupService_AddGroupMember_FullMethodName = "/api.user.group.v1.GroupService/AddGroupMember" + GroupService_RemoveGroupMember_FullMethodName = "/api.user.group.v1.GroupService/RemoveGroupMember" +) + // GroupServiceClient is the client API for GroupService 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. @@ -23,9 +37,9 @@ type GroupServiceClient interface { ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*CreateGroupResponse, error) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*UpdateGroupResponse, error) - DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*response.BaseResponse, error) - AddGroupMember(ctx context.Context, in *AddGroupMemberRequest, opts ...grpc.CallOption) (*AddGroupMemberResponse, error) - RemoveGroupMember(ctx context.Context, in *RemoveGroupMemberRequest, opts ...grpc.CallOption) (*RemoveGroupMemberResponse, error) + DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*errors.Error, error) + AddGroupMember(ctx context.Context, in *ChangeGroupMemberRequest, opts ...grpc.CallOption) (*ChangeGroupMemberResponse, error) + RemoveGroupMember(ctx context.Context, in *ChangeGroupMemberRequest, opts ...grpc.CallOption) (*ChangeGroupMemberResponse, error) } type groupServiceClient struct { @@ -38,7 +52,7 @@ func NewGroupServiceClient(cc grpc.ClientConnInterface) GroupServiceClient { func (c *groupServiceClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*GetGroupResponse, error) { out := new(GetGroupResponse) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/GetGroup", in, out, opts...) + err := c.cc.Invoke(ctx, GroupService_GetGroup_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -47,7 +61,7 @@ func (c *groupServiceClient) GetGroup(ctx context.Context, in *GetGroupRequest, func (c *groupServiceClient) ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) { out := new(ListGroupsResponse) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/ListGroups", in, out, opts...) + err := c.cc.Invoke(ctx, GroupService_ListGroups_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -56,7 +70,7 @@ func (c *groupServiceClient) ListGroups(ctx context.Context, in *ListGroupsReque func (c *groupServiceClient) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*CreateGroupResponse, error) { out := new(CreateGroupResponse) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/CreateGroup", in, out, opts...) + err := c.cc.Invoke(ctx, GroupService_CreateGroup_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -65,34 +79,34 @@ func (c *groupServiceClient) CreateGroup(ctx context.Context, in *CreateGroupReq func (c *groupServiceClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*UpdateGroupResponse, error) { out := new(UpdateGroupResponse) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/UpdateGroup", in, out, opts...) + err := c.cc.Invoke(ctx, GroupService_UpdateGroup_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupServiceClient) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*response.BaseResponse, error) { - out := new(response.BaseResponse) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/DeleteGroup", in, out, opts...) +func (c *groupServiceClient) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...grpc.CallOption) (*errors.Error, error) { + out := new(errors.Error) + err := c.cc.Invoke(ctx, GroupService_DeleteGroup_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupServiceClient) AddGroupMember(ctx context.Context, in *AddGroupMemberRequest, opts ...grpc.CallOption) (*AddGroupMemberResponse, error) { - out := new(AddGroupMemberResponse) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/AddGroupMember", in, out, opts...) +func (c *groupServiceClient) AddGroupMember(ctx context.Context, in *ChangeGroupMemberRequest, opts ...grpc.CallOption) (*ChangeGroupMemberResponse, error) { + out := new(ChangeGroupMemberResponse) + err := c.cc.Invoke(ctx, GroupService_AddGroupMember_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupServiceClient) RemoveGroupMember(ctx context.Context, in *RemoveGroupMemberRequest, opts ...grpc.CallOption) (*RemoveGroupMemberResponse, error) { - out := new(RemoveGroupMemberResponse) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/RemoveGroupMember", in, out, opts...) +func (c *groupServiceClient) RemoveGroupMember(ctx context.Context, in *ChangeGroupMemberRequest, opts ...grpc.CallOption) (*ChangeGroupMemberResponse, error) { + out := new(ChangeGroupMemberResponse) + err := c.cc.Invoke(ctx, GroupService_RemoveGroupMember_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -107,9 +121,9 @@ type GroupServiceServer interface { ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) CreateGroup(context.Context, *CreateGroupRequest) (*CreateGroupResponse, error) UpdateGroup(context.Context, *UpdateGroupRequest) (*UpdateGroupResponse, error) - DeleteGroup(context.Context, *DeleteGroupRequest) (*response.BaseResponse, error) - AddGroupMember(context.Context, *AddGroupMemberRequest) (*AddGroupMemberResponse, error) - RemoveGroupMember(context.Context, *RemoveGroupMemberRequest) (*RemoveGroupMemberResponse, error) + DeleteGroup(context.Context, *DeleteGroupRequest) (*errors.Error, error) + AddGroupMember(context.Context, *ChangeGroupMemberRequest) (*ChangeGroupMemberResponse, error) + RemoveGroupMember(context.Context, *ChangeGroupMemberRequest) (*ChangeGroupMemberResponse, error) mustEmbedUnimplementedGroupServiceServer() } @@ -129,13 +143,13 @@ func (UnimplementedGroupServiceServer) CreateGroup(context.Context, *CreateGroup func (UnimplementedGroupServiceServer) UpdateGroup(context.Context, *UpdateGroupRequest) (*UpdateGroupResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateGroup not implemented") } -func (UnimplementedGroupServiceServer) DeleteGroup(context.Context, *DeleteGroupRequest) (*response.BaseResponse, error) { +func (UnimplementedGroupServiceServer) DeleteGroup(context.Context, *DeleteGroupRequest) (*errors.Error, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteGroup not implemented") } -func (UnimplementedGroupServiceServer) AddGroupMember(context.Context, *AddGroupMemberRequest) (*AddGroupMemberResponse, error) { +func (UnimplementedGroupServiceServer) AddGroupMember(context.Context, *ChangeGroupMemberRequest) (*ChangeGroupMemberResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddGroupMember not implemented") } -func (UnimplementedGroupServiceServer) RemoveGroupMember(context.Context, *RemoveGroupMemberRequest) (*RemoveGroupMemberResponse, error) { +func (UnimplementedGroupServiceServer) RemoveGroupMember(context.Context, *ChangeGroupMemberRequest) (*ChangeGroupMemberResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveGroupMember not implemented") } func (UnimplementedGroupServiceServer) mustEmbedUnimplementedGroupServiceServer() {} @@ -161,7 +175,7 @@ func _GroupService_GetGroup_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/GetGroup", + FullMethod: GroupService_GetGroup_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GroupServiceServer).GetGroup(ctx, req.(*GetGroupRequest)) @@ -179,7 +193,7 @@ func _GroupService_ListGroups_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/ListGroups", + FullMethod: GroupService_ListGroups_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GroupServiceServer).ListGroups(ctx, req.(*ListGroupsRequest)) @@ -197,7 +211,7 @@ func _GroupService_CreateGroup_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/CreateGroup", + FullMethod: GroupService_CreateGroup_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GroupServiceServer).CreateGroup(ctx, req.(*CreateGroupRequest)) @@ -215,7 +229,7 @@ func _GroupService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/UpdateGroup", + FullMethod: GroupService_UpdateGroup_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GroupServiceServer).UpdateGroup(ctx, req.(*UpdateGroupRequest)) @@ -233,7 +247,7 @@ func _GroupService_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/DeleteGroup", + FullMethod: GroupService_DeleteGroup_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GroupServiceServer).DeleteGroup(ctx, req.(*DeleteGroupRequest)) @@ -242,7 +256,7 @@ func _GroupService_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec } func _GroupService_AddGroupMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddGroupMemberRequest) + in := new(ChangeGroupMemberRequest) if err := dec(in); err != nil { return nil, err } @@ -251,16 +265,16 @@ func _GroupService_AddGroupMember_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/AddGroupMember", + FullMethod: GroupService_AddGroupMember_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).AddGroupMember(ctx, req.(*AddGroupMemberRequest)) + return srv.(GroupServiceServer).AddGroupMember(ctx, req.(*ChangeGroupMemberRequest)) } return interceptor(ctx, in, info, handler) } func _GroupService_RemoveGroupMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RemoveGroupMemberRequest) + in := new(ChangeGroupMemberRequest) if err := dec(in); err != nil { return nil, err } @@ -269,10 +283,10 @@ func _GroupService_RemoveGroupMember_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/RemoveGroupMember", + FullMethod: GroupService_RemoveGroupMember_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).RemoveGroupMember(ctx, req.(*RemoveGroupMemberRequest)) + return srv.(GroupServiceServer).RemoveGroupMember(ctx, req.(*ChangeGroupMemberRequest)) } return interceptor(ctx, in, info, handler) } diff --git a/user/session/v1/session.pb.go b/user/session/v1/session.pb.go deleted file mode 100644 index ef1564a..0000000 --- a/user/session/v1/session.pb.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.26.0 -// protoc (unknown) -// source: user/session/v1/session.proto - -package v1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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) -) - -// define session type and status -type SessionType int32 - -const ( - SessionType_SingleChat SessionType = 0 - SessionType_GroupChat SessionType = 1 - // broadcast actually not a standard chat type, but we still use it here - SessionType_Broadcast SessionType = 2 -) - -// Enum value maps for SessionType. -var ( - SessionType_name = map[int32]string{ - 0: "SingleChat", - 1: "GroupChat", - 2: "Broadcast", - } - SessionType_value = map[string]int32{ - "SingleChat": 0, - "GroupChat": 1, - "Broadcast": 2, - } -) - -func (x SessionType) Enum() *SessionType { - p := new(SessionType) - *p = x - return p -} - -func (x SessionType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (SessionType) Descriptor() protoreflect.EnumDescriptor { - return file_user_session_v1_session_proto_enumTypes[0].Descriptor() -} - -func (SessionType) Type() protoreflect.EnumType { - return &file_user_session_v1_session_proto_enumTypes[0] -} - -func (x SessionType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use SessionType.Descriptor instead. -func (SessionType) EnumDescriptor() ([]byte, []int) { - return file_user_session_v1_session_proto_rawDescGZIP(), []int{0} -} - -var File_user_session_v1_session_proto protoreflect.FileDescriptor - -var file_user_session_v1_session_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x76, - 0x31, 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x13, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x2e, 0x76, 0x31, 0x2a, 0x3b, 0x0a, 0x0b, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x43, 0x68, 0x61, - 0x74, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x43, 0x68, 0x61, 0x74, - 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x10, - 0x02, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, - 0x2f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_user_session_v1_session_proto_rawDescOnce sync.Once - file_user_session_v1_session_proto_rawDescData = file_user_session_v1_session_proto_rawDesc -) - -func file_user_session_v1_session_proto_rawDescGZIP() []byte { - file_user_session_v1_session_proto_rawDescOnce.Do(func() { - file_user_session_v1_session_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_session_v1_session_proto_rawDescData) - }) - return file_user_session_v1_session_proto_rawDescData -} - -var file_user_session_v1_session_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_user_session_v1_session_proto_goTypes = []interface{}{ - (SessionType)(0), // 0: api.user.session.v1.SessionType -} -var file_user_session_v1_session_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] 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() { file_user_session_v1_session_proto_init() } -func file_user_session_v1_session_proto_init() { - if File_user_session_v1_session_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_user_session_v1_session_proto_rawDesc, - NumEnums: 1, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_user_session_v1_session_proto_goTypes, - DependencyIndexes: file_user_session_v1_session_proto_depIdxs, - EnumInfos: file_user_session_v1_session_proto_enumTypes, - }.Build() - File_user_session_v1_session_proto = out.File - file_user_session_v1_session_proto_rawDesc = nil - file_user_session_v1_session_proto_goTypes = nil - file_user_session_v1_session_proto_depIdxs = nil -} diff --git a/user/session/v1/session.pb.validate.go b/user/session/v1/session.pb.validate.go deleted file mode 100644 index 48b4d90..0000000 --- a/user/session/v1/session.pb.validate.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: user/session/v1/session.proto - -package v1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort -) diff --git a/user/session/v1/session.proto b/user/session/v1/session.proto deleted file mode 100644 index 7edf6a0..0000000 --- a/user/session/v1/session.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; - -package api.user.session.v1; - -option go_package = "github.com/go-goim/api/user/session/v1"; - -// define session type and status -enum SessionType { - SingleChat = 0; - GroupChat = 1; - // broadcast actually not a standard chat type, but we still use it here - Broadcast = 2; -} -// more session message type - diff --git a/user/v1/user.ext.go b/user/v1/user.ext.go deleted file mode 100644 index effff19..0000000 --- a/user/v1/user.ext.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code Written Manually - -package v1 - -func (x *UserInternal) ToUser() *User { - return &User{ - Uid: x.GetUid(), - Name: x.GetName(), - Email: x.Email, - Phone: x.Phone, - Avatar: x.GetAvatar(), - ConnectUrl: x.PushServerIp, - LoginStatus: x.GetLoginStatus(), - } -} diff --git a/user/v1/user.pb.go b/user/v1/user.pb.go index 8f6d03b..cf56068 100644 --- a/user/v1/user.pb.go +++ b/user/v1/user.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.26.0 +// protoc-gen-go v1.34.1 // protoc (unknown) // source: user/v1/user.proto @@ -8,7 +8,7 @@ package v1 import ( _ "github.com/envoyproxy/protoc-gen-validate/validate" - response "github.com/go-goim/api/transport/response" + errors "github.com/go-goim/api/errors" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -117,17 +117,17 @@ func (LoginType) EnumDescriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{1} } -type UserInternalResponse struct { +type UserResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - User *UserInternal `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` + Error *errors.Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` + User *User `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` } -func (x *UserInternalResponse) Reset() { - *x = UserInternalResponse{} +func (x *UserResponse) Reset() { + *x = UserResponse{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -135,13 +135,13 @@ func (x *UserInternalResponse) Reset() { } } -func (x *UserInternalResponse) String() string { +func (x *UserResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserInternalResponse) ProtoMessage() {} +func (*UserResponse) ProtoMessage() {} -func (x *UserInternalResponse) ProtoReflect() protoreflect.Message { +func (x *UserResponse) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -153,32 +153,31 @@ func (x *UserInternalResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserInternalResponse.ProtoReflect.Descriptor instead. -func (*UserInternalResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use UserResponse.ProtoReflect.Descriptor instead. +func (*UserResponse) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{0} } -func (x *UserInternalResponse) GetResponse() *response.BaseResponse { +func (x *UserResponse) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } -func (x *UserInternalResponse) GetUser() *UserInternal { +func (x *UserResponse) GetUser() *User { if x != nil { return x.User } return nil } -// UserInternal is the internal representation of a user. -type UserInternal struct { +type User struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"` Phone *string `protobuf:"bytes,4,opt,name=phone,proto3,oneof" json:"phone,omitempty"` @@ -193,8 +192,8 @@ type UserInternal struct { UpdatedAt int64 `protobuf:"varint,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` } -func (x *UserInternal) Reset() { - *x = UserInternal{} +func (x *User) Reset() { + *x = User{} if protoimpl.UnsafeEnabled { mi := &file_user_v1_user_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -202,13 +201,13 @@ func (x *UserInternal) Reset() { } } -func (x *UserInternal) String() string { +func (x *User) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserInternal) ProtoMessage() {} +func (*User) ProtoMessage() {} -func (x *UserInternal) ProtoReflect() protoreflect.Message { +func (x *User) ProtoReflect() protoreflect.Message { mi := &file_user_v1_user_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -220,180 +219,81 @@ func (x *UserInternal) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserInternal.ProtoReflect.Descriptor instead. -func (*UserInternal) Descriptor() ([]byte, []int) { +// Deprecated: Use User.ProtoReflect.Descriptor instead. +func (*User) Descriptor() ([]byte, []int) { return file_user_v1_user_proto_rawDescGZIP(), []int{1} } -func (x *UserInternal) GetUid() string { +func (x *User) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } -func (x *UserInternal) GetName() string { +func (x *User) GetName() string { if x != nil { return x.Name } return "" } -func (x *UserInternal) GetEmail() string { +func (x *User) GetEmail() string { if x != nil && x.Email != nil { return *x.Email } return "" } -func (x *UserInternal) GetPhone() string { +func (x *User) GetPhone() string { if x != nil && x.Phone != nil { return *x.Phone } return "" } -func (x *UserInternal) GetAvatar() string { +func (x *User) GetAvatar() string { if x != nil { return x.Avatar } return "" } -func (x *UserInternal) GetPushServerIp() string { +func (x *User) GetPushServerIp() string { if x != nil && x.PushServerIp != nil { return *x.PushServerIp } return "" } -func (x *UserInternal) GetPassword() string { +func (x *User) GetPassword() string { if x != nil { return x.Password } return "" } -func (x *UserInternal) GetLoginStatus() LoginStatus { +func (x *User) GetLoginStatus() LoginStatus { if x != nil { return x.LoginStatus } return LoginStatus_LOGIN } -func (x *UserInternal) GetCreatedAt() int64 { +func (x *User) GetCreatedAt() int64 { if x != nil { return x.CreatedAt } return 0 } -func (x *UserInternal) GetUpdatedAt() int64 { +func (x *User) GetUpdatedAt() int64 { if x != nil { return x.UpdatedAt } return 0 } -// User use for return user info to client. -type User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"` - Phone *string `protobuf:"bytes,4,opt,name=phone,proto3,oneof" json:"phone,omitempty"` - Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` - // ws_url is url of user need connect via ws or tcp - ConnectUrl *string `protobuf:"bytes,6,opt,name=connect_url,json=connectUrl,proto3,oneof" json:"connect_url,omitempty"` - // 0: first time login, need connect to push server - // 1: already login, no need connect to push server - LoginStatus LoginStatus `protobuf:"varint,8,opt,name=login_status,json=loginStatus,proto3,enum=api.user.v1.LoginStatus" json:"login_status,omitempty"` -} - -func (x *User) Reset() { - *x = User{} - if protoimpl.UnsafeEnabled { - mi := &file_user_v1_user_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*User) ProtoMessage() {} - -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_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) -} - -// Deprecated: Use User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{2} -} - -func (x *User) GetUid() string { - if x != nil { - return x.Uid - } - return "" -} - -func (x *User) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *User) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email - } - return "" -} - -func (x *User) GetPhone() string { - if x != nil && x.Phone != nil { - return *x.Phone - } - return "" -} - -func (x *User) GetAvatar() string { - if x != nil { - return x.Avatar - } - return "" -} - -func (x *User) GetConnectUrl() string { - if x != nil && x.ConnectUrl != nil { - return *x.ConnectUrl - } - return "" -} - -func (x *User) GetLoginStatus() LoginStatus { - if x != nil { - return x.LoginStatus - } - return LoginStatus_LOGIN -} - type UserList struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -405,7 +305,7 @@ type UserList struct { func (x *UserList) Reset() { *x = UserList{} if protoimpl.UnsafeEnabled { - mi := &file_user_v1_user_proto_msgTypes[3] + mi := &file_user_v1_user_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -418,7 +318,7 @@ func (x *UserList) String() string { func (*UserList) ProtoMessage() {} func (x *UserList) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[3] + mi := &file_user_v1_user_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -431,7 +331,7 @@ func (x *UserList) ProtoReflect() protoreflect.Message { // Deprecated: Use UserList.ProtoReflect.Descriptor instead. func (*UserList) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{3} + return file_user_v1_user_proto_rawDescGZIP(), []int{2} } func (x *UserList) GetUsers() []*User { @@ -446,13 +346,13 @@ type GetUserInfoRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` } func (x *GetUserInfoRequest) Reset() { *x = GetUserInfoRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_v1_user_proto_msgTypes[4] + mi := &file_user_v1_user_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -465,7 +365,7 @@ func (x *GetUserInfoRequest) String() string { func (*GetUserInfoRequest) ProtoMessage() {} func (x *GetUserInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[4] + mi := &file_user_v1_user_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -478,14 +378,14 @@ func (x *GetUserInfoRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserInfoRequest.ProtoReflect.Descriptor instead. func (*GetUserInfoRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{4} + return file_user_v1_user_proto_rawDescGZIP(), []int{3} } -func (x *GetUserInfoRequest) GetUid() string { +func (x *GetUserInfoRequest) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } type QueryUserRequest struct { @@ -493,16 +393,17 @@ type QueryUserRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Types that are assignable to User: + // Types that are assignable to Field: + // // *QueryUserRequest_Email // *QueryUserRequest_Phone - User isQueryUserRequest_User `protobuf_oneof:"user"` + Field isQueryUserRequest_Field `protobuf_oneof:"field"` } func (x *QueryUserRequest) Reset() { *x = QueryUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_v1_user_proto_msgTypes[5] + mi := &file_user_v1_user_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -515,7 +416,7 @@ func (x *QueryUserRequest) String() string { func (*QueryUserRequest) ProtoMessage() {} func (x *QueryUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[5] + mi := &file_user_v1_user_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -528,32 +429,32 @@ func (x *QueryUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use QueryUserRequest.ProtoReflect.Descriptor instead. func (*QueryUserRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{5} + return file_user_v1_user_proto_rawDescGZIP(), []int{4} } -func (m *QueryUserRequest) GetUser() isQueryUserRequest_User { +func (m *QueryUserRequest) GetField() isQueryUserRequest_Field { if m != nil { - return m.User + return m.Field } return nil } func (x *QueryUserRequest) GetEmail() string { - if x, ok := x.GetUser().(*QueryUserRequest_Email); ok { + if x, ok := x.GetField().(*QueryUserRequest_Email); ok { return x.Email } return "" } func (x *QueryUserRequest) GetPhone() string { - if x, ok := x.GetUser().(*QueryUserRequest_Phone); ok { + if x, ok := x.GetField().(*QueryUserRequest_Phone); ok { return x.Phone } return "" } -type isQueryUserRequest_User interface { - isQueryUserRequest_User() +type isQueryUserRequest_Field interface { + isQueryUserRequest_Field() } type QueryUserRequest_Email struct { @@ -564,9 +465,9 @@ type QueryUserRequest_Phone struct { Phone string `protobuf:"bytes,2,opt,name=phone,proto3,oneof"` } -func (*QueryUserRequest_Email) isQueryUserRequest_User() {} +func (*QueryUserRequest_Email) isQueryUserRequest_Field() {} -func (*QueryUserRequest_Phone) isQueryUserRequest_User() {} +func (*QueryUserRequest_Phone) isQueryUserRequest_Field() {} type CreateUserRequest struct { state protoimpl.MessageState @@ -574,17 +475,18 @@ type CreateUserRequest struct { unknownFields protoimpl.UnknownFields Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Types that are assignable to User: + // Types that are assignable to Field: + // // *CreateUserRequest_Email // *CreateUserRequest_Phone - User isCreateUserRequest_User `protobuf_oneof:"user"` - Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` + Field isCreateUserRequest_Field `protobuf_oneof:"field"` + Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` } func (x *CreateUserRequest) Reset() { *x = CreateUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_v1_user_proto_msgTypes[6] + mi := &file_user_v1_user_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -597,7 +499,7 @@ func (x *CreateUserRequest) String() string { func (*CreateUserRequest) ProtoMessage() {} func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[6] + mi := &file_user_v1_user_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -610,7 +512,7 @@ func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. func (*CreateUserRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{6} + return file_user_v1_user_proto_rawDescGZIP(), []int{5} } func (x *CreateUserRequest) GetName() string { @@ -620,22 +522,22 @@ func (x *CreateUserRequest) GetName() string { return "" } -func (m *CreateUserRequest) GetUser() isCreateUserRequest_User { +func (m *CreateUserRequest) GetField() isCreateUserRequest_Field { if m != nil { - return m.User + return m.Field } return nil } func (x *CreateUserRequest) GetEmail() string { - if x, ok := x.GetUser().(*CreateUserRequest_Email); ok { + if x, ok := x.GetField().(*CreateUserRequest_Email); ok { return x.Email } return "" } func (x *CreateUserRequest) GetPhone() string { - if x, ok := x.GetUser().(*CreateUserRequest_Phone); ok { + if x, ok := x.GetField().(*CreateUserRequest_Phone); ok { return x.Phone } return "" @@ -648,8 +550,8 @@ func (x *CreateUserRequest) GetPassword() string { return "" } -type isCreateUserRequest_User interface { - isCreateUserRequest_User() +type isCreateUserRequest_Field interface { + isCreateUserRequest_Field() } type CreateUserRequest_Email struct { @@ -660,26 +562,27 @@ type CreateUserRequest_Phone struct { Phone string `protobuf:"bytes,3,opt,name=phone,proto3,oneof"` } -func (*CreateUserRequest_Email) isCreateUserRequest_User() {} +func (*CreateUserRequest_Email) isCreateUserRequest_Field() {} -func (*CreateUserRequest_Phone) isCreateUserRequest_User() {} +func (*CreateUserRequest_Phone) isCreateUserRequest_Field() {} type UpdateUserRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` - Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` - Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` + Uid int64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` + Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` + Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` + Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` } func (x *UpdateUserRequest) Reset() { *x = UpdateUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_v1_user_proto_msgTypes[7] + mi := &file_user_v1_user_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -692,7 +595,7 @@ func (x *UpdateUserRequest) String() string { func (*UpdateUserRequest) ProtoMessage() {} func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[7] + mi := &file_user_v1_user_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -705,14 +608,14 @@ func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead. func (*UpdateUserRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{7} + return file_user_v1_user_proto_rawDescGZIP(), []int{6} } -func (x *UpdateUserRequest) GetUid() string { +func (x *UpdateUserRequest) GetUid() int64 { if x != nil { return x.Uid } - return "" + return 0 } func (x *UpdateUserRequest) GetName() string { @@ -743,16 +646,24 @@ func (x *UpdateUserRequest) GetAvatar() string { return "" } +func (x *UpdateUserRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + type UserLoginRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Types that are assignable to User: + // Types that are assignable to Field: + // // *UserLoginRequest_Email // *UserLoginRequest_Phone - User isUserLoginRequest_User `protobuf_oneof:"user"` - Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + Field isUserLoginRequest_Field `protobuf_oneof:"field"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` // 0: try login , do nothing if already login // 1: force login , logout if already login LoginType LoginType `protobuf:"varint,4,opt,name=login_type,json=loginType,proto3,enum=api.user.v1.LoginType" json:"login_type,omitempty"` @@ -761,7 +672,7 @@ type UserLoginRequest struct { func (x *UserLoginRequest) Reset() { *x = UserLoginRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_v1_user_proto_msgTypes[8] + mi := &file_user_v1_user_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -774,7 +685,7 @@ func (x *UserLoginRequest) String() string { func (*UserLoginRequest) ProtoMessage() {} func (x *UserLoginRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[8] + mi := &file_user_v1_user_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -787,25 +698,25 @@ func (x *UserLoginRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UserLoginRequest.ProtoReflect.Descriptor instead. func (*UserLoginRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{8} + return file_user_v1_user_proto_rawDescGZIP(), []int{7} } -func (m *UserLoginRequest) GetUser() isUserLoginRequest_User { +func (m *UserLoginRequest) GetField() isUserLoginRequest_Field { if m != nil { - return m.User + return m.Field } return nil } func (x *UserLoginRequest) GetEmail() string { - if x, ok := x.GetUser().(*UserLoginRequest_Email); ok { + if x, ok := x.GetField().(*UserLoginRequest_Email); ok { return x.Email } return "" } func (x *UserLoginRequest) GetPhone() string { - if x, ok := x.GetUser().(*UserLoginRequest_Phone); ok { + if x, ok := x.GetField().(*UserLoginRequest_Phone); ok { return x.Phone } return "" @@ -825,8 +736,8 @@ func (x *UserLoginRequest) GetLoginType() LoginType { return LoginType_LOGIN_TYPE_TRY } -type isUserLoginRequest_User interface { - isUserLoginRequest_User() +type isUserLoginRequest_Field interface { + isUserLoginRequest_Field() } type UserLoginRequest_Email struct { @@ -837,30 +748,26 @@ type UserLoginRequest_Phone struct { Phone string `protobuf:"bytes,2,opt,name=phone,proto3,oneof"` } -func (*UserLoginRequest_Email) isUserLoginRequest_User() {} +func (*UserLoginRequest_Email) isUserLoginRequest_Field() {} -func (*UserLoginRequest_Phone) isUserLoginRequest_User() {} +func (*UserLoginRequest_Phone) isUserLoginRequest_Field() {} var File_user_v1_user_proto protoreflect.FileDescriptor var file_user_v1_user_proto_rawDesc = []byte{ 0x0a, 0x12, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, - 0x31, 0x1a, 0x21, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2f, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x01, - 0x0a, 0x14, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xeb, 0x02, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x31, 0x1a, 0x13, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, + 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x5e, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x27, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2e, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, + 0xe3, 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x70, 0x68, 0x6f, @@ -881,104 +788,88 @@ var file_user_v1_user_proto_rawDesc = []byte{ 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x70, 0x75, 0x73, 0x68, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x69, 0x70, 0x22, 0x81, 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x10, - 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x12, - 0x19, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, - 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x88, 0x01, 0x01, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, - 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, - 0x61, 0x72, 0x12, 0x24, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x72, - 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x6e, 0x65, - 0x63, 0x74, 0x55, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x0c, 0x6c, 0x6f, 0x67, 0x69, - 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x0b, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, - 0x08, 0x0a, 0x06, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x63, 0x6f, - 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x22, 0x33, 0x0a, 0x08, 0x55, 0x73, 0x65, - 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x31, - 0x0a, 0x12, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x14, 0x18, 0x18, 0x52, 0x03, 0x75, 0x69, - 0x64, 0x22, 0x6e, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x60, 0x01, 0x48, 0x00, 0x52, - 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2c, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x14, 0xfa, 0x42, 0x11, 0x72, 0x0f, 0x32, 0x0d, 0x5e, 0x31, - 0x5b, 0x33, 0x2d, 0x39, 0x5d, 0x5c, 0x64, 0x7b, 0x39, 0x7d, 0x24, 0x48, 0x00, 0x52, 0x05, 0x70, - 0x68, 0x6f, 0x6e, 0x65, 0x42, 0x0b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x03, 0xf8, 0x42, - 0x01, 0x22, 0xb5, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x02, 0x18, 0x14, - 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x60, 0x01, 0x48, 0x00, - 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2c, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x14, 0xfa, 0x42, 0x11, 0x72, 0x0f, 0x32, 0x0d, 0x5e, - 0x31, 0x5b, 0x33, 0x2d, 0x39, 0x5d, 0x5c, 0x64, 0x7b, 0x39, 0x7d, 0x24, 0x48, 0x00, 0x52, 0x05, - 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x25, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x06, - 0x18, 0x14, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x0b, 0x0a, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xc8, 0x01, 0x0a, 0x11, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1b, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, - 0x06, 0x72, 0x04, 0x10, 0x14, 0x18, 0x18, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x72, - 0x07, 0x10, 0x02, 0x18, 0x14, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, - 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, - 0x42, 0x07, 0x72, 0x05, 0x60, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x12, 0x2d, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x17, 0xfa, 0x42, 0x14, 0x72, 0x12, 0x32, 0x0d, 0x5e, 0x31, 0x5b, 0x33, 0x2d, 0x39, 0x5d, 0x5c, - 0x64, 0x7b, 0x39, 0x7d, 0x24, 0xd0, 0x01, 0x01, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, - 0x23, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x0b, 0xfa, 0x42, 0x08, 0x72, 0x06, 0x18, 0x80, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x06, 0x61, 0x76, - 0x61, 0x74, 0x61, 0x72, 0x22, 0xc1, 0x01, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x60, - 0x01, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2c, 0x0a, 0x05, 0x70, 0x68, - 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x14, 0xfa, 0x42, 0x11, 0x72, 0x0f, - 0x32, 0x0d, 0x5e, 0x31, 0x5b, 0x33, 0x2d, 0x39, 0x5d, 0x5c, 0x64, 0x7b, 0x39, 0x7d, 0x24, 0x48, - 0x00, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x12, 0x35, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x0b, 0x0a, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x2a, 0x37, 0x0a, 0x0b, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09, 0x0a, 0x05, 0x4c, 0x4f, 0x47, 0x49, 0x4e, - 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x4c, 0x52, 0x45, 0x41, 0x44, 0x59, 0x5f, 0x4c, 0x4f, - 0x47, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, 0x47, 0x4f, 0x55, 0x54, 0x10, - 0x02, 0x2a, 0x35, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, - 0x0a, 0x0e, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x59, - 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x10, 0x01, 0x32, 0xcd, 0x02, 0x0a, 0x0b, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x09, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x20, 0x5a, 0x1e, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, 0x6f, 0x69, 0x6d, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x65, 0x72, 0x5f, 0x69, 0x70, 0x22, 0x33, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x27, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x2f, 0x0a, 0x12, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x19, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, + 0x42, 0x04, 0x22, 0x02, 0x20, 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x22, 0x6f, 0x0a, 0x10, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1f, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x60, 0x01, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x12, 0x2c, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x14, 0xfa, 0x42, 0x11, 0x72, 0x0f, 0x32, 0x0d, 0x5e, 0x31, 0x5b, 0x33, 0x2d, 0x39, 0x5d, 0x5c, + 0x64, 0x7b, 0x39, 0x7d, 0x24, 0x48, 0x00, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x42, 0x0c, + 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xb6, 0x01, 0x0a, + 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x02, 0x18, 0x14, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x1f, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x60, 0x01, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x12, 0x2c, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x14, 0xfa, 0x42, 0x11, 0x72, 0x0f, 0x32, 0x0d, 0x5e, 0x31, 0x5b, 0x33, 0x2d, 0x39, + 0x5d, 0x5c, 0x64, 0x7b, 0x39, 0x7d, 0x24, 0x48, 0x00, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, + 0x12, 0x25, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x06, 0x18, 0x14, 0x52, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x0c, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, + 0x12, 0x03, 0xf8, 0x42, 0x01, 0x22, 0xf0, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x03, 0x75, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x22, 0x02, 0x20, + 0x00, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x20, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x72, 0x07, 0x10, 0x02, 0x18, 0x14, 0xd0, + 0x01, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0xd0, 0x01, + 0x01, 0x60, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2d, 0x0a, 0x05, 0x70, 0x68, + 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, 0xfa, 0x42, 0x14, 0x72, 0x12, + 0x32, 0x0d, 0x5e, 0x31, 0x5b, 0x33, 0x2d, 0x39, 0x5d, 0x5c, 0x64, 0x7b, 0x39, 0x7d, 0x24, 0xd0, + 0x01, 0x01, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x61, 0x76, 0x61, + 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0b, 0xfa, 0x42, 0x08, 0x72, 0x06, + 0x18, 0x80, 0x01, 0xd0, 0x01, 0x01, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x28, + 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x0c, 0xfa, 0x42, 0x09, 0x72, 0x07, 0x10, 0x06, 0x18, 0x14, 0xd0, 0x01, 0x01, 0x52, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0xc2, 0x01, 0x0a, 0x10, 0x55, 0x73, 0x65, + 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, + 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, + 0x04, 0x72, 0x02, 0x60, 0x01, 0x48, 0x00, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2c, + 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x14, 0xfa, + 0x42, 0x11, 0x72, 0x0f, 0x32, 0x0d, 0x5e, 0x31, 0x5b, 0x33, 0x2d, 0x39, 0x5d, 0x5c, 0x64, 0x7b, + 0x39, 0x7d, 0x24, 0x48, 0x00, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x35, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x69, + 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, + 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x42, + 0x0c, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x2a, 0x37, 0x0a, + 0x0b, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09, 0x0a, 0x05, + 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x41, 0x4c, 0x52, 0x45, 0x41, + 0x44, 0x59, 0x5f, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4c, 0x4f, + 0x47, 0x4f, 0x55, 0x54, 0x10, 0x02, 0x2a, 0x35, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x54, 0x52, 0x59, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4c, 0x4f, 0x47, 0x49, 0x4e, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4f, 0x52, 0x43, 0x45, 0x10, 0x01, 0x32, 0xad, 0x02, + 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, + 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x09, 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, + 0x72, 0x12, 0x1d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x20, 0x5a, + 0x1e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2d, 0x67, + 0x6f, 0x69, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -994,41 +885,39 @@ func file_user_v1_user_proto_rawDescGZIP() []byte { } var file_user_v1_user_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 8) var file_user_v1_user_proto_goTypes = []interface{}{ - (LoginStatus)(0), // 0: api.user.v1.LoginStatus - (LoginType)(0), // 1: api.user.v1.LoginType - (*UserInternalResponse)(nil), // 2: api.user.v1.UserInternalResponse - (*UserInternal)(nil), // 3: api.user.v1.UserInternal - (*User)(nil), // 4: api.user.v1.User - (*UserList)(nil), // 5: api.user.v1.UserList - (*GetUserInfoRequest)(nil), // 6: api.user.v1.GetUserInfoRequest - (*QueryUserRequest)(nil), // 7: api.user.v1.QueryUserRequest - (*CreateUserRequest)(nil), // 8: api.user.v1.CreateUserRequest - (*UpdateUserRequest)(nil), // 9: api.user.v1.UpdateUserRequest - (*UserLoginRequest)(nil), // 10: api.user.v1.UserLoginRequest - (*response.BaseResponse)(nil), // 11: api.transport.response.BaseResponse + (LoginStatus)(0), // 0: api.user.v1.LoginStatus + (LoginType)(0), // 1: api.user.v1.LoginType + (*UserResponse)(nil), // 2: api.user.v1.UserResponse + (*User)(nil), // 3: api.user.v1.User + (*UserList)(nil), // 4: api.user.v1.UserList + (*GetUserInfoRequest)(nil), // 5: api.user.v1.GetUserInfoRequest + (*QueryUserRequest)(nil), // 6: api.user.v1.QueryUserRequest + (*CreateUserRequest)(nil), // 7: api.user.v1.CreateUserRequest + (*UpdateUserRequest)(nil), // 8: api.user.v1.UpdateUserRequest + (*UserLoginRequest)(nil), // 9: api.user.v1.UserLoginRequest + (*errors.Error)(nil), // 10: api.errors.Error } var file_user_v1_user_proto_depIdxs = []int32{ - 11, // 0: api.user.v1.UserInternalResponse.response:type_name -> api.transport.response.BaseResponse - 3, // 1: api.user.v1.UserInternalResponse.user:type_name -> api.user.v1.UserInternal - 0, // 2: api.user.v1.UserInternal.login_status:type_name -> api.user.v1.LoginStatus - 0, // 3: api.user.v1.User.login_status:type_name -> api.user.v1.LoginStatus - 4, // 4: api.user.v1.UserList.users:type_name -> api.user.v1.User - 1, // 5: api.user.v1.UserLoginRequest.login_type:type_name -> api.user.v1.LoginType - 6, // 6: api.user.v1.UserService.GetUser:input_type -> api.user.v1.GetUserInfoRequest - 7, // 7: api.user.v1.UserService.QueryUser:input_type -> api.user.v1.QueryUserRequest - 8, // 8: api.user.v1.UserService.CreateUser:input_type -> api.user.v1.CreateUserRequest - 9, // 9: api.user.v1.UserService.UpdateUser:input_type -> api.user.v1.UpdateUserRequest - 2, // 10: api.user.v1.UserService.GetUser:output_type -> api.user.v1.UserInternalResponse - 2, // 11: api.user.v1.UserService.QueryUser:output_type -> api.user.v1.UserInternalResponse - 2, // 12: api.user.v1.UserService.CreateUser:output_type -> api.user.v1.UserInternalResponse - 2, // 13: api.user.v1.UserService.UpdateUser:output_type -> api.user.v1.UserInternalResponse - 10, // [10:14] is the sub-list for method output_type - 6, // [6:10] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 10, // 0: api.user.v1.UserResponse.error:type_name -> api.errors.Error + 3, // 1: api.user.v1.UserResponse.user:type_name -> api.user.v1.User + 0, // 2: api.user.v1.User.login_status:type_name -> api.user.v1.LoginStatus + 3, // 3: api.user.v1.UserList.users:type_name -> api.user.v1.User + 1, // 4: api.user.v1.UserLoginRequest.login_type:type_name -> api.user.v1.LoginType + 5, // 5: api.user.v1.UserService.GetUser:input_type -> api.user.v1.GetUserInfoRequest + 6, // 6: api.user.v1.UserService.QueryUser:input_type -> api.user.v1.QueryUserRequest + 7, // 7: api.user.v1.UserService.CreateUser:input_type -> api.user.v1.CreateUserRequest + 8, // 8: api.user.v1.UserService.UpdateUser:input_type -> api.user.v1.UpdateUserRequest + 2, // 9: api.user.v1.UserService.GetUser:output_type -> api.user.v1.UserResponse + 2, // 10: api.user.v1.UserService.QueryUser:output_type -> api.user.v1.UserResponse + 2, // 11: api.user.v1.UserService.CreateUser:output_type -> api.user.v1.UserResponse + 2, // 12: api.user.v1.UserService.UpdateUser:output_type -> api.user.v1.UserResponse + 9, // [9:13] is the sub-list for method output_type + 5, // [5:9] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_user_v1_user_proto_init() } @@ -1038,7 +927,7 @@ func file_user_v1_user_proto_init() { } if !protoimpl.UnsafeEnabled { file_user_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserInternalResponse); i { + switch v := v.(*UserResponse); i { case 0: return &v.state case 1: @@ -1050,18 +939,6 @@ func file_user_v1_user_proto_init() { } } file_user_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserInternal); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_user_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*User); i { case 0: return &v.state @@ -1073,7 +950,7 @@ func file_user_v1_user_proto_init() { return nil } } - file_user_v1_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_user_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserList); i { case 0: return &v.state @@ -1085,7 +962,7 @@ func file_user_v1_user_proto_init() { return nil } } - file_user_v1_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_user_v1_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetUserInfoRequest); i { case 0: return &v.state @@ -1097,7 +974,7 @@ func file_user_v1_user_proto_init() { return nil } } - file_user_v1_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_user_v1_user_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QueryUserRequest); i { case 0: return &v.state @@ -1109,7 +986,7 @@ func file_user_v1_user_proto_init() { return nil } } - file_user_v1_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_user_v1_user_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateUserRequest); i { case 0: return &v.state @@ -1121,7 +998,7 @@ func file_user_v1_user_proto_init() { return nil } } - file_user_v1_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_user_v1_user_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateUserRequest); i { case 0: return &v.state @@ -1133,7 +1010,7 @@ func file_user_v1_user_proto_init() { return nil } } - file_user_v1_user_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_user_v1_user_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserLoginRequest); i { case 0: return &v.state @@ -1147,16 +1024,15 @@ func file_user_v1_user_proto_init() { } } file_user_v1_user_proto_msgTypes[1].OneofWrappers = []interface{}{} - file_user_v1_user_proto_msgTypes[2].OneofWrappers = []interface{}{} - file_user_v1_user_proto_msgTypes[5].OneofWrappers = []interface{}{ + file_user_v1_user_proto_msgTypes[4].OneofWrappers = []interface{}{ (*QueryUserRequest_Email)(nil), (*QueryUserRequest_Phone)(nil), } - file_user_v1_user_proto_msgTypes[6].OneofWrappers = []interface{}{ + file_user_v1_user_proto_msgTypes[5].OneofWrappers = []interface{}{ (*CreateUserRequest_Email)(nil), (*CreateUserRequest_Phone)(nil), } - file_user_v1_user_proto_msgTypes[8].OneofWrappers = []interface{}{ + file_user_v1_user_proto_msgTypes[7].OneofWrappers = []interface{}{ (*UserLoginRequest_Email)(nil), (*UserLoginRequest_Phone)(nil), } @@ -1166,7 +1042,7 @@ func file_user_v1_user_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_v1_user_proto_rawDesc, NumEnums: 2, - NumMessages: 9, + NumMessages: 8, NumExtensions: 0, NumServices: 1, }, diff --git a/user/v1/user.pb.validate.go b/user/v1/user.pb.validate.go index c3cae4c..7b35ab1 100644 --- a/user/v1/user.pb.validate.go +++ b/user/v1/user.pb.validate.go @@ -35,22 +35,22 @@ var ( _ = sort.Sort ) -// Validate checks the field values on UserInternalResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UserInternalResponse) Validate() error { +// Validate checks the field values on UserResponse with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *UserResponse) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on UserInternalResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UserInternalResponseMultiError, or nil if none found. -func (m *UserInternalResponse) ValidateAll() error { +// ValidateAll checks the field values on UserResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in UserResponseMultiError, or +// nil if none found. +func (m *UserResponse) ValidateAll() error { return m.validate(true) } -func (m *UserInternalResponse) validate(all bool) error { +func (m *UserResponse) validate(all bool) error { if m == nil { return nil } @@ -58,28 +58,28 @@ func (m *UserInternalResponse) validate(all bool) error { var errors []error if all { - switch v := interface{}(m.GetResponse()).(type) { + switch v := interface{}(m.GetError()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, UserInternalResponseValidationError{ - field: "Response", + errors = append(errors, UserResponseValidationError{ + field: "Error", reason: "embedded message failed validation", cause: err, }) } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, UserInternalResponseValidationError{ - field: "Response", + errors = append(errors, UserResponseValidationError{ + field: "Error", reason: "embedded message failed validation", cause: err, }) } } - } else if v, ok := interface{}(m.GetResponse()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return UserInternalResponseValidationError{ - field: "Response", + return UserResponseValidationError{ + field: "Error", reason: "embedded message failed validation", cause: err, } @@ -90,7 +90,7 @@ func (m *UserInternalResponse) validate(all bool) error { switch v := interface{}(m.GetUser()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { - errors = append(errors, UserInternalResponseValidationError{ + errors = append(errors, UserResponseValidationError{ field: "User", reason: "embedded message failed validation", cause: err, @@ -98,7 +98,7 @@ func (m *UserInternalResponse) validate(all bool) error { } case interface{ Validate() error }: if err := v.Validate(); err != nil { - errors = append(errors, UserInternalResponseValidationError{ + errors = append(errors, UserResponseValidationError{ field: "User", reason: "embedded message failed validation", cause: err, @@ -107,7 +107,7 @@ func (m *UserInternalResponse) validate(all bool) error { } } else if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { - return UserInternalResponseValidationError{ + return UserResponseValidationError{ field: "User", reason: "embedded message failed validation", cause: err, @@ -116,146 +116,18 @@ func (m *UserInternalResponse) validate(all bool) error { } if len(errors) > 0 { - return UserInternalResponseMultiError(errors) - } - - return nil -} - -// UserInternalResponseMultiError is an error wrapping multiple validation -// errors returned by UserInternalResponse.ValidateAll() if the designated -// constraints aren't met. -type UserInternalResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UserInternalResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UserInternalResponseMultiError) AllErrors() []error { return m } - -// UserInternalResponseValidationError is the validation error returned by -// UserInternalResponse.Validate if the designated constraints aren't met. -type UserInternalResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UserInternalResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UserInternalResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UserInternalResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UserInternalResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UserInternalResponseValidationError) ErrorName() string { - return "UserInternalResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UserInternalResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUserInternalResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UserInternalResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UserInternalResponseValidationError{} - -// Validate checks the field values on UserInternal with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *UserInternal) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UserInternal with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in UserInternalMultiError, or -// nil if none found. -func (m *UserInternal) ValidateAll() error { - return m.validate(true) -} - -func (m *UserInternal) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Uid - - // no validation rules for Name - - // no validation rules for Avatar - - // no validation rules for Password - - // no validation rules for LoginStatus - - // no validation rules for CreatedAt - - // no validation rules for UpdatedAt - - if m.Email != nil { - // no validation rules for Email - } - - if m.Phone != nil { - // no validation rules for Phone - } - - if m.PushServerIp != nil { - // no validation rules for PushServerIp - } - - if len(errors) > 0 { - return UserInternalMultiError(errors) + return UserResponseMultiError(errors) } return nil } -// UserInternalMultiError is an error wrapping multiple validation errors -// returned by UserInternal.ValidateAll() if the designated constraints aren't met. -type UserInternalMultiError []error +// UserResponseMultiError is an error wrapping multiple validation errors +// returned by UserResponse.ValidateAll() if the designated constraints aren't met. +type UserResponseMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m UserInternalMultiError) Error() string { +func (m UserResponseMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -264,11 +136,11 @@ func (m UserInternalMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m UserInternalMultiError) AllErrors() []error { return m } +func (m UserResponseMultiError) AllErrors() []error { return m } -// UserInternalValidationError is the validation error returned by -// UserInternal.Validate if the designated constraints aren't met. -type UserInternalValidationError struct { +// UserResponseValidationError is the validation error returned by +// UserResponse.Validate if the designated constraints aren't met. +type UserResponseValidationError struct { field string reason string cause error @@ -276,22 +148,22 @@ type UserInternalValidationError struct { } // Field function returns field value. -func (e UserInternalValidationError) Field() string { return e.field } +func (e UserResponseValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e UserInternalValidationError) Reason() string { return e.reason } +func (e UserResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e UserInternalValidationError) Cause() error { return e.cause } +func (e UserResponseValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e UserInternalValidationError) Key() bool { return e.key } +func (e UserResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e UserInternalValidationError) ErrorName() string { return "UserInternalValidationError" } +func (e UserResponseValidationError) ErrorName() string { return "UserResponseValidationError" } // Error satisfies the builtin error interface -func (e UserInternalValidationError) Error() string { +func (e UserResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -303,14 +175,14 @@ func (e UserInternalValidationError) Error() string { } return fmt.Sprintf( - "invalid %sUserInternal.%s: %s%s", + "invalid %sUserResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = UserInternalValidationError{} +var _ error = UserResponseValidationError{} var _ interface { Field() string @@ -318,7 +190,7 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = UserInternalValidationError{} +} = UserResponseValidationError{} // Validate checks the field values on User with the rules defined in the proto // definition for this message. If any rules are violated, the first error @@ -347,8 +219,14 @@ func (m *User) validate(all bool) error { // no validation rules for Avatar + // no validation rules for Password + // no validation rules for LoginStatus + // no validation rules for CreatedAt + + // no validation rules for UpdatedAt + if m.Email != nil { // no validation rules for Email } @@ -357,8 +235,8 @@ func (m *User) validate(all bool) error { // no validation rules for Phone } - if m.ConnectUrl != nil { - // no validation rules for ConnectUrl + if m.PushServerIp != nil { + // no validation rules for PushServerIp } if len(errors) > 0 { @@ -593,10 +471,10 @@ func (m *GetUserInfoRequest) validate(all bool) error { var errors []error - if l := utf8.RuneCountInString(m.GetUid()); l < 20 || l > 24 { + if m.GetUid() <= 0 { err := GetUserInfoRequestValidationError{ field: "Uid", - reason: "value length must be between 20 and 24 runes, inclusive", + reason: "value must be greater than 0", } if !all { return err @@ -706,9 +584,20 @@ func (m *QueryUserRequest) validate(all bool) error { var errors []error - switch m.User.(type) { - + oneofFieldPresent := false + switch v := m.Field.(type) { case *QueryUserRequest_Email: + if v == nil { + err := QueryUserRequestValidationError{ + field: "Field", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofFieldPresent = true if err := m._validateEmail(m.GetEmail()); err != nil { err = QueryUserRequestValidationError{ @@ -723,6 +612,17 @@ func (m *QueryUserRequest) validate(all bool) error { } case *QueryUserRequest_Phone: + if v == nil { + err := QueryUserRequestValidationError{ + field: "Field", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofFieldPresent = true if !_QueryUserRequest_Phone_Pattern.MatchString(m.GetPhone()) { err := QueryUserRequestValidationError{ @@ -736,15 +636,17 @@ func (m *QueryUserRequest) validate(all bool) error { } default: + _ = v // ensures v is used + } + if !oneofFieldPresent { err := QueryUserRequestValidationError{ - field: "User", + field: "Field", reason: "value is required", } if !all { return err } errors = append(errors, err) - } if len(errors) > 0 { @@ -921,9 +823,20 @@ func (m *CreateUserRequest) validate(all bool) error { errors = append(errors, err) } - switch m.User.(type) { - + oneofFieldPresent := false + switch v := m.Field.(type) { case *CreateUserRequest_Email: + if v == nil { + err := CreateUserRequestValidationError{ + field: "Field", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofFieldPresent = true if err := m._validateEmail(m.GetEmail()); err != nil { err = CreateUserRequestValidationError{ @@ -938,6 +851,17 @@ func (m *CreateUserRequest) validate(all bool) error { } case *CreateUserRequest_Phone: + if v == nil { + err := CreateUserRequestValidationError{ + field: "Field", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofFieldPresent = true if !_CreateUserRequest_Phone_Pattern.MatchString(m.GetPhone()) { err := CreateUserRequestValidationError{ @@ -951,15 +875,17 @@ func (m *CreateUserRequest) validate(all bool) error { } default: + _ = v // ensures v is used + } + if !oneofFieldPresent { err := CreateUserRequestValidationError{ - field: "User", + field: "Field", reason: "value is required", } if !all { return err } errors = append(errors, err) - } if len(errors) > 0 { @@ -1116,10 +1042,10 @@ func (m *UpdateUserRequest) validate(all bool) error { var errors []error - if l := utf8.RuneCountInString(m.GetUid()); l < 20 || l > 24 { + if m.GetUid() <= 0 { err := UpdateUserRequestValidationError{ field: "Uid", - reason: "value length must be between 20 and 24 runes, inclusive", + reason: "value must be greater than 0", } if !all { return err @@ -1188,6 +1114,21 @@ func (m *UpdateUserRequest) validate(all bool) error { } + if m.GetPassword() != "" { + + if l := utf8.RuneCountInString(m.GetPassword()); l < 6 || l > 20 { + err := UpdateUserRequestValidationError{ + field: "Password", + reason: "value length must be between 6 and 20 runes, inclusive", + } + if !all { + return err + } + errors = append(errors, err) + } + + } + if len(errors) > 0 { return UpdateUserRequestMultiError(errors) } @@ -1346,9 +1287,20 @@ func (m *UserLoginRequest) validate(all bool) error { // no validation rules for LoginType - switch m.User.(type) { - + oneofFieldPresent := false + switch v := m.Field.(type) { case *UserLoginRequest_Email: + if v == nil { + err := UserLoginRequestValidationError{ + field: "Field", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofFieldPresent = true if err := m._validateEmail(m.GetEmail()); err != nil { err = UserLoginRequestValidationError{ @@ -1363,6 +1315,17 @@ func (m *UserLoginRequest) validate(all bool) error { } case *UserLoginRequest_Phone: + if v == nil { + err := UserLoginRequestValidationError{ + field: "Field", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + oneofFieldPresent = true if !_UserLoginRequest_Phone_Pattern.MatchString(m.GetPhone()) { err := UserLoginRequestValidationError{ @@ -1376,15 +1339,17 @@ func (m *UserLoginRequest) validate(all bool) error { } default: + _ = v // ensures v is used + } + if !oneofFieldPresent { err := UserLoginRequestValidationError{ - field: "User", + field: "Field", reason: "value is required", } if !all { return err } errors = append(errors, err) - } if len(errors) > 0 { diff --git a/user/v1/user.proto b/user/v1/user.proto index 196bf57..54b0ea5 100644 --- a/user/v1/user.proto +++ b/user/v1/user.proto @@ -3,7 +3,7 @@ syntax = "proto3"; package api.user.v1; // import api/transport/v1/http.proto; -import "transport/response/response.proto"; +import "errors/errors.proto"; import "validate/validate.proto"; option go_package = "github.com/go-goim/api/user/v1"; @@ -14,14 +14,13 @@ enum LoginStatus { LOGOUT = 2; } -message UserInternalResponse { - api.transport.response.BaseResponse response = 1; - UserInternal user = 2; +message UserResponse { + errors.Error error = 1; + User user = 2; } -// UserInternal is the internal representation of a user. -message UserInternal { - string uid = 1; +message User { + int64 uid = 1; string name = 2; optional string email = 3; optional string phone = 4; @@ -36,33 +35,18 @@ message UserInternal { int64 updated_at = 10; } -// User use for return user info to client. -message User { - string uid = 1; - string name = 2; - optional string email = 3; - optional string phone = 4; - string avatar = 5; - // ws_url is url of user need connect via ws or tcp - optional string connect_url = 6; - // 0: first time login, need connect to push server - // 1: already login, no need connect to push server - LoginStatus login_status = 8; -} - message UserList { repeated User users = 1; } message GetUserInfoRequest { - string uid = 1 [(validate.rules).string = { - min_len: 20, - max_len: 24 + int64 uid = 1 [(validate.rules).int64 = { + gt: 0 }]; } message QueryUserRequest { - oneof user { + oneof field { option (validate.required) = true; string email = 1 [(validate.rules).string.email = true]; string phone = 2 [(validate.rules).string.pattern = "^1[3-9]\\d{9}$"]; @@ -74,7 +58,7 @@ message CreateUserRequest { min_len: 2, max_len: 20 }]; - oneof user { + oneof field { option (validate.required) = true; string email = 2 [(validate.rules).string.email = true]; string phone = 3 [(validate.rules).string.pattern = "^1[3-9]\\d{9}$"]; @@ -86,9 +70,8 @@ message CreateUserRequest { } message UpdateUserRequest { - string uid = 1 [(validate.rules).string = { - min_len: 20, - max_len: 24 + int64 uid = 1 [(validate.rules).int64 = { + gt: 0 }]; string name = 2 [(validate.rules).string = { min_len: 2, @@ -107,21 +90,26 @@ message UpdateUserRequest { max_len: 128, ignore_empty: true }]; + string password = 6 [(validate.rules).string = { + min_len: 6, + max_len: 20, + ignore_empty: true + }]; } service UserService { // GetUser get user info by uid, called when uid is known. - rpc GetUser(GetUserInfoRequest) returns (UserInternalResponse); + rpc GetUser(GetUserInfoRequest) returns (UserResponse); // QueryUser query user info by email or phone, called when uid is unknown. - rpc QueryUser(QueryUserRequest) returns (UserInternalResponse); + rpc QueryUser(QueryUserRequest) returns (UserResponse); // CreateUser create user. - rpc CreateUser(CreateUserRequest) returns (UserInternalResponse); + rpc CreateUser(CreateUserRequest) returns (UserResponse); // UpdateUser update user info. - rpc UpdateUser(UpdateUserRequest) returns (UserInternalResponse); + rpc UpdateUser(UpdateUserRequest) returns (UserResponse); } message UserLoginRequest { - oneof user { + oneof field { option (validate.required) = true; string email = 1 [(validate.rules).string.email = true]; string phone = 2 [(validate.rules).string.pattern = "^1[3-9]\\d{9}$"]; diff --git a/user/v1/user_grpc.pb.go b/user/v1/user_grpc.pb.go index 11400dd..eabc74d 100644 --- a/user/v1/user_grpc.pb.go +++ b/user/v1/user_grpc.pb.go @@ -1,4 +1,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: user/v1/user.proto package v1 @@ -14,18 +18,25 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 +const ( + UserService_GetUser_FullMethodName = "/api.user.v1.UserService/GetUser" + UserService_QueryUser_FullMethodName = "/api.user.v1.UserService/QueryUser" + UserService_CreateUser_FullMethodName = "/api.user.v1.UserService/CreateUser" + UserService_UpdateUser_FullMethodName = "/api.user.v1.UserService/UpdateUser" +) + // UserServiceClient is the client API for UserService 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. type UserServiceClient interface { // GetUser get user info by uid, called when uid is known. - GetUser(ctx context.Context, in *GetUserInfoRequest, opts ...grpc.CallOption) (*UserInternalResponse, error) + GetUser(ctx context.Context, in *GetUserInfoRequest, opts ...grpc.CallOption) (*UserResponse, error) // QueryUser query user info by email or phone, called when uid is unknown. - QueryUser(ctx context.Context, in *QueryUserRequest, opts ...grpc.CallOption) (*UserInternalResponse, error) + QueryUser(ctx context.Context, in *QueryUserRequest, opts ...grpc.CallOption) (*UserResponse, error) // CreateUser create user. - CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*UserInternalResponse, error) + CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*UserResponse, error) // UpdateUser update user info. - UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UserInternalResponse, error) + UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UserResponse, error) } type userServiceClient struct { @@ -36,36 +47,36 @@ func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { return &userServiceClient{cc} } -func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserInfoRequest, opts ...grpc.CallOption) (*UserInternalResponse, error) { - out := new(UserInternalResponse) - err := c.cc.Invoke(ctx, "/api.user.v1.UserService/GetUser", in, out, opts...) +func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserInfoRequest, opts ...grpc.CallOption) (*UserResponse, error) { + out := new(UserResponse) + err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *userServiceClient) QueryUser(ctx context.Context, in *QueryUserRequest, opts ...grpc.CallOption) (*UserInternalResponse, error) { - out := new(UserInternalResponse) - err := c.cc.Invoke(ctx, "/api.user.v1.UserService/QueryUser", in, out, opts...) +func (c *userServiceClient) QueryUser(ctx context.Context, in *QueryUserRequest, opts ...grpc.CallOption) (*UserResponse, error) { + out := new(UserResponse) + err := c.cc.Invoke(ctx, UserService_QueryUser_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*UserInternalResponse, error) { - out := new(UserInternalResponse) - err := c.cc.Invoke(ctx, "/api.user.v1.UserService/CreateUser", in, out, opts...) +func (c *userServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*UserResponse, error) { + out := new(UserResponse) + err := c.cc.Invoke(ctx, UserService_CreateUser_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UserInternalResponse, error) { - out := new(UserInternalResponse) - err := c.cc.Invoke(ctx, "/api.user.v1.UserService/UpdateUser", in, out, opts...) +func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*UserResponse, error) { + out := new(UserResponse) + err := c.cc.Invoke(ctx, UserService_UpdateUser_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -77,13 +88,13 @@ func (c *userServiceClient) UpdateUser(ctx context.Context, in *UpdateUserReques // for forward compatibility type UserServiceServer interface { // GetUser get user info by uid, called when uid is known. - GetUser(context.Context, *GetUserInfoRequest) (*UserInternalResponse, error) + GetUser(context.Context, *GetUserInfoRequest) (*UserResponse, error) // QueryUser query user info by email or phone, called when uid is unknown. - QueryUser(context.Context, *QueryUserRequest) (*UserInternalResponse, error) + QueryUser(context.Context, *QueryUserRequest) (*UserResponse, error) // CreateUser create user. - CreateUser(context.Context, *CreateUserRequest) (*UserInternalResponse, error) + CreateUser(context.Context, *CreateUserRequest) (*UserResponse, error) // UpdateUser update user info. - UpdateUser(context.Context, *UpdateUserRequest) (*UserInternalResponse, error) + UpdateUser(context.Context, *UpdateUserRequest) (*UserResponse, error) mustEmbedUnimplementedUserServiceServer() } @@ -91,16 +102,16 @@ type UserServiceServer interface { type UnimplementedUserServiceServer struct { } -func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserInfoRequest) (*UserInternalResponse, error) { +func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserInfoRequest) (*UserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") } -func (UnimplementedUserServiceServer) QueryUser(context.Context, *QueryUserRequest) (*UserInternalResponse, error) { +func (UnimplementedUserServiceServer) QueryUser(context.Context, *QueryUserRequest) (*UserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryUser not implemented") } -func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*UserInternalResponse, error) { +func (UnimplementedUserServiceServer) CreateUser(context.Context, *CreateUserRequest) (*UserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") } -func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UserInternalResponse, error) { +func (UnimplementedUserServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*UserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") } func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} @@ -126,7 +137,7 @@ func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.v1.UserService/GetUser", + FullMethod: UserService_GetUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).GetUser(ctx, req.(*GetUserInfoRequest)) @@ -144,7 +155,7 @@ func _UserService_QueryUser_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.v1.UserService/QueryUser", + FullMethod: UserService_QueryUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).QueryUser(ctx, req.(*QueryUserRequest)) @@ -162,7 +173,7 @@ func _UserService_CreateUser_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.v1.UserService/CreateUser", + FullMethod: UserService_CreateUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).CreateUser(ctx, req.(*CreateUserRequest)) @@ -180,7 +191,7 @@ func _UserService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.v1.UserService/UpdateUser", + FullMethod: UserService_UpdateUser_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest))