diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..6494926 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" + reviewers: + - "yusank" + assignees: + - "yusank" diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml deleted file mode 100644 index 97cba71..0000000 --- a/.github/workflows/semgrep.yml +++ /dev/null @@ -1,21 +0,0 @@ -on: - pull_request: {} - push: - branches: - - main - paths: - - .github/workflows/semgrep.yml - schedule: - - cron: '0 0 * * *' -name: Semgrep -jobs: - semgrep: - name: Scan - runs-on: ubuntu-20.04 - env: - SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} - container: - image: returntocorp/semgrep - steps: - - uses: actions/checkout@v3 - - run: semgrep ci diff --git a/Makefile b/Makefile index c632574..ee27903 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ SHELL:=/usr/bin/env bash .DEFAULT_GOAL:=help +COLOR := "\e[1;36m%s\e[0m" + +# Note this is just for the tour! +export BUF_USER=yusank ################################################## # Development # @@ -26,15 +30,40 @@ test: ## Run test against code. ##@ Generate -.PHONY: gen-protoc -gen-protoc: ## Run protoc command to generate pb code. - # call gen_proto.sh - ./gen_proto.sh +.PHONY: protoc + +PROTO_ROOT := . +PROTO_IGNORE := ./third_party +PROTO_FILES = $(shell find $(PROTO_ROOT) -path $(PROTO_IGNORE) -prune -o -type f -name "*.proto" -print) +PROTO_DIRS = $(sort $(dir $(PROTO_FILES))) +PROTO_IMPORTS := --proto_path=. --proto_path=./third_party +PROTO_OPTIONS := --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. --validate_out=lang=go,paths=source_relative:. + +define NEWLINE + + +endef + +protoc: ## Generate pb code. + @printf $(COLOR) "Generating protobuf code..." +# Run protoc command to generate pb code. + $(foreach PROTO_DIR,$(PROTO_DIRS),\ + protoc $(PROTO_IMPORTS) $(PROTO_OPTIONS) $(PROTO_DIR)*.proto \ + $(NEWLINE)) + @printf $(COLOR) "Done." .PHONY: tools-install tools-install: ## Install tools. go get -u github.com/golang/protobuf/protoc-gen-go +.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/buf.gen.tag.yaml b/buf.gen.tag.yaml new file mode 100644 index 0000000..5f6ba50 --- /dev/null +++ b/buf.gen.tag.yaml @@ -0,0 +1,5 @@ +version: v1 +plugins: + - name: gotag + out: . + opt: paths=source_relative,auto="form-as-snake" \ No newline at end of file diff --git a/buf.gen.yaml b/buf.gen.yaml new file mode 100644 index 0000000..a8e5e0c --- /dev/null +++ b/buf.gen.yaml @@ -0,0 +1,13 @@ +version: v1 +plugins: + - name: go + out: . + opt: paths=source_relative + - name: go-grpc + out: . + opt: paths=source_relative + - name: validate + out: . + opt: + - lang=go + - paths=source_relative \ No newline at end of file diff --git a/buf.lock b/buf.lock new file mode 100644 index 0000000..2415498 --- /dev/null +++ b/buf.lock @@ -0,0 +1,7 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: envoyproxy + repository: protoc-gen-validate + commit: dc09a417d27241f7b069feae2cd74a0e diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 0000000..c45e614 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,9 @@ +version: v1 +deps: + - buf.build/envoyproxy/protoc-gen-validate +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/config/registry/v1/registry.pb.go b/config/registry/v1/registry.pb.go index 459b173..d1a290c 100644 --- a/config/registry/v1/registry.pb.go +++ b/config/registry/v1/registry.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc-gen-go v1.34.1 +// protoc (unknown) // source: config/registry/v1/registry.proto package v1 @@ -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/registry/v1/registry.proto b/config/registry/v1/registry.proto index 962a3a9..a7036bd 100644 --- a/config/registry/v1/registry.proto +++ b/config/registry/v1/registry.proto @@ -1,40 +1,57 @@ syntax = "proto3"; package api.config.registry.v1; -option go_package = "github.com/go-goim/api/config/registry/v1"; import "google/protobuf/duration.proto"; - import "validate/validate.proto"; +option go_package = "github.com/go-goim/api/config/registry/v1"; + message RegistryInfo { - repeated string addr = 1 [(validate.rules).repeated = { - min_items: 1, - unique: true, - }]; - string scheme = 2 [(validate.rules).string = {in: ["http", "grpc"]}]; - // range [10ms, 10s] - google.protobuf.Duration dial_timeout_sec = 3 [(validate.rules).duration = { - gte: {nanos: 1000000, seconds: 0}, - lte: {seconds: 10} - }]; - google.protobuf.Duration dial_keep_alive_time_sec = 4; - google.protobuf.Duration dial_keep_alive_timeout_sec = 5; + repeated string addr = 1 [(validate.rules).repeated = { + min_items: 1, + unique: true, + }]; + string scheme = 2 [(validate.rules).string = { + in: [ + "http", + "grpc" + ] + }]; + // range [10ms, 10s] + google.protobuf.Duration dial_timeout_sec = 3 [(validate.rules).duration = { + gte: { + nanos: 1000000, + seconds: 0 + }, + lte: { + seconds: 10 + } + }]; + google.protobuf.Duration dial_keep_alive_time_sec = 4; + google.protobuf.Duration dial_keep_alive_timeout_sec = 5; } message ConfigCenterInfo { - // PathPrefix is prefix key of config center. - string path_prefix = 1; - // Paths is config paths of config center. - repeated string paths = 2 [(validate.rules).repeated = {unique: true}]; - // Format is config format of config center. - string format = 3 [(validate.rules).string = {in: ["json", "yaml"]}]; + // PathPrefix is prefix key of config center. + string path_prefix = 1; + // Paths is config paths of config center. + repeated string paths = 2 [(validate.rules).repeated = { + unique: true + }]; + // Format is config format of config center. + string format = 3 [(validate.rules).string = { + in: [ + "json", + "yaml" + ] + }]; } message Registry { - ConfigCenterInfo config_center = 1; - oneof reg { - RegistryInfo consul = 2; - RegistryInfo etcd = 3; - } + ConfigCenterInfo config_center = 1; + oneof reg { + RegistryInfo consul = 2; + RegistryInfo etcd = 3; + } } diff --git a/config/v1/config.pb.go b/config/v1/config.pb.go index 9347499..75aa51a 100644 --- a/config/v1/config.pb.go +++ b/config/v1/config.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc-gen-go v1.34.1 +// protoc (unknown) // source: config/v1/config.proto package v1 @@ -163,12 +163,12 @@ type Service struct { Mq *MQ `protobuf:"bytes,8,opt,name=mq,proto3" json:"mq,omitempty"` Mysql *MySQL `protobuf:"bytes,9,opt,name=mysql,proto3" json:"mysql,omitempty"` // services name - GatewayService string `protobuf:"bytes,10,opt,name=gatewayService,proto3" json:"gatewayService,omitempty"` - UserService string `protobuf:"bytes,11,opt,name=userService,proto3" json:"userService,omitempty"` - PushService string `protobuf:"bytes,12,opt,name=pushService,proto3" json:"pushService,omitempty"` - StoreWorker string `protobuf:"bytes,13,opt,name=storeWorker,proto3" json:"storeWorker,omitempty"` - MsgService string `protobuf:"bytes,14,opt,name=msgService,proto3" json:"msgService,omitempty"` - MsgWorker string `protobuf:"bytes,15,opt,name=msgWorker,proto3" json:"msgWorker,omitempty"` + GatewayService string `protobuf:"bytes,11,opt,name=gatewayService,proto3" json:"gatewayService,omitempty"` + UserService string `protobuf:"bytes,12,opt,name=userService,proto3" json:"userService,omitempty"` + PushService string `protobuf:"bytes,13,opt,name=pushService,proto3" json:"pushService,omitempty"` + StoreWorker string `protobuf:"bytes,14,opt,name=storeWorker,proto3" json:"storeWorker,omitempty"` + MsgService string `protobuf:"bytes,15,opt,name=msgService,proto3" json:"msgService,omitempty"` + MsgWorker string `protobuf:"bytes,16,opt,name=msgWorker,proto3" json:"msgWorker,omitempty"` } func (x *Service) Reset() { @@ -669,18 +669,18 @@ var file_config_v1_config_proto_rawDesc = []byte{ 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, 0x26, 0x0a, 0x0e, 0x67, 0x61, - 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, + 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, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, + 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, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x75, 0x73, 0x68, 0x53, + 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, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x74, 0x6f, + 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, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x73, + 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, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x73, 0x67, + 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, diff --git a/config/v1/config.proto b/config/v1/config.proto index 5e2fc2a..1413555 100644 --- a/config/v1/config.proto +++ b/config/v1/config.proto @@ -1,99 +1,137 @@ syntax = "proto3"; package api.config.v1; -option go_package = "github.com/go-goim/api/config/v1"; import "google/protobuf/duration.proto"; - import "validate/validate.proto"; +option go_package = "github.com/go-goim/api/config/v1"; + message Server { - string scheme = 1 [(validate.rules).string = {in: ["http", "grpc", "tcp"]}]; - int32 port = 2 [(validate.rules).int32 = {gt: 10000, lt: 60535}]; - // range:[10ms, 10s] - google.protobuf.Duration timeout = 3 [(validate.rules).duration = { - gte: {nanos: 10000000, seconds: 0}, - lte: {seconds: 10} - }]; + string scheme = 1 [(validate.rules).string = { + in: [ + "http", + "grpc", + "tcp" + ] + }]; + int32 port = 2 [(validate.rules).int32 = { + gt: 10000, + lt: 60535 + }]; + // range:[10ms, 10s] + google.protobuf.Duration timeout = 3 [(validate.rules).duration = { + gte: { + nanos: 10000000, + seconds: 0 + }, + lte: { + seconds: 10 + } + }]; } message Service { - // name has three parts: - // 1. constant value: "goim" - // 2. service type: ["service", "worker", "admin"] - // 3. service name: any string - // parts joined by "." - // example: "goim.service.chat" - string name = 1 [(validate.rules).string = {pattern: "^goim\\.(service|worker|admin)\\.[a-zA-Z0-9_]+$"}]; - // version must match like "vx.y.z" - string version = 2 [(validate.rules).string = {pattern: "^v[0-9]+\\.[0-9]+\\.[0-9]+$"}]; - optional Server http = 3; - optional Server grpc = 4; - Log log = 5; - map metadata = 6; - Redis redis = 7; - MQ mq = 8; - MySQL mysql = 9; - // services name - string gatewayService = 10; - string userService = 11; - string pushService = 12; - string storeWorker = 13; - string msgService = 14; - string msgWorker = 15; + // name has three parts: + // 1. constant value: "goim" + // 2. service type: ["service", "worker", "admin"] + // 3. service name: any string + // parts joined by "." + // example: "goim.service.chat" + string name = 1 [(validate.rules).string = { + pattern: "^goim\\.(service|worker|admin)\\.[a-zA-Z0-9_]+$" + }]; + // version must match like "vx.y.z" + string version = 2 [(validate.rules).string = { + pattern: "^v[0-9]+\\.[0-9]+\\.[0-9]+$" + }]; + optional Server http = 3; + optional Server grpc = 4; + Log log = 5; + map metadata = 6; + Redis redis = 7; + MQ mq = 8; + MySQL mysql = 9; + // services name + string gatewayService = 11; + string userService = 12; + string pushService = 13; + string storeWorker = 14; + string msgService = 15; + string msgWorker = 16; } enum Level { - DEBUG = 0; - INFO = 1; - WARNING = 2; - ERROR = 3; - FATAL = 4; + DEBUG = 0; + INFO = 1; + WARNING = 2; + ERROR = 3; + FATAL = 4; } message Log { - optional string log_path = 1; - Level level = 2 [(validate.rules).enum.defined_only = true]; - bool enable_console = 3; + optional string log_path = 1; + Level level = 2 [(validate.rules).enum.defined_only = true]; + bool enable_console = 3; } message Redis { - string addr = 1; - string password = 2; - int32 max_conns = 3; - int32 min_idle_conns = 4; - // range: [10ms,10s] - google.protobuf.Duration dial_timeout = 5 [(validate.rules).duration = { - gte: {nanos: 10000000, seconds: 0}, - lte: {seconds: 10} - }]; - // range: [10ms,10s] - google.protobuf.Duration idle_timeout = 6 [(validate.rules).duration = { - gte: {nanos: 10000000, seconds: 0}, - lte: {seconds: 10} - }]; + string addr = 1; + string password = 2; + int32 max_conns = 3; + int32 min_idle_conns = 4; + // range: [10ms,10s] + google.protobuf.Duration dial_timeout = 5 [(validate.rules).duration = { + gte: { + nanos: 10000000, + seconds: 0 + }, + lte: { + seconds: 10 + } + }]; + // range: [10ms,10s] + google.protobuf.Duration idle_timeout = 6 [(validate.rules).duration = { + gte: { + nanos: 10000000, + seconds: 0 + }, + lte: { + seconds: 10 + } + }]; } message MQ { - repeated string addr = 1; - int32 max_retry = 2; + repeated string addr = 1; + int32 max_retry = 2; } message MySQL { - string addr = 1; - string user = 2; - string password = 3; - string db = 4; - int32 max_idle_conns = 5; - int32 max_open_conns = 6; - // range: [10ms,10s] - google.protobuf.Duration idle_timeout = 7 [(validate.rules).duration = { - gte: {nanos: 1000000, seconds: 0}, - lte: {seconds: 10} - }]; - // range: [10ms,10s] - google.protobuf.Duration open_timeout = 8 [(validate.rules).duration = { - gte: {nanos: 1000000, seconds: 0}, - lte: {seconds: 10} - }]; + string addr = 1; + string user = 2; + string password = 3; + string db = 4; + int32 max_idle_conns = 5; + int32 max_open_conns = 6; + // range: [10ms,10s] + google.protobuf.Duration idle_timeout = 7 [(validate.rules).duration = { + gte: { + nanos: 1000000, + seconds: 0 + }, + lte: { + seconds: 10 + } + }]; + // range: [10ms,10s] + google.protobuf.Duration open_timeout = 8 [(validate.rules).duration = { + gte: { + nanos: 1000000, + seconds: 0 + }, + lte: { + seconds: 10 + } + }]; } \ 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 63% rename from transport/response/response.proto rename to errors/errors.proto index 8d2ba5c..aabe667 100644 --- a/transport/response/response.proto +++ b/errors/errors.proto @@ -1,9 +1,10 @@ syntax = "proto3"; -package api.transport.response; -option go_package = "github.com/go-goim/api/transport/response"; +package api.errors; -enum Code { +option go_package = "github.com/go-goim/api/errors"; + +enum ErrorCode { OK = 0; // common error codes @@ -28,11 +29,18 @@ enum Code { // push server error codes UserNotOnline = 40001; + + // group error codes + GroupNotExist = 50001; + GroupExist = 50002; + NotGroupMember = 50003; + NotGroupOwner = 50004; + 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 32ccf14..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.7.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.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/davecgh/go-spew v1.1.1 // 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 - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // 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 9721b98..a58c186 100644 --- a/go.sum +++ b/go.sum @@ -1,168 +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 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= -github.com/davecgh/go-spew v1.1.0/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/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/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/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 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -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 h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/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= +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= 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 8a4ffee..1f62ef6 100644 --- a/message/v1/message.pb.go +++ b/message/v1/message.pb.go @@ -1,16 +1,17 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc-gen-go v1.34.1 +// protoc (unknown) // source: message/v1/message.proto 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" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -25,25 +26,22 @@ const ( type MessageContentType int32 const ( - MessageContentType_UnknownContentType MessageContentType = 0 - MessageContentType_Text MessageContentType = 1 - MessageContentType_Image MessageContentType = 2 - MessageContentType_Voice MessageContentType = 3 + MessageContentType_Text MessageContentType = 0 + MessageContentType_Image MessageContentType = 1 + MessageContentType_Voice MessageContentType = 2 ) // Enum value maps for MessageContentType. var ( MessageContentType_name = map[int32]string{ - 0: "UnknownContentType", - 1: "Text", - 2: "Image", - 3: "Voice", + 0: "Text", + 1: "Image", + 2: "Voice", } MessageContentType_value = map[string]int32{ - "UnknownContentType": 0, - "Text": 1, - "Image": 2, - "Voice": 3, + "Text": 0, + "Image": 1, + "Voice": 2, } ) @@ -74,71 +72,119 @@ func (MessageContentType) EnumDescriptor() ([]byte, []int) { return file_message_v1_message_proto_rawDescGZIP(), []int{0} } -type PushMessageType int32 +// define session type and status +type SessionType int32 const ( - PushMessageType_UnknownUserType PushMessageType = 0 - // user to user - PushMessageType_User PushMessageType = 1 - // user to group - PushMessageType_Group PushMessageType = 2 - // global broadcast - PushMessageType_Broadcast PushMessageType = 3 + 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 PushMessageType. +// Enum value maps for SessionType. var ( - PushMessageType_name = map[int32]string{ - 0: "UnknownUserType", - 1: "User", - 2: "Group", - 3: "Broadcast", - } - PushMessageType_value = map[string]int32{ - "UnknownUserType": 0, - "User": 1, - "Group": 2, - "Broadcast": 3, + 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 PushMessageType) Enum() *PushMessageType { - p := new(PushMessageType) +func (x SessionType) Enum() *SessionType { + p := new(SessionType) *p = x return p } -func (x PushMessageType) String() string { +func (x SessionType) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (PushMessageType) Descriptor() protoreflect.EnumDescriptor { +func (SessionType) Descriptor() protoreflect.EnumDescriptor { return file_message_v1_message_proto_enumTypes[1].Descriptor() } -func (PushMessageType) Type() protoreflect.EnumType { +func (SessionType) Type() protoreflect.EnumType { return &file_message_v1_message_proto_enumTypes[1] } -func (x PushMessageType) Number() protoreflect.EnumNumber { +func (x SessionType) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use PushMessageType.Descriptor instead. -func (PushMessageType) EnumDescriptor() ([]byte, []int) { +// 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 - FromUser string `protobuf:"bytes,1,opt,name=from_user,json=fromUser,proto3" json:"from_user,omitempty"` - ToUser string `protobuf:"bytes,2,opt,name=to_user,json=toUser,proto3" json:"to_user,omitempty"` - ContentType MessageContentType `protobuf:"varint,3,opt,name=content_type,json=contentType,proto3,enum=api.message.v1.MessageContentType" json:"content_type,omitempty"` - Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,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"` } func (x *SendMessageReq) Reset() { @@ -173,63 +219,487 @@ func (*SendMessageReq) Descriptor() ([]byte, []int) { return file_message_v1_message_proto_rawDescGZIP(), []int{0} } -func (x *SendMessageReq) GetFromUser() string { +func (x *SendMessageReq) GetFrom() int64 { + if x != nil { + return x.From + } + return 0 +} + +func (x *SendMessageReq) GetTo() int64 { + if x != nil { + return x.To + } + return 0 +} + +func (x *SendMessageReq) GetSessionType() SessionType { + if x != nil { + return x.SessionType + } + return SessionType_SingleChat +} + +func (x *SendMessageReq) GetSessionId() string { + if x != nil && x.SessionId != nil { + return *x.SessionId + } + return "" +} + +func (x *SendMessageReq) GetContentType() MessageContentType { + if x != nil { + return x.ContentType + } + return MessageContentType_Text +} + +func (x *SendMessageReq) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +// Message is definition of message +type Message struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + MsgId int64 `protobuf:"varint,1,opt,name=msg_id,json=msgId,proto3" json:"msg_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"` +} + +func (x *Message) Reset() { + *x = Message{} + if protoimpl.UnsafeEnabled { + mi := &file_message_v1_message_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Message) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Message) ProtoMessage() {} + +func (x *Message) 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 Message.ProtoReflect.Descriptor instead. +func (*Message) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{1} +} + +func (x *Message) GetMsgId() int64 { + if x != nil { + return x.MsgId + } + return 0 +} + +func (x *Message) GetFrom() int64 { + if x != nil { + return x.From + } + return 0 +} + +func (x *Message) GetTo() int64 { + if x != nil { + return x.To + } + return 0 +} + +func (x *Message) GetSessionType() SessionType { + if x != nil { + return x.SessionType + } + return SessionType_SingleChat +} + +func (x *Message) GetSessionId() string { + if x != nil { + return x.SessionId + } + return "" +} + +func (x *Message) GetContentType() MessageContentType { + if x != nil { + return x.ContentType + } + return MessageContentType_Text +} + +func (x *Message) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *Message) GetCreateTime() int64 { + if x != nil { + return x.CreateTime + } + return 0 +} + +// PushMessage use for push a message to persistence connection server +type PushMessageReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + // ToUsers is a list of user id who receive this message + 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[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushMessageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushMessageReq) ProtoMessage() {} + +func (x *PushMessageReq) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_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 PushMessageReq.ProtoReflect.Descriptor instead. +func (*PushMessageReq) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{2} +} + +func (x *PushMessageReq) GetMessage() *Message { + if x != nil { + return x.Message + } + return nil +} + +func (x *PushMessageReq) GetToUsers() []int64 { + if x != nil { + return x.ToUsers + } + return nil +} + +type PushMessageResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushMessageResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushMessageResp) ProtoMessage() {} + +func (x *PushMessageResp) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PushMessageResp.ProtoReflect.Descriptor instead. +func (*PushMessageResp) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{3} +} + +func (x *PushMessageResp) GetError() *errors.Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *PushMessageResp) GetFailedUsers() []int64 { + if x != nil { + return x.FailedUsers + } + return nil +} + +type QueryOfflineMessageReq 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"` + 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[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryOfflineMessageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryOfflineMessageReq) ProtoMessage() {} + +func (x *QueryOfflineMessageReq) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryOfflineMessageReq.ProtoReflect.Descriptor instead. +func (*QueryOfflineMessageReq) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{4} +} + +func (x *QueryOfflineMessageReq) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *QueryOfflineMessageReq) GetLastMsgId() int64 { + if x != nil { + return x.LastMsgId + } + return 0 +} + +func (x *QueryOfflineMessageReq) GetOnlyCount() bool { + if x != nil { + return x.OnlyCount + } + return false +} + +func (x *QueryOfflineMessageReq) GetPage() int32 { if x != nil { - return x.FromUser + return x.Page + } + return 0 +} + +func (x *QueryOfflineMessageReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type QueryOfflineMessageResp 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 *QueryOfflineMessageResp) Reset() { + *x = QueryOfflineMessageResp{} + if protoimpl.UnsafeEnabled { + mi := &file_message_v1_message_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryOfflineMessageResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryOfflineMessageResp) ProtoMessage() {} + +func (x *QueryOfflineMessageResp) ProtoReflect() protoreflect.Message { + mi := &file_message_v1_message_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use QueryOfflineMessageResp.ProtoReflect.Descriptor instead. +func (*QueryOfflineMessageResp) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{5} +} + +func (x *QueryOfflineMessageResp) GetError() *errors.Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *QueryOfflineMessageResp) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + +func (x *QueryOfflineMessageResp) GetMessages() []*Message { + if x != nil { + return x.Messages + } + return nil +} + +type ConfirmLastMsgIDReq 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"` +} + +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 (x *ConfirmLastMsgIDReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +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 "" + return mi.MessageOf(x) } -func (x *SendMessageReq) GetToUser() string { - if x != nil { - return x.ToUser - } - return "" +// Deprecated: Use ConfirmLastMsgIDReq.ProtoReflect.Descriptor instead. +func (*ConfirmLastMsgIDReq) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{6} } -func (x *SendMessageReq) GetContentType() MessageContentType { +func (x *ConfirmLastMsgIDReq) GetUid() int64 { if x != nil { - return x.ContentType + return x.Uid } - return MessageContentType_UnknownContentType + return 0 } -func (x *SendMessageReq) GetContent() string { +func (x *ConfirmLastMsgIDReq) GetLastMsgId() int64 { if x != nil { - return x.Content + return x.LastMsgId } - return "" + return 0 } -// SendMessageResp is response body for sendMessage -type SendMessageResp struct { +type ConfirmLastMsgIDResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Response *response.BaseResponse `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` - // MsgSeq is unique seq of a message - SessionId int64 `protobuf:"varint,2,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` - MsgSeq string `protobuf:"bytes,3,opt,name=msg_seq,json=msgSeq,proto3" json:"msg_seq,omitempty"` + 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 *SendMessageResp) Reset() { - *x = SendMessageResp{} +func (x *ConfirmLastMsgIDResp) Reset() { + *x = ConfirmLastMsgIDResp{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[1] + mi := &file_message_v1_message_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *SendMessageResp) String() string { +func (x *ConfirmLastMsgIDResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*SendMessageResp) ProtoMessage() {} +func (*ConfirmLastMsgIDResp) ProtoMessage() {} -func (x *SendMessageResp) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[1] +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 { @@ -240,63 +710,58 @@ func (x *SendMessageResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use SendMessageResp.ProtoReflect.Descriptor instead. -func (*SendMessageResp) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{1} +// Deprecated: Use ConfirmLastMsgIDResp.ProtoReflect.Descriptor instead. +func (*ConfirmLastMsgIDResp) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{7} } -func (x *SendMessageResp) GetResponse() *response.BaseResponse { +func (x *ConfirmLastMsgIDResp) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } -func (x *SendMessageResp) GetSessionId() int64 { +func (x *ConfirmLastMsgIDResp) GetLastMsgId() int64 { if x != nil { - return x.SessionId + return x.LastMsgId } return 0 } -func (x *SendMessageResp) GetMsgSeq() string { - if x != nil { - return x.MsgSeq - } - return "" -} - -// MqMessage is message protocol when pub/sub msg to mq -type MqMessage struct { +// storage message +type StorageMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FromUser string `protobuf:"bytes,1,opt,name=from_user,json=fromUser,proto3" json:"from_user,omitempty"` - ToUser string `protobuf:"bytes,2,opt,name=to_user,json=toUser,proto3" json:"to_user,omitempty"` - PushMessageType PushMessageType `protobuf:"varint,3,opt,name=push_message_type,json=pushMessageType,proto3,enum=api.message.v1.PushMessageType" json:"push_message_type,omitempty"` - ContentType MessageContentType `protobuf:"varint,4,opt,name=content_type,json=contentType,proto3,enum=api.message.v1.MessageContentType" json:"content_type,omitempty"` - Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` - SessionId int64 `protobuf:"varint,6,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + 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 *MqMessage) Reset() { - *x = MqMessage{} +func (x *StorageMessage) Reset() { + *x = StorageMessage{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[2] + mi := &file_message_v1_message_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *MqMessage) String() string { +func (x *StorageMessage) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MqMessage) ProtoMessage() {} +func (*StorageMessage) ProtoMessage() {} -func (x *MqMessage) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[2] +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 { @@ -307,85 +772,96 @@ func (x *MqMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use MqMessage.ProtoReflect.Descriptor instead. -func (*MqMessage) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{2} +// Deprecated: Use StorageMessage.ProtoReflect.Descriptor instead. +func (*StorageMessage) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{8} } -func (x *MqMessage) GetFromUser() string { +func (x *StorageMessage) GetMsgID() int64 { if x != nil { - return x.FromUser + return x.MsgID } - return "" + return 0 } -func (x *MqMessage) GetToUser() string { +func (x *StorageMessage) GetSessionID() string { if x != nil { - return x.ToUser + return x.SessionID } return "" } -func (x *MqMessage) GetPushMessageType() PushMessageType { +func (x *StorageMessage) GetSessionType() SessionType { if x != nil { - return x.PushMessageType + return x.SessionType } - return PushMessageType_UnknownUserType + return SessionType_SingleChat } -func (x *MqMessage) GetContentType() MessageContentType { +func (x *StorageMessage) GetFromID() int64 { if x != nil { - return x.ContentType + return x.FromID + } + return 0 +} + +func (x *StorageMessage) GetToID() int64 { + if x != nil { + return x.ToID } - return MessageContentType_UnknownContentType + return 0 } -func (x *MqMessage) GetContent() string { +func (x *StorageMessage) GetContent() *StorageMessage_Content { if x != nil { return x.Content } - return "" + return nil } -func (x *MqMessage) GetSessionId() int64 { +func (x *StorageMessage) GetCreateTime() *timestamppb.Timestamp { if x != nil { - return x.SessionId + return x.CreateTime } - return 0 + return nil } -// PushMessage use for push a message to persistence connection server -type PushMessageReq struct { +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 - FromUser string `protobuf:"bytes,1,opt,name=from_user,json=fromUser,proto3" json:"from_user,omitempty"` - ToUser string `protobuf:"bytes,2,opt,name=to_user,json=toUser,proto3" json:"to_user,omitempty"` - PushMessageType PushMessageType `protobuf:"varint,3,opt,name=push_message_type,json=pushMessageType,proto3,enum=api.message.v1.PushMessageType" json:"push_message_type,omitempty"` - ContentType MessageContentType `protobuf:"varint,4,opt,name=content_type,json=contentType,proto3,enum=api.message.v1.MessageContentType" json:"content_type,omitempty"` - Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` - MsgSeq string `protobuf:"bytes,6,opt,name=msg_seq,json=msgSeq,proto3" json:"msg_seq,omitempty"` - SessionId int64 `protobuf:"varint,7,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` + 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 *PushMessageReq) Reset() { - *x = PushMessageReq{} +func (x *QuerySessionHistoryMessageReq) Reset() { + *x = QuerySessionHistoryMessageReq{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[3] + mi := &file_message_v1_message_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *PushMessageReq) String() string { +func (x *QuerySessionHistoryMessageReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PushMessageReq) ProtoMessage() {} +func (*QuerySessionHistoryMessageReq) ProtoMessage() {} -func (x *PushMessageReq) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[3] +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 { @@ -396,91 +872,73 @@ func (x *PushMessageReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PushMessageReq.ProtoReflect.Descriptor instead. -func (*PushMessageReq) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{3} +// Deprecated: Use QuerySessionHistoryMessageReq.ProtoReflect.Descriptor instead. +func (*QuerySessionHistoryMessageReq) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{9} } -func (x *PushMessageReq) GetFromUser() string { +func (x *QuerySessionHistoryMessageReq) GetUid() int64 { if x != nil { - return x.FromUser + return x.Uid } - return "" + return 0 } -func (x *PushMessageReq) GetToUser() string { +func (x *QuerySessionHistoryMessageReq) GetSessionId() string { if x != nil { - return x.ToUser + return x.SessionId } return "" } -func (x *PushMessageReq) GetPushMessageType() PushMessageType { - if x != nil { - return x.PushMessageType - } - return PushMessageType_UnknownUserType -} - -func (x *PushMessageReq) GetContentType() MessageContentType { - if x != nil { - return x.ContentType - } - return MessageContentType_UnknownContentType -} - -func (x *PushMessageReq) GetContent() string { +func (x *QuerySessionHistoryMessageReq) GetLastMsgId() int64 { if x != nil { - return x.Content + return x.LastMsgId } - return "" + return 0 } -func (x *PushMessageReq) GetMsgSeq() string { +func (x *QuerySessionHistoryMessageReq) GetPage() int32 { if x != nil { - return x.MsgSeq + return x.Page } - return "" + return 0 } -func (x *PushMessageReq) GetSessionId() int64 { +func (x *QuerySessionHistoryMessageReq) GetPageSize() int32 { if x != nil { - return x.SessionId + return x.PageSize } return 0 } -// BriefMessage is message with basic information -type BriefMessage struct { +type QuerySessionHistoryMessageResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FromUser string `protobuf:"bytes,1,opt,name=from_user,json=fromUser,proto3" json:"from_user,omitempty"` - ToUser string `protobuf:"bytes,2,opt,name=to_user,json=toUser,proto3" json:"to_user,omitempty"` - ContentType MessageContentType `protobuf:"varint,3,opt,name=content_type,json=contentType,proto3,enum=api.message.v1.MessageContentType" json:"content_type,omitempty"` - Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` - MsgSeq string `protobuf:"bytes,5,opt,name=msg_seq,json=msgSeq,proto3" json:"msg_seq,omitempty"` - SessionId int64 `protobuf:"varint,6,opt,name=session_id,json=sessionId,proto3" json:"session_id,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 *BriefMessage) Reset() { - *x = BriefMessage{} +func (x *QuerySessionHistoryMessageResp) Reset() { + *x = QuerySessionHistoryMessageResp{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[4] + mi := &file_message_v1_message_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *BriefMessage) String() string { +func (x *QuerySessionHistoryMessageResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*BriefMessage) ProtoMessage() {} +func (*QuerySessionHistoryMessageResp) ProtoMessage() {} -func (x *BriefMessage) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[4] +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 { @@ -491,82 +949,60 @@ func (x *BriefMessage) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use BriefMessage.ProtoReflect.Descriptor instead. -func (*BriefMessage) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{4} -} - -func (x *BriefMessage) GetFromUser() string { - if x != nil { - return x.FromUser - } - return "" -} - -func (x *BriefMessage) GetToUser() string { - if x != nil { - return x.ToUser - } - return "" -} - -func (x *BriefMessage) GetContentType() MessageContentType { - if x != nil { - return x.ContentType - } - return MessageContentType_UnknownContentType +// Deprecated: Use QuerySessionHistoryMessageResp.ProtoReflect.Descriptor instead. +func (*QuerySessionHistoryMessageResp) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{10} } -func (x *BriefMessage) GetContent() string { +func (x *QuerySessionHistoryMessageResp) GetError() *errors.Error { if x != nil { - return x.Content + return x.Error } - return "" + return nil } -func (x *BriefMessage) GetMsgSeq() string { +func (x *QuerySessionHistoryMessageResp) GetTotal() int32 { if x != nil { - return x.MsgSeq + return x.Total } - return "" + return 0 } -func (x *BriefMessage) GetSessionId() int64 { +func (x *QuerySessionHistoryMessageResp) GetMessages() []*Message { if x != nil { - return x.SessionId + return x.Messages } - return 0 + return nil } -type QueryOfflineMessageReq struct { +type SyncHistoryMessageReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - LastMsgSeq string `protobuf:"bytes,2,opt,name=last_msg_seq,json=lastMsgSeq,proto3" json:"last_msg_seq,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"` + 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 *QueryOfflineMessageReq) Reset() { - *x = QueryOfflineMessageReq{} +func (x *SyncHistoryMessageReq) Reset() { + *x = SyncHistoryMessageReq{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[5] + mi := &file_message_v1_message_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryOfflineMessageReq) String() string { +func (x *SyncHistoryMessageReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryOfflineMessageReq) ProtoMessage() {} +func (*SyncHistoryMessageReq) ProtoMessage() {} -func (x *QueryOfflineMessageReq) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[5] +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 { @@ -577,73 +1013,66 @@ func (x *QueryOfflineMessageReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use QueryOfflineMessageReq.ProtoReflect.Descriptor instead. -func (*QueryOfflineMessageReq) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{5} -} - -func (x *QueryOfflineMessageReq) GetUserId() string { - if x != nil { - return x.UserId - } - return "" +// Deprecated: Use SyncHistoryMessageReq.ProtoReflect.Descriptor instead. +func (*SyncHistoryMessageReq) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{11} } -func (x *QueryOfflineMessageReq) GetLastMsgSeq() string { +func (x *SyncHistoryMessageReq) GetUid() int64 { if x != nil { - return x.LastMsgSeq + return x.Uid } - return "" + return 0 } -func (x *QueryOfflineMessageReq) GetOnlyCount() bool { +func (x *SyncHistoryMessageReq) GetLastMsgId() int64 { if x != nil { - return x.OnlyCount + return x.LastMsgId } - return false + return 0 } -func (x *QueryOfflineMessageReq) GetPage() int32 { +func (x *SyncHistoryMessageReq) GetPage() int32 { if x != nil { return x.Page } return 0 } -func (x *QueryOfflineMessageReq) GetPageSize() int32 { +func (x *SyncHistoryMessageReq) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -type QueryOfflineMessageResp struct { +type SyncHistoryMessageResp struct { state protoimpl.MessageState 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 []*BriefMessage `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{} +func (x *SyncHistoryMessageResp) Reset() { + *x = SyncHistoryMessageResp{} if protoimpl.UnsafeEnabled { - mi := &file_message_v1_message_proto_msgTypes[6] + mi := &file_message_v1_message_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *QueryOfflineMessageResp) String() string { +func (x *SyncHistoryMessageResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*QueryOfflineMessageResp) ProtoMessage() {} +func (*SyncHistoryMessageResp) ProtoMessage() {} -func (x *QueryOfflineMessageResp) ProtoReflect() protoreflect.Message { - mi := &file_message_v1_message_proto_msgTypes[6] +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 { @@ -654,174 +1083,299 @@ func (x *QueryOfflineMessageResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use QueryOfflineMessageResp.ProtoReflect.Descriptor instead. -func (*QueryOfflineMessageResp) Descriptor() ([]byte, []int) { - return file_message_v1_message_proto_rawDescGZIP(), []int{6} +// Deprecated: Use SyncHistoryMessageResp.ProtoReflect.Descriptor instead. +func (*SyncHistoryMessageResp) Descriptor() ([]byte, []int) { + return file_message_v1_message_proto_rawDescGZIP(), []int{12} } -func (x *QueryOfflineMessageResp) GetResponse() *response.BaseResponse { +func (x *SyncHistoryMessageResp) GetError() *errors.Error { if x != nil { - return x.Response + return x.Error } return nil } -func (x *QueryOfflineMessageResp) GetTotal() int32 { +func (x *SyncHistoryMessageResp) GetTotal() int32 { if x != nil { return x.Total } return 0 } -func (x *QueryOfflineMessageResp) GetMessages() []*BriefMessage { +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, 0x17, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 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, 0x22, 0xcf, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x09, 0x66, 0x72, 0x6f, - 0x6d, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x72, 0x02, 0x10, 0x14, 0x52, 0x08, 0x66, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x20, 0x0a, 0x07, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x14, 0x52, 0x06, 0x74, 0x6f, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x4f, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, + 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, - 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, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x08, 0x52, - 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x8b, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x6e, - 0x64, 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, 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, 0x17, 0x0a, - 0x07, 0x6d, 0x73, 0x67, 0x5f, 0x73, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x6d, 0x73, 0x67, 0x53, 0x65, 0x71, 0x22, 0x8e, 0x02, 0x0a, 0x09, 0x4d, 0x71, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x74, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x12, 0x4b, 0x0a, 0x11, 0x70, 0x75, - 0x73, 0x68, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 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, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0f, 0x70, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 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, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, - 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xac, 0x02, 0x0a, 0x0e, 0x50, 0x75, 0x73, 0x68, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x72, - 0x6f, 0x6d, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, - 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x6f, 0x5f, 0x75, 0x73, - 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x6f, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x4b, 0x0a, 0x11, 0x70, 0x75, 0x73, 0x68, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x61, 0x70, + 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, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0f, 0x70, 0x75, - 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x45, 0x0a, - 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 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, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x17, - 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x5f, 0x73, 0x65, 0x71, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6d, 0x73, 0x67, 0x53, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xdd, 0x01, 0x0a, 0x0c, 0x42, 0x72, 0x69, 0x65, 0x66, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x72, 0x6f, 0x6d, 0x5f, - 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x6f, 0x6d, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x6f, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x74, 0x6f, 0x55, 0x73, 0x65, 0x72, 0x12, 0x45, 0x0a, - 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 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, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x17, - 0x0a, 0x07, 0x6d, 0x73, 0x67, 0x5f, 0x73, 0x65, 0x71, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6d, 0x73, 0x67, 0x53, 0x65, 0x71, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xbf, 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, 0x29, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x73, 0x67, 0x5f, - 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, - 0x10, 0x0a, 0x52, 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x73, 0x67, 0x53, 0x65, 0x71, 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, 0xab, 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, 0x38, 0x0a, 0x08, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x42, 0x72, 0x69, 0x65, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2a, 0x4c, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x12, - 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x65, 0x78, 0x74, 0x10, 0x01, 0x12, 0x09, - 0x0a, 0x05, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x6f, 0x69, - 0x63, 0x65, 0x10, 0x03, 0x2a, 0x4a, 0x0a, 0x0f, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, - 0x77, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, - 0x55, 0x73, 0x65, 0x72, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x10, - 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x10, 0x03, - 0x32, 0xac, 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x72, 0x12, 0x4e, 0x0a, 0x0b, 0x53, 0x65, 0x6e, 0x64, 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, 0x53, 0x65, 0x6e, 0x64, 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, 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x4c, 0x0a, 0x09, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x12, 0x1e, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x65, 0x6e, 0x64, 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, - 0x53, 0x65, 0x6e, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x32, - 0x63, 0x0a, 0x0c, 0x50, 0x75, 0x73, 0x68, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x72, 0x12, - 0x53, 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, 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, 0x32, 0x78, 0x0a, 0x0e, 0x4f, 0x66, 0x66, 0x6c, 0x69, 0x6e, 0x65, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x66, 0x0a, 0x13, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4f, + 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, 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, + 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 ( @@ -836,43 +1390,63 @@ func file_message_v1_message_proto_rawDescGZIP() []byte { return file_message_v1_message_proto_rawDescData } -var file_message_v1_message_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_message_v1_message_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +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 - (PushMessageType)(0), // 1: api.message.v1.PushMessageType - (*SendMessageReq)(nil), // 2: api.message.v1.SendMessageReq - (*SendMessageResp)(nil), // 3: api.message.v1.SendMessageResp - (*MqMessage)(nil), // 4: api.message.v1.MqMessage - (*PushMessageReq)(nil), // 5: api.message.v1.PushMessageReq - (*BriefMessage)(nil), // 6: api.message.v1.BriefMessage - (*QueryOfflineMessageReq)(nil), // 7: api.message.v1.QueryOfflineMessageReq - (*QueryOfflineMessageResp)(nil), // 8: api.message.v1.QueryOfflineMessageResp - (*response.BaseResponse)(nil), // 9: api.transport.response.BaseResponse + (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{ - 0, // 0: api.message.v1.SendMessageReq.content_type:type_name -> api.message.v1.MessageContentType - 9, // 1: api.message.v1.SendMessageResp.response:type_name -> api.transport.response.BaseResponse - 1, // 2: api.message.v1.MqMessage.push_message_type:type_name -> api.message.v1.PushMessageType - 0, // 3: api.message.v1.MqMessage.content_type:type_name -> api.message.v1.MessageContentType - 1, // 4: api.message.v1.PushMessageReq.push_message_type:type_name -> api.message.v1.PushMessageType - 0, // 5: api.message.v1.PushMessageReq.content_type:type_name -> api.message.v1.MessageContentType - 0, // 6: api.message.v1.BriefMessage.content_type:type_name -> api.message.v1.MessageContentType - 9, // 7: api.message.v1.QueryOfflineMessageResp.response:type_name -> api.transport.response.BaseResponse - 6, // 8: api.message.v1.QueryOfflineMessageResp.messages:type_name -> api.message.v1.BriefMessage - 2, // 9: api.message.v1.SendMessager.SendMessage:input_type -> api.message.v1.SendMessageReq - 2, // 10: api.message.v1.SendMessager.Broadcast:input_type -> api.message.v1.SendMessageReq - 5, // 11: api.message.v1.PushMessager.PushMessage:input_type -> api.message.v1.PushMessageReq - 7, // 12: api.message.v1.OfflineMessage.QueryOfflineMessage:input_type -> api.message.v1.QueryOfflineMessageReq - 3, // 13: api.message.v1.SendMessager.SendMessage:output_type -> api.message.v1.SendMessageResp - 3, // 14: api.message.v1.SendMessager.Broadcast:output_type -> api.message.v1.SendMessageResp - 9, // 15: api.message.v1.PushMessager.PushMessage:output_type -> api.transport.response.BaseResponse - 8, // 16: api.message.v1.OfflineMessage.QueryOfflineMessage:output_type -> api.message.v1.QueryOfflineMessageResp - 13, // [13:17] is the sub-list for method output_type - 9, // [9:13] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 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() } @@ -894,7 +1468,7 @@ func file_message_v1_message_proto_init() { } } file_message_v1_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendMessageResp); i { + switch v := v.(*Message); i { case 0: return &v.state case 1: @@ -906,7 +1480,7 @@ func file_message_v1_message_proto_init() { } } file_message_v1_message_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MqMessage); i { + switch v := v.(*PushMessageReq); i { case 0: return &v.state case 1: @@ -918,7 +1492,7 @@ func file_message_v1_message_proto_init() { } } file_message_v1_message_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushMessageReq); i { + switch v := v.(*PushMessageResp); i { case 0: return &v.state case 1: @@ -930,7 +1504,7 @@ func file_message_v1_message_proto_init() { } } file_message_v1_message_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BriefMessage); i { + switch v := v.(*QueryOfflineMessageReq); i { case 0: return &v.state case 1: @@ -942,7 +1516,7 @@ func file_message_v1_message_proto_init() { } } file_message_v1_message_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryOfflineMessageReq); i { + switch v := v.(*QueryOfflineMessageResp); i { case 0: return &v.state case 1: @@ -954,7 +1528,91 @@ func file_message_v1_message_proto_init() { } } file_message_v1_message_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueryOfflineMessageResp); i { + 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: @@ -966,13 +1624,14 @@ func file_message_v1_message_proto_init() { } } } + file_message_v1_message_proto_msgTypes[0].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_message_v1_message_proto_rawDesc, - NumEnums: 2, - NumMessages: 7, + NumEnums: 3, + NumMessages: 14, NumExtensions: 0, NumServices: 3, }, diff --git a/message/v1/message.pb.validate.go b/message/v1/message.pb.validate.go index 54b090f..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.GetFromUser()) < 20 { + if m.GetFrom() <= 0 { err := SendMessageReqValidationError{ - field: "FromUser", - reason: "value length must be at least 20 runes", + field: "From", + 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.GetToUser()) < 20 { + if m.GetTo() <= 0 { err := SendMessageReqValidationError{ - field: "ToUser", - reason: "value length must be at least 20 runes", + field: "To", + reason: "value must be greater than 0", } if !all { return err @@ -79,6 +79,8 @@ func (m *SendMessageReq) validate(all bool) error { errors = append(errors, err) } + // no validation rules for SessionType + if _, ok := MessageContentType_name[int32(m.GetContentType())]; !ok { err := SendMessageReqValidationError{ field: "ContentType", @@ -90,10 +92,10 @@ func (m *SendMessageReq) validate(all bool) error { errors = append(errors, err) } - if l := utf8.RuneCountInString(m.GetContent()); l < 1 || l > 1024 { + if l := utf8.RuneCountInString(m.GetContent()); l < 1 || l > 4096 { err := SendMessageReqValidationError{ field: "Content", - reason: "value length must be between 1 and 1024 runes, inclusive", + reason: "value length must be between 1 and 4096 runes, inclusive", } if !all { return err @@ -101,6 +103,10 @@ func (m *SendMessageReq) validate(all bool) error { errors = append(errors, err) } + if m.SessionId != nil { + // no validation rules for SessionId + } + if len(errors) > 0 { return SendMessageReqMultiError(errors) } @@ -179,186 +185,56 @@ 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 - - if all { - switch v := interface{}(m.GetResponse()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, SendMessageRespValidationError{ - field: "Response", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, SendMessageRespValidationError{ - 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 SendMessageRespValidationError{ - field: "Response", - reason: "embedded message failed validation", - cause: err, - } - } - } - - // no validation rules for SessionId - - // no validation rules for MsgSeq - - 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 MqMessage with the rules defined in the +// 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. -func (m *MqMessage) Validate() error { +func (m *Message) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on MqMessage 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 MqMessageMultiError, or nil -// if none found. -func (m *MqMessage) ValidateAll() error { +// ValidateAll checks the field values on Message 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 MessageMultiError, or nil if none found. +func (m *Message) ValidateAll() error { return m.validate(true) } -func (m *MqMessage) validate(all bool) error { +func (m *Message) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for FromUser + // no validation rules for MsgId + + // no validation rules for From - // no validation rules for ToUser + // no validation rules for To - // no validation rules for PushMessageType + // no validation rules for SessionType + + // no validation rules for SessionId // no validation rules for ContentType // no validation rules for Content - // no validation rules for SessionId + // no validation rules for CreateTime if len(errors) > 0 { - return MqMessageMultiError(errors) + return MessageMultiError(errors) } return nil } -// MqMessageMultiError is an error wrapping multiple validation errors returned -// by MqMessage.ValidateAll() if the designated constraints aren't met. -type MqMessageMultiError []error +// MessageMultiError is an error wrapping multiple validation errors returned +// by Message.ValidateAll() if the designated constraints aren't met. +type MessageMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m MqMessageMultiError) Error() string { +func (m MessageMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -367,11 +243,11 @@ func (m MqMessageMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m MqMessageMultiError) AllErrors() []error { return m } +func (m MessageMultiError) AllErrors() []error { return m } -// MqMessageValidationError is the validation error returned by -// MqMessage.Validate if the designated constraints aren't met. -type MqMessageValidationError struct { +// MessageValidationError is the validation error returned by Message.Validate +// if the designated constraints aren't met. +type MessageValidationError struct { field string reason string cause error @@ -379,22 +255,22 @@ type MqMessageValidationError struct { } // Field function returns field value. -func (e MqMessageValidationError) Field() string { return e.field } +func (e MessageValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e MqMessageValidationError) Reason() string { return e.reason } +func (e MessageValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e MqMessageValidationError) Cause() error { return e.cause } +func (e MessageValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e MqMessageValidationError) Key() bool { return e.key } +func (e MessageValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e MqMessageValidationError) ErrorName() string { return "MqMessageValidationError" } +func (e MessageValidationError) ErrorName() string { return "MessageValidationError" } // Error satisfies the builtin error interface -func (e MqMessageValidationError) Error() string { +func (e MessageValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -406,14 +282,14 @@ func (e MqMessageValidationError) Error() string { } return fmt.Sprintf( - "invalid %sMqMessage.%s: %s%s", + "invalid %sMessage.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = MqMessageValidationError{} +var _ error = MessageValidationError{} var _ interface { Field() string @@ -421,7 +297,7 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = MqMessageValidationError{} +} = MessageValidationError{} // Validate checks the field values on PushMessageReq with the rules defined in // the proto definition for this message. If any rules are violated, the first @@ -445,19 +321,34 @@ func (m *PushMessageReq) validate(all bool) error { var errors []error - // no validation rules for FromUser - - // no validation rules for ToUser - - // no validation rules for PushMessageType - - // no validation rules for ContentType - - // no validation rules for Content - - // no validation rules for MsgSeq - - // no validation rules for SessionId + if all { + switch v := interface{}(m.GetMessage()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, PushMessageReqValidationError{ + field: "Message", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, PushMessageReqValidationError{ + field: "Message", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetMessage()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return PushMessageReqValidationError{ + field: "Message", + reason: "embedded message failed validation", + cause: err, + } + } + } if len(errors) > 0 { return PushMessageReqMultiError(errors) @@ -537,53 +428,71 @@ var _ interface { ErrorName() string } = PushMessageReqValidationError{} -// Validate checks the field values on BriefMessage 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 *BriefMessage) Validate() error { +// Validate checks the field values on PushMessageResp 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 *PushMessageResp) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on BriefMessage 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 BriefMessageMultiError, or -// nil if none found. -func (m *BriefMessage) ValidateAll() error { +// ValidateAll checks the field values on PushMessageResp 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 +// PushMessageRespMultiError, or nil if none found. +func (m *PushMessageResp) ValidateAll() error { return m.validate(true) } -func (m *BriefMessage) validate(all bool) error { +func (m *PushMessageResp) validate(all bool) error { if m == nil { return nil } var errors []error - // no validation rules for FromUser - - // no validation rules for ToUser - - // no validation rules for ContentType - - // no validation rules for Content - - // no validation rules for MsgSeq - - // no validation rules for SessionId + if all { + switch v := interface{}(m.GetError()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, PushMessageRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, PushMessageRespValidationError{ + 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 PushMessageRespValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + } + } + } if len(errors) > 0 { - return BriefMessageMultiError(errors) + return PushMessageRespMultiError(errors) } return nil } -// BriefMessageMultiError is an error wrapping multiple validation errors -// returned by BriefMessage.ValidateAll() if the designated constraints aren't met. -type BriefMessageMultiError []error +// PushMessageRespMultiError is an error wrapping multiple validation errors +// returned by PushMessageResp.ValidateAll() if the designated constraints +// aren't met. +type PushMessageRespMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m BriefMessageMultiError) Error() string { +func (m PushMessageRespMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -592,11 +501,11 @@ func (m BriefMessageMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m BriefMessageMultiError) AllErrors() []error { return m } +func (m PushMessageRespMultiError) AllErrors() []error { return m } -// BriefMessageValidationError is the validation error returned by -// BriefMessage.Validate if the designated constraints aren't met. -type BriefMessageValidationError struct { +// PushMessageRespValidationError is the validation error returned by +// PushMessageResp.Validate if the designated constraints aren't met. +type PushMessageRespValidationError struct { field string reason string cause error @@ -604,22 +513,22 @@ type BriefMessageValidationError struct { } // Field function returns field value. -func (e BriefMessageValidationError) Field() string { return e.field } +func (e PushMessageRespValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e BriefMessageValidationError) Reason() string { return e.reason } +func (e PushMessageRespValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e BriefMessageValidationError) Cause() error { return e.cause } +func (e PushMessageRespValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e BriefMessageValidationError) Key() bool { return e.key } +func (e PushMessageRespValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e BriefMessageValidationError) ErrorName() string { return "BriefMessageValidationError" } +func (e PushMessageRespValidationError) ErrorName() string { return "PushMessageRespValidationError" } // Error satisfies the builtin error interface -func (e BriefMessageValidationError) Error() string { +func (e PushMessageRespValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -631,14 +540,14 @@ func (e BriefMessageValidationError) Error() string { } return fmt.Sprintf( - "invalid %sBriefMessage.%s: %s%s", + "invalid %sPushMessageResp.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = BriefMessageValidationError{} +var _ error = PushMessageRespValidationError{} var _ interface { Field() string @@ -646,7 +555,7 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = BriefMessageValidationError{} +} = PushMessageRespValidationError{} // Validate checks the field values on QueryOfflineMessageReq with the rules // defined in the proto definition for this message. If any rules are @@ -670,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 @@ -681,10 +590,10 @@ func (m *QueryOfflineMessageReq) validate(all bool) error { errors = append(errors, err) } - if utf8.RuneCountInString(m.GetLastMsgSeq()) < 10 { + if m.GetLastMsgId() <= 0 { err := QueryOfflineMessageReqValidationError{ - field: "LastMsgSeq", - reason: "value length must be at least 10 runes", + field: "LastMsgId", + reason: "value must be greater than 0", } if !all { return err @@ -810,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, }) @@ -822,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, } @@ -953,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 597a118..9294b61 100644 --- a/message/v1/message.proto +++ b/message/v1/message.proto @@ -1,102 +1,162 @@ syntax = "proto3"; package api.message.v1; -option go_package = "github.com/go-goim/api/message/v1"; +import "google/protobuf/timestamp.proto"; +import "errors/errors.proto"; import "validate/validate.proto"; -import "transport/response/response.proto"; +option go_package = "github.com/go-goim/api/message/v1"; enum MessageContentType { - UnknownContentType = 0; - Text = 1; - Image = 2; - Voice = 3; -} - -// SendMessageReq receive data from gateway -message SendMessageReq { - string from_user = 1 [(validate.rules).string.min_len = 20]; - string to_user = 2 [(validate.rules).string.min_len = 20]; - MessageContentType content_type = 3 [(validate.rules).enum.defined_only = true]; - string content = 4 [(validate.rules).string = {min_len: 1, max_len: 1024}]; + Text = 0; + Image = 1; + Voice = 2; } -// SendMessageResp is response body for sendMessage -message SendMessageResp { - transport.response.BaseResponse response = 1; - // MsgSeq is unique seq of a message - int64 session_id = 2; - string msg_seq = 3; +// 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 } -// SendMessager provide send message service -service SendMessager { - // SendMessage send message to one or multi users/channels - rpc SendMessage(SendMessageReq) returns (SendMessageResp); - // Broadcast send message to all online user - rpc Broadcast(SendMessageReq) returns (SendMessageResp); +enum MessageStatus { + Normal = 0; + Deleted = 1; } -enum PushMessageType { - UnknownUserType = 0; - // user to user - User = 1; - // user to group - Group = 2; - // global broadcast - Broadcast = 3; +// SendMessageReq receive data from gateway +message SendMessageReq { + 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 = { + min_len: 1, + max_len: 4096 + }]; } -// MqMessage is message protocol when pub/sub msg to mq -message MqMessage { - string from_user = 1; - string to_user = 2; - PushMessageType push_message_type = 3; - MessageContentType content_type = 4; - string content = 5; - int64 session_id = 6; +// Message is definition of message +message Message { + int64 msg_id = 1; + 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; } // PushMessage use for push a message to persistence connection server message PushMessageReq { - string from_user = 1; - string to_user = 2; - PushMessageType push_message_type = 3; - MessageContentType content_type = 4; - string content = 5; - string msg_seq = 6; - int64 session_id = 7; + Message message = 1; + // ToUsers is a list of user id who receive this message + repeated int64 to_users = 2; } -service PushMessager { - rpc PushMessage(PushMessageReq) returns (transport.response.BaseResponse); +message PushMessageResp { + errors.Error error = 1; + repeated int64 failed_users = 2; } -// BriefMessage is message with basic information -message BriefMessage { - string from_user = 1; - string to_user = 2; - MessageContentType content_type = 3; - string content = 4; - string msg_seq = 5; - int64 session_id = 6; +service PushMessageService { + rpc PushMessage(PushMessageReq) returns (PushMessageResp); } message QueryOfflineMessageReq { - string user_id = 1 [(validate.rules).string.min_len = 20]; - string last_msg_seq = 2 [(validate.rules).string.min_len = 10]; - bool onlyCount = 3; + int64 uid = 1 [(validate.rules).int64.gt = 0]; + int64 last_msg_id = 2 [(validate.rules).int64.gt = 0]; + bool onlyCount = 3; int32 page = 4; - int32 page_size = 5 [(validate.rules).int32 = {gte: 1, lte: 100}]; + int32 page_size = 5 [(validate.rules).int32 = { + gte: 1, + lte: 100 + }]; } message QueryOfflineMessageResp { - transport.response.BaseResponse response = 1; + errors.Error error = 1; int32 total = 2; - repeated BriefMessage messages = 3; + repeated Message messages = 3; } -service OfflineMessage { +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 55a1807..9bbf2f9 100644 --- a/message/v1/message_grpc.pb.go +++ b/message/v1/message_grpc.pb.go @@ -1,10 +1,13 @@ // 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 import ( context "context" - response "github.com/go-goim/api/transport/response" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -15,298 +18,344 @@ import ( // Requires gRPC-Go v1.32.0 or later. const _ = grpc.SupportPackageIsVersion7 -// SendMessagerClient is the client API for SendMessager service. +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. -type SendMessagerClient interface { - // SendMessage send message to one or multi users/channels - SendMessage(ctx context.Context, in *SendMessageReq, opts ...grpc.CallOption) (*SendMessageResp, error) - // Broadcast send message to all online user - Broadcast(ctx context.Context, in *SendMessageReq, opts ...grpc.CallOption) (*SendMessageResp, error) +type PushMessageServiceClient interface { + PushMessage(ctx context.Context, in *PushMessageReq, opts ...grpc.CallOption) (*PushMessageResp, error) } -type sendMessagerClient struct { +type pushMessageServiceClient struct { cc grpc.ClientConnInterface } -func NewSendMessagerClient(cc grpc.ClientConnInterface) SendMessagerClient { - return &sendMessagerClient{cc} -} - -func (c *sendMessagerClient) SendMessage(ctx context.Context, in *SendMessageReq, opts ...grpc.CallOption) (*SendMessageResp, error) { - out := new(SendMessageResp) - err := c.cc.Invoke(ctx, "/api.message.v1.SendMessager/SendMessage", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func NewPushMessageServiceClient(cc grpc.ClientConnInterface) PushMessageServiceClient { + return &pushMessageServiceClient{cc} } -func (c *sendMessagerClient) Broadcast(ctx context.Context, in *SendMessageReq, opts ...grpc.CallOption) (*SendMessageResp, error) { - out := new(SendMessageResp) - err := c.cc.Invoke(ctx, "/api.message.v1.SendMessager/Broadcast", in, out, opts...) +func (c *pushMessageServiceClient) PushMessage(ctx context.Context, in *PushMessageReq, opts ...grpc.CallOption) (*PushMessageResp, error) { + out := new(PushMessageResp) + err := c.cc.Invoke(ctx, PushMessageService_PushMessage_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -// SendMessagerServer is the server API for SendMessager service. -// All implementations must embed UnimplementedSendMessagerServer +// PushMessageServiceServer is the server API for PushMessageService service. +// All implementations must embed UnimplementedPushMessageServiceServer // for forward compatibility -type SendMessagerServer interface { - // SendMessage send message to one or multi users/channels - SendMessage(context.Context, *SendMessageReq) (*SendMessageResp, error) - // Broadcast send message to all online user - Broadcast(context.Context, *SendMessageReq) (*SendMessageResp, error) - mustEmbedUnimplementedSendMessagerServer() +type PushMessageServiceServer interface { + PushMessage(context.Context, *PushMessageReq) (*PushMessageResp, error) + mustEmbedUnimplementedPushMessageServiceServer() } -// UnimplementedSendMessagerServer must be embedded to have forward compatible implementations. -type UnimplementedSendMessagerServer struct { +// UnimplementedPushMessageServiceServer must be embedded to have forward compatible implementations. +type UnimplementedPushMessageServiceServer struct { } -func (UnimplementedSendMessagerServer) SendMessage(context.Context, *SendMessageReq) (*SendMessageResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method SendMessage not implemented") -} -func (UnimplementedSendMessagerServer) Broadcast(context.Context, *SendMessageReq) (*SendMessageResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method Broadcast not implemented") +func (UnimplementedPushMessageServiceServer) PushMessage(context.Context, *PushMessageReq) (*PushMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method PushMessage not implemented") } -func (UnimplementedSendMessagerServer) mustEmbedUnimplementedSendMessagerServer() {} +func (UnimplementedPushMessageServiceServer) mustEmbedUnimplementedPushMessageServiceServer() {} -// UnsafeSendMessagerServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to SendMessagerServer will +// UnsafePushMessageServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to PushMessageServiceServer will // result in compilation errors. -type UnsafeSendMessagerServer interface { - mustEmbedUnimplementedSendMessagerServer() -} - -func RegisterSendMessagerServer(s grpc.ServiceRegistrar, srv SendMessagerServer) { - s.RegisterService(&SendMessager_ServiceDesc, srv) +type UnsafePushMessageServiceServer interface { + mustEmbedUnimplementedPushMessageServiceServer() } -func _SendMessager_SendMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendMessageReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SendMessagerServer).SendMessage(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/api.message.v1.SendMessager/SendMessage", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SendMessagerServer).SendMessage(ctx, req.(*SendMessageReq)) - } - return interceptor(ctx, in, info, handler) +func RegisterPushMessageServiceServer(s grpc.ServiceRegistrar, srv PushMessageServiceServer) { + s.RegisterService(&PushMessageService_ServiceDesc, srv) } -func _SendMessager_Broadcast_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SendMessageReq) +func _PushMessageService_PushMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PushMessageReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(SendMessagerServer).Broadcast(ctx, in) + return srv.(PushMessageServiceServer).PushMessage(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.message.v1.SendMessager/Broadcast", + FullMethod: PushMessageService_PushMessage_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SendMessagerServer).Broadcast(ctx, req.(*SendMessageReq)) + return srv.(PushMessageServiceServer).PushMessage(ctx, req.(*PushMessageReq)) } return interceptor(ctx, in, info, handler) } -// SendMessager_ServiceDesc is the grpc.ServiceDesc for SendMessager service. +// PushMessageService_ServiceDesc is the grpc.ServiceDesc for PushMessageService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) -var SendMessager_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "api.message.v1.SendMessager", - HandlerType: (*SendMessagerServer)(nil), +var PushMessageService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.message.v1.PushMessageService", + HandlerType: (*PushMessageServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "SendMessage", - Handler: _SendMessager_SendMessage_Handler, - }, - { - MethodName: "Broadcast", - Handler: _SendMessager_Broadcast_Handler, + MethodName: "PushMessage", + Handler: _PushMessageService_PushMessage_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "message/v1/message.proto", } -// PushMessagerClient is the client API for PushMessager service. +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 PushMessagerClient interface { - PushMessage(ctx context.Context, in *PushMessageReq, opts ...grpc.CallOption) (*response.BaseResponse, error) +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 pushMessagerClient struct { +type offlineMessageServiceClient struct { cc grpc.ClientConnInterface } -func NewPushMessagerClient(cc grpc.ClientConnInterface) PushMessagerClient { - return &pushMessagerClient{cc} +func NewOfflineMessageServiceClient(cc grpc.ClientConnInterface) OfflineMessageServiceClient { + return &offlineMessageServiceClient{cc} +} + +func (c *offlineMessageServiceClient) QueryOfflineMessage(ctx context.Context, in *QueryOfflineMessageReq, opts ...grpc.CallOption) (*QueryOfflineMessageResp, error) { + out := new(QueryOfflineMessageResp) + err := c.cc.Invoke(ctx, OfflineMessageService_QueryOfflineMessage_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil } -func (c *pushMessagerClient) PushMessage(ctx context.Context, in *PushMessageReq, opts ...grpc.CallOption) (*response.BaseResponse, error) { - out := new(response.BaseResponse) - err := c.cc.Invoke(ctx, "/api.message.v1.PushMessager/PushMessage", in, out, opts...) +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 } return out, nil } -// PushMessagerServer is the server API for PushMessager service. -// All implementations must embed UnimplementedPushMessagerServer +// OfflineMessageServiceServer is the server API for OfflineMessageService service. +// All implementations must embed UnimplementedOfflineMessageServiceServer // for forward compatibility -type PushMessagerServer interface { - PushMessage(context.Context, *PushMessageReq) (*response.BaseResponse, error) - mustEmbedUnimplementedPushMessagerServer() +type OfflineMessageServiceServer interface { + QueryOfflineMessage(context.Context, *QueryOfflineMessageReq) (*QueryOfflineMessageResp, error) + ConfirmLastMstID(context.Context, *ConfirmLastMsgIDReq) (*ConfirmLastMsgIDResp, error) + mustEmbedUnimplementedOfflineMessageServiceServer() } -// UnimplementedPushMessagerServer must be embedded to have forward compatible implementations. -type UnimplementedPushMessagerServer struct { +// UnimplementedOfflineMessageServiceServer must be embedded to have forward compatible implementations. +type UnimplementedOfflineMessageServiceServer struct { } -func (UnimplementedPushMessagerServer) PushMessage(context.Context, *PushMessageReq) (*response.BaseResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PushMessage not implemented") +func (UnimplementedOfflineMessageServiceServer) QueryOfflineMessage(context.Context, *QueryOfflineMessageReq) (*QueryOfflineMessageResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryOfflineMessage not implemented") } -func (UnimplementedPushMessagerServer) mustEmbedUnimplementedPushMessagerServer() {} +func (UnimplementedOfflineMessageServiceServer) ConfirmLastMstID(context.Context, *ConfirmLastMsgIDReq) (*ConfirmLastMsgIDResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfirmLastMstID not implemented") +} +func (UnimplementedOfflineMessageServiceServer) mustEmbedUnimplementedOfflineMessageServiceServer() {} -// UnsafePushMessagerServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to PushMessagerServer will +// UnsafeOfflineMessageServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to OfflineMessageServiceServer will // result in compilation errors. -type UnsafePushMessagerServer interface { - mustEmbedUnimplementedPushMessagerServer() +type UnsafeOfflineMessageServiceServer interface { + mustEmbedUnimplementedOfflineMessageServiceServer() } -func RegisterPushMessagerServer(s grpc.ServiceRegistrar, srv PushMessagerServer) { - s.RegisterService(&PushMessager_ServiceDesc, srv) +func RegisterOfflineMessageServiceServer(s grpc.ServiceRegistrar, srv OfflineMessageServiceServer) { + s.RegisterService(&OfflineMessageService_ServiceDesc, srv) } -func _PushMessager_PushMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PushMessageReq) +func _OfflineMessageService_QueryOfflineMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryOfflineMessageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfflineMessageServiceServer).QueryOfflineMessage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: OfflineMessageService_QueryOfflineMessage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfflineMessageServiceServer).QueryOfflineMessage(ctx, req.(*QueryOfflineMessageReq)) + } + 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.(PushMessagerServer).PushMessage(ctx, in) + return srv.(OfflineMessageServiceServer).ConfirmLastMstID(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.message.v1.PushMessager/PushMessage", + FullMethod: OfflineMessageService_ConfirmLastMstID_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PushMessagerServer).PushMessage(ctx, req.(*PushMessageReq)) + return srv.(OfflineMessageServiceServer).ConfirmLastMstID(ctx, req.(*ConfirmLastMsgIDReq)) } return interceptor(ctx, in, info, handler) } -// PushMessager_ServiceDesc is the grpc.ServiceDesc for PushMessager service. +// 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) -var PushMessager_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "api.message.v1.PushMessager", - HandlerType: (*PushMessagerServer)(nil), +var OfflineMessageService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.message.v1.OfflineMessageService", + HandlerType: (*OfflineMessageServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "PushMessage", - Handler: _PushMessager_PushMessage_Handler, + MethodName: "QueryOfflineMessage", + Handler: _OfflineMessageService_QueryOfflineMessage_Handler, + }, + { + MethodName: "ConfirmLastMstID", + Handler: _OfflineMessageService_ConfirmLastMstID_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "message/v1/message.proto", } -// OfflineMessageClient is the client API for OfflineMessage service. +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 OfflineMessageClient interface { - QueryOfflineMessage(ctx context.Context, in *QueryOfflineMessageReq, opts ...grpc.CallOption) (*QueryOfflineMessageResp, error) +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 offlineMessageClient struct { +type historyMessageServiceClient struct { cc grpc.ClientConnInterface } -func NewOfflineMessageClient(cc grpc.ClientConnInterface) OfflineMessageClient { - return &offlineMessageClient{cc} +func NewHistoryMessageServiceClient(cc grpc.ClientConnInterface) HistoryMessageServiceClient { + return &historyMessageServiceClient{cc} } -func (c *offlineMessageClient) QueryOfflineMessage(ctx context.Context, in *QueryOfflineMessageReq, opts ...grpc.CallOption) (*QueryOfflineMessageResp, error) { - out := new(QueryOfflineMessageResp) - err := c.cc.Invoke(ctx, "/api.message.v1.OfflineMessage/QueryOfflineMessage", in, out, opts...) +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 } -// OfflineMessageServer is the server API for OfflineMessage service. -// All implementations must embed UnimplementedOfflineMessageServer +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 OfflineMessageServer interface { - QueryOfflineMessage(context.Context, *QueryOfflineMessageReq) (*QueryOfflineMessageResp, error) - mustEmbedUnimplementedOfflineMessageServer() +type HistoryMessageServiceServer interface { + QuerySessionHistoryMessage(context.Context, *QuerySessionHistoryMessageReq) (*QuerySessionHistoryMessageResp, error) + SyncHistoryMessage(context.Context, *SyncHistoryMessageReq) (*SyncHistoryMessageResp, error) + mustEmbedUnimplementedHistoryMessageServiceServer() } -// UnimplementedOfflineMessageServer must be embedded to have forward compatible implementations. -type UnimplementedOfflineMessageServer struct { +// UnimplementedHistoryMessageServiceServer must be embedded to have forward compatible implementations. +type UnimplementedHistoryMessageServiceServer struct { } -func (UnimplementedOfflineMessageServer) QueryOfflineMessage(context.Context, *QueryOfflineMessageReq) (*QueryOfflineMessageResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryOfflineMessage not implemented") +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 (UnimplementedOfflineMessageServer) mustEmbedUnimplementedOfflineMessageServer() {} +func (UnimplementedHistoryMessageServiceServer) mustEmbedUnimplementedHistoryMessageServiceServer() {} -// UnsafeOfflineMessageServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to OfflineMessageServer will +// 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 UnsafeOfflineMessageServer interface { - mustEmbedUnimplementedOfflineMessageServer() +type UnsafeHistoryMessageServiceServer interface { + mustEmbedUnimplementedHistoryMessageServiceServer() } -func RegisterOfflineMessageServer(s grpc.ServiceRegistrar, srv OfflineMessageServer) { - s.RegisterService(&OfflineMessage_ServiceDesc, srv) +func RegisterHistoryMessageServiceServer(s grpc.ServiceRegistrar, srv HistoryMessageServiceServer) { + s.RegisterService(&HistoryMessageService_ServiceDesc, srv) } -func _OfflineMessage_QueryOfflineMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryOfflineMessageReq) +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.(OfflineMessageServer).QueryOfflineMessage(ctx, in) + return srv.(HistoryMessageServiceServer).SyncHistoryMessage(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.message.v1.OfflineMessage/QueryOfflineMessage", + FullMethod: HistoryMessageService_SyncHistoryMessage_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(OfflineMessageServer).QueryOfflineMessage(ctx, req.(*QueryOfflineMessageReq)) + return srv.(HistoryMessageServiceServer).SyncHistoryMessage(ctx, req.(*SyncHistoryMessageReq)) } return interceptor(ctx, in, info, handler) } -// OfflineMessage_ServiceDesc is the grpc.ServiceDesc for OfflineMessage service. +// 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 OfflineMessage_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "api.message.v1.OfflineMessage", - HandlerType: (*OfflineMessageServer)(nil), +var HistoryMessageService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "api.message.v1.HistoryMessageService", + HandlerType: (*HistoryMessageServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "QueryOfflineMessage", - Handler: _OfflineMessage_QueryOfflineMessage_Handler, + MethodName: "QuerySessionHistoryMessage", + Handler: _HistoryMessageService_QuerySessionHistoryMessage_Handler, + }, + { + MethodName: "SyncHistoryMessage", + Handler: _HistoryMessageService_SyncHistoryMessage_Handler, }, }, Streams: []grpc.StreamDesc{}, 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/third_party/google/protobuf/any.proto b/third_party/google/protobuf/any.proto deleted file mode 100644 index c9be854..0000000 --- a/third_party/google/protobuf/any.proto +++ /dev/null @@ -1,155 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "github.com/golang/protobuf/ptypes/any"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "AnyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := ptypes.MarshalAny(foo) -// ... -// foo := &pb.Foo{} -// if err := ptypes.UnmarshalAny(any, foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -message Any { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - // - string type_url = 1; - - // Must be a valid serialized protocol buffer of the above specified type. - bytes value = 2; -} diff --git a/third_party/google/protobuf/descriptor.proto b/third_party/google/protobuf/descriptor.proto deleted file mode 100644 index ec568c3..0000000 --- a/third_party/google/protobuf/descriptor.proto +++ /dev/null @@ -1,911 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - - -syntax = "proto2"; - -package google.protobuf; - -option go_package = "google.golang.org/protobuf/types/descriptorpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; -option csharp_namespace = "Google.Protobuf.Reflection"; -option objc_class_prefix = "GPB"; -option cc_enable_arenas = true; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - // Indexes of the public imported files in the dependency list above. - repeated int32 public_dependency = 10; - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - repeated int32 weak_dependency = 11; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field without harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; - - // The syntax of the proto file. - // The supported values are "proto2" and "proto3". - optional string syntax = 12; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - - optional ExtensionRangeOptions options = 3; - } - repeated ExtensionRange extension_range = 5; - - repeated OneofDescriptorProto oneof_decl = 8; - - optional MessageOptions options = 7; - - // Range of reserved tag numbers. Reserved tag numbers may not be used by - // fields or extension ranges in the same message. Reserved ranges may - // not overlap. - message ReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - } - repeated ReservedRange reserved_range = 9; - // Reserved field names, which may not be used by fields in the same message. - // A given name may only be reserved once. - repeated string reserved_name = 10; -} - -message ExtensionRangeOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 - // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - } - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - } - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - optional string default_value = 7; - - // If set, gives the index of a oneof in the containing type's oneof_decl - // list. This field is a member of that oneof. - optional int32 oneof_index = 9; - - // JSON name of this field. The value is set by protocol compiler. If the - // user has set a "json_name" option on this field, that option's value - // will be used. Otherwise, it's deduced from the field's name by converting - // it to camelCase. - optional string json_name = 10; - - optional FieldOptions options = 8; - - // If true, this is a proto3 "optional". When a proto3 field is optional, it - // tracks presence regardless of field type. - // - // When proto3_optional is true, this field must be belong to a oneof to - // signal to old proto3 clients that presence is tracked for this field. This - // oneof is known as a "synthetic" oneof, and this field must be its sole - // member (each proto3 optional field gets its own synthetic oneof). Synthetic - // oneofs exist in the descriptor only, and do not generate any API. Synthetic - // oneofs must be ordered after all "real" oneofs. - // - // For message fields, proto3_optional doesn't create any semantic change, - // since non-repeated message fields always track presence. However it still - // indicates the semantic detail of whether the user wrote "optional" or not. - // This can be useful for round-tripping the .proto file. For consistency we - // give message fields a synthetic oneof also, even though it is not required - // to track presence. This is especially important because the parser can't - // tell if a field is a message or an enum, so it must always create a - // synthetic oneof. - // - // Proto2 optional fields do not set this flag, because they already indicate - // optional with `LABEL_OPTIONAL`. - optional bool proto3_optional = 17; -} - -// Describes a oneof. -message OneofDescriptorProto { - optional string name = 1; - optional OneofOptions options = 2; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; - - // Range of reserved numeric values. Reserved values may not be used by - // entries in the same enum. Reserved ranges may not overlap. - // - // Note that this is distinct from DescriptorProto.ReservedRange in that it - // is inclusive such that it can appropriately represent the entire int32 - // domain. - message EnumReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Inclusive. - } - - // Range of reserved numeric values. Reserved numeric values may not be used - // by enum values in the same enum declaration. Reserved ranges may not - // overlap. - repeated EnumReservedRange reserved_range = 4; - - // Reserved enum value names, which may not be reused. A given name may only - // be reserved once. - repeated string reserved_name = 5; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; - - // Identifies if client streams multiple client messages - optional bool client_streaming = 5 [default = false]; - // Identifies if server streams multiple server messages - optional bool server_streaming = 6 [default = false]; -} - - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail protobuf-global-extension-registry@google.com -// to reserve extension numbers. Simply provide your project name (e.g. -// Objective-C plugin) and your project website (if available) -- there's no -// need to explain how you intend to use them. Usually you only need one -// extension number. You can declare multiple options with only one extension -// number by putting them in a sub-message. See the Custom Options section of -// the docs for examples: -// https://developers.google.com/protocol-buffers/docs/proto#options -// If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - - // Controls the name of the wrapper Java class generated for the .proto file. - // That class will always contain the .proto file's getDescriptor() method as - // well as any top-level extensions defined in the .proto file. - // If java_multiple_files is disabled, then all the other classes from the - // .proto file will be nested inside the single wrapper outer class. - optional string java_outer_classname = 8; - - // If enabled, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the wrapper class - // named by java_outer_classname. However, the wrapper class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default = false]; - - // This option does nothing. - optional bool java_generate_equals_and_hash = 20 [deprecated=true]; - - // If set true, then the Java2 code generator will generate code that - // throws an exception whenever an attempt is made to assign a non-UTF-8 - // byte sequence to a string field. - // Message reflection will do the same. - // However, an extension field still accepts non-UTF-8 byte sequences. - // This option has no effect on when used with the lite runtime. - optional bool java_string_check_utf8 = 27 [default = false]; - - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default = SPEED]; - - // Sets the Go package where structs generated from this .proto will be - // placed. If omitted, the Go package will be derived from the following: - // - The basename of the package import path, if provided. - // - Otherwise, the package statement in the .proto file, if present. - // - Otherwise, the basename of the .proto file, without extension. - optional string go_package = 11; - - - - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of google.protobuf. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default = false]; - optional bool java_generic_services = 17 [default = false]; - optional bool py_generic_services = 18 [default = false]; - optional bool php_generic_services = 42 [default = false]; - - // Is this file deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for everything in the file, or it will be completely ignored; in the very - // least, this is a formalization for deprecating files. - optional bool deprecated = 23 [default = false]; - - // Enables the use of arenas for the proto messages in this file. This applies - // only to generated classes for C++. - optional bool cc_enable_arenas = 31 [default = true]; - - - // Sets the objective c class prefix which is prepended to all objective c - // generated classes from this .proto. There is no default. - optional string objc_class_prefix = 36; - - // Namespace for generated classes; defaults to the package. - optional string csharp_namespace = 37; - - // By default Swift generators will take the proto package and CamelCase it - // replacing '.' with underscore and use that to prefix the types/symbols - // defined. When this options is provided, they will use this value instead - // to prefix the types/symbols defined. - optional string swift_prefix = 39; - - // Sets the php class prefix which is prepended to all php generated classes - // from this .proto. Default is empty. - optional string php_class_prefix = 40; - - // Use this option to change the namespace of php generated classes. Default - // is empty. When this option is empty, the package name will be used for - // determining the namespace. - optional string php_namespace = 41; - - // Use this option to change the namespace of php generated metadata classes. - // Default is empty. When this option is empty, the proto file name will be - // used for determining the namespace. - optional string php_metadata_namespace = 44; - - // Use this option to change the package of ruby generated classes. Default - // is empty. When this option is not set, the package name will be used for - // determining the ruby package. - optional string ruby_package = 45; - - - // The parser stores options it doesn't recognize here. - // See the documentation for the "Options" section above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. - // See the documentation for the "Options" section above. - extensions 1000 to max; - - reserved 38; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default = false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default = false]; - - // Is this message deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the message, or it will be completely ignored; in the very least, - // this is a formalization for deprecating messages. - optional bool deprecated = 3 [default = false]; - - reserved 4, 5, 6; - - // Whether the message is an automatically generated map entry type for the - // maps field. - // - // For maps fields: - // map map_field = 1; - // The parsed descriptor looks like: - // message MapFieldEntry { - // option map_entry = true; - // optional KeyType key = 1; - // optional ValueType value = 2; - // } - // repeated MapFieldEntry map_field = 1; - // - // Implementations may choose not to generate the map_entry=true message, but - // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementations still need to work as - // if the field is a repeated message field. - // - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. - optional bool map_entry = 7; - - reserved 8; // javalite_serializable - reserved 9; // javanano_as_lite - - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. - optional bool packed = 2; - - // The jstype option determines the JavaScript type used for values of the - // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - // is represented as JavaScript string, which avoids loss of precision that - // can happen when a large value is converted to a floating point JavaScript. - // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - // use the JavaScript "number" type. The behavior of the default option - // JS_NORMAL is implementation dependent. - // - // This option is an enum to permit additional types to be added, e.g. - // goog.math.Integer. - optional JSType jstype = 6 [default = JS_NORMAL]; - enum JSType { - // Use the default type. - JS_NORMAL = 0; - - // Use JavaScript strings. - JS_STRING = 1; - - // Use JavaScript numbers. - JS_NUMBER = 2; - } - - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outer message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - optional bool lazy = 5 [default = false]; - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default = false]; - - // For Google-internal migration only. Do not use. - optional bool weak = 10 [default = false]; - - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; - - reserved 4; // removed jtype -} - -message OneofOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // Set this option to true to allow mapping different tag names to the same - // value. - optional bool allow_alias = 2; - - // Is this enum deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum, or it will be completely ignored; in the very least, this - // is a formalization for deprecating enums. - optional bool deprecated = 3 [default = false]; - - reserved 5; // javanano_as_lite - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // Is this enum value deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum value, or it will be completely ignored; in the very least, - // this is a formalization for deprecating enum values. - optional bool deprecated = 1 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this service deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the service, or it will be completely ignored; in the very least, - // this is a formalization for deprecating services. - optional bool deprecated = 33 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this method deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the method, or it will be completely ignored; in the very least, - // this is a formalization for deprecating methods. - optional bool deprecated = 33 [default = false]; - - // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - // or neither? HTTP based RPC implementation may choose GET verb for safe - // methods, and PUT verb for idempotent methods instead of the default POST. - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0; - NO_SIDE_EFFECTS = 1; // implies idempotent - IDEMPOTENT = 2; // idempotent, but may have side effects - } - optional IdempotencyLevel idempotency_level = 34 - [default = IDEMPOTENCY_UNKNOWN]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - // "foo.(bar.baz).qux". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendant. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition occurs. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed = true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed = true]; - - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // leading_detached_comments will keep paragraphs of comments that appear - // before (but not connected to) the current element. Each paragraph, - // separated by empty lines, will be one comment element in the repeated - // field. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to qux. - // // - // // Another line attached to qux. - // optional double qux = 4; - // - // // Detached comment for corge. This is not leading or trailing comments - // // to qux or corge because there are blank lines separating it from - // // both. - // - // // Detached comment for corge paragraph 2. - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - // - // // ignored detached comments. - optional string leading_comments = 3; - optional string trailing_comments = 4; - repeated string leading_detached_comments = 6; - } -} - -// Describes the relationship between generated code and its original source -// file. A GeneratedCodeInfo message is associated with only one generated -// source file, but may contain references to different source .proto files. -message GeneratedCodeInfo { - // An Annotation connects some span of text in generated code to an element - // of its generating .proto file. - repeated Annotation annotation = 1; - message Annotation { - // Identifies the element in the original source .proto file. This field - // is formatted the same as SourceCodeInfo.Location.path. - repeated int32 path = 1 [packed = true]; - - // Identifies the filesystem path to the original source .proto. - optional string source_file = 2; - - // Identifies the starting offset in bytes in the generated code - // that relates to the identified object. - optional int32 begin = 3; - - // Identifies the ending offset in bytes in the generated code that - // relates to the identified offset. The end offset should be one past - // the last relevant byte (so the length of the text = end - begin). - optional int32 end = 4; - } -} \ No newline at end of file diff --git a/third_party/google/protobuf/duration.proto b/third_party/google/protobuf/duration.proto deleted file mode 100644 index cb7cf0e..0000000 --- a/third_party/google/protobuf/duration.proto +++ /dev/null @@ -1,116 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option cc_enable_arenas = true; -option go_package = "google.golang.org/protobuf/types/known/durationpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DurationProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// A Duration represents a signed, fixed-length span of time represented -// as a count of seconds and fractions of seconds at nanosecond -// resolution. It is independent of any calendar and concepts like "day" -// or "month". It is related to Timestamp in that the difference between -// two Timestamp values is a Duration and it can be added or subtracted -// from a Timestamp. Range is approximately +-10,000 years. -// -// # Examples -// -// Example 1: Compute Duration from two Timestamps in pseudo code. -// -// Timestamp start = ...; -// Timestamp end = ...; -// Duration duration = ...; -// -// duration.seconds = end.seconds - start.seconds; -// duration.nanos = end.nanos - start.nanos; -// -// if (duration.seconds < 0 && duration.nanos > 0) { -// duration.seconds += 1; -// duration.nanos -= 1000000000; -// } else if (duration.seconds > 0 && duration.nanos < 0) { -// duration.seconds -= 1; -// duration.nanos += 1000000000; -// } -// -// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. -// -// Timestamp start = ...; -// Duration duration = ...; -// Timestamp end = ...; -// -// end.seconds = start.seconds + duration.seconds; -// end.nanos = start.nanos + duration.nanos; -// -// if (end.nanos < 0) { -// end.seconds -= 1; -// end.nanos += 1000000000; -// } else if (end.nanos >= 1000000000) { -// end.seconds += 1; -// end.nanos -= 1000000000; -// } -// -// Example 3: Compute Duration from datetime.timedelta in Python. -// -// td = datetime.timedelta(days=3, minutes=10) -// duration = Duration() -// duration.FromTimedelta(td) -// -// # JSON Mapping -// -// In JSON format, the Duration type is encoded as a string rather than an -// object, where the string ends in the suffix "s" (indicating seconds) and -// is preceded by the number of seconds, with nanoseconds expressed as -// fractional seconds. For example, 3 seconds with 0 nanoseconds should be -// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should -// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 -// microsecond should be expressed in JSON format as "3.000001s". -// -// -message Duration { - // Signed seconds of the span of time. Must be from -315,576,000,000 - // to +315,576,000,000 inclusive. Note: these bounds are computed from: - // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - int64 seconds = 1; - - // Signed fractions of a second at nanosecond resolution of the span - // of time. Durations less than one second are represented with a 0 - // `seconds` field and a positive or negative `nanos` field. For durations - // of one second or more, a non-zero value for the `nanos` field must be - // of the same sign as the `seconds` field. Must be from -999,999,999 - // to +999,999,999 inclusive. - int32 nanos = 2; -} \ No newline at end of file diff --git a/third_party/google/protobuf/timestamp.proto b/third_party/google/protobuf/timestamp.proto deleted file mode 100644 index cd35786..0000000 --- a/third_party/google/protobuf/timestamp.proto +++ /dev/null @@ -1,138 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option cc_enable_arenas = true; -option go_package = "github.com/golang/protobuf/ptypes/timestamp"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "TimestampProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// A Timestamp represents a point in time independent of any time zone or local -// calendar, encoded as a count of seconds and fractions of seconds at -// nanosecond resolution. The count is relative to an epoch at UTC midnight on -// January 1, 1970, in the proleptic Gregorian calendar which extends the -// Gregorian calendar backwards to year one. -// -// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap -// second table is needed for interpretation, using a [24-hour linear -// smear](https://developers.google.com/time/smear). -// -// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By -// restricting to that range, we ensure that we can convert to and from [RFC -// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. -// -// # Examples -// -// Example 1: Compute Timestamp from POSIX `time()`. -// -// Timestamp timestamp; -// timestamp.set_seconds(time(NULL)); -// timestamp.set_nanos(0); -// -// Example 2: Compute Timestamp from POSIX `gettimeofday()`. -// -// struct timeval tv; -// gettimeofday(&tv, NULL); -// -// Timestamp timestamp; -// timestamp.set_seconds(tv.tv_sec); -// timestamp.set_nanos(tv.tv_usec * 1000); -// -// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. -// -// FILETIME ft; -// GetSystemTimeAsFileTime(&ft); -// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; -// -// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z -// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. -// Timestamp timestamp; -// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); -// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); -// -// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. -// -// long millis = System.currentTimeMillis(); -// -// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) -// .setNanos((int) ((millis % 1000) * 1000000)).build(); -// -// -// Example 5: Compute Timestamp from current time in Python. -// -// timestamp = Timestamp() -// timestamp.GetCurrentTime() -// -// # JSON Mapping -// -// In JSON format, the Timestamp type is encoded as a string in the -// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the -// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" -// where {year} is always expressed using four digits while {month}, {day}, -// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional -// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), -// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -// is required. A proto3 JSON serializer should always use UTC (as indicated by -// "Z") when printing the Timestamp type and a proto3 JSON parser should be -// able to accept both UTC and other timezones (as indicated by an offset). -// -// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past -// 01:30 UTC on January 15, 2017. -// -// In JavaScript, one can convert a Date object to this format using the -// standard -// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) -// method. In Python, a standard `datetime.datetime` object can be converted -// to this format using -// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with -// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use -// the Joda Time's [`ISODateTimeFormat.dateTime()`]( -// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D -// ) to obtain a formatter capable of generating timestamps in this format. -// -// -message Timestamp { - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. - int64 seconds = 1; - - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 - // inclusive. - int32 nanos = 2; -} diff --git a/third_party/validate/validate.proto b/third_party/validate/validate.proto deleted file mode 100644 index 42561c3..0000000 --- a/third_party/validate/validate.proto +++ /dev/null @@ -1,862 +0,0 @@ -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 specifes 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 specifes 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 - // contraint is only applicable to scalar and enum types (messages are not - // supported). - optional bool unique = 3; - - // Items specifies the contraints 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 100852e..0000000 --- a/transport/response/response.pb.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc v3.19.4 -// 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 -) - -// 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", - } - 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, - } -) - -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, - 0xbd, 0x02, 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, 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 6c88cb4..c681085 100644 --- a/user/friend/v1/friend.pb.go +++ b/user/friend/v1/friend.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc-gen-go v1.34.1 +// protoc (unknown) // source: user/friend/v1/friend.proto 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,21 +1078,21 @@ 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 { @@ -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, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 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 5b9e952..563fc72 100644 --- a/user/friend/v1/friend.proto +++ b/user/friend/v1/friend.proto @@ -1,17 +1,16 @@ syntax = "proto3"; package api.user.friend.v1; -option go_package = "github.com/go-goim/api/user/friend/v1"; +import "message/v1/message.proto"; +import "errors/errors.proto"; import "validate/validate.proto"; -import "transport/response/response.proto"; - -import "user/session/v1/session.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; @@ -37,16 +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; } @@ -56,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; @@ -76,18 +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}]; - string friend_uid = 2 [(validate.rules).string = {min_len: 20, max_len: 24}]; + int64 uid = 1 [(validate.rules).int64 = { + gt: 0 + }]; + int64 friend_uid = 2 [(validate.rules).int64 = { + gt: 0 + }]; } message AddFriendResponse { - transport.response.BaseResponse response = 1; + errors.Error error = 1; AddFriendResult result = 2; } @@ -104,9 +104,11 @@ enum AddFriendStatus { BLOCKED_BY_FRIEND = 4; } -message ConfirmFriendRequestReq { - string uid = 1 [(validate.rules).string = {min_len: 20, max_len: 24}]; - int64 friend_request_id = 2[(validate.rules).int64.gt = 0]; +message ConfirmFriendRequestRequest { + int64 uid = 1 [(validate.rules).int64 = { + gt: 0 + }]; + uint64 friend_request_id = 2 [(validate.rules).uint64.gt = 0]; ConfirmFriendRequestAction action = 3 [(validate.rules).enum.defined_only = true]; } @@ -116,42 +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}]; - string to_uid = 2 [(validate.rules).string = {min_len: 20, max_len: 24}]; - user.session.v1.SessionType session_type = 3; + int64 from_uid = 1 [(validate.rules).int64 = { + gt: 0 + }]; + int64 to_uid = 2 [(validate.rules).int64 = { + gt: 0 + }]; + 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 03a3387..0fa2d90 100644 --- a/user/group/v1/group.pb.go +++ b/user/group/v1/group.pb.go @@ -1,12 +1,13 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc-gen-go v1.34.1 +// protoc (unknown) // source: user/group/v1/group.proto package v1 import ( + 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" @@ -21,93 +22,142 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type GroupType int32 +type GroupStatus int32 const ( - GroupType_Normal GroupType = 0 // more types + GroupStatus_Active GroupStatus = 0 + GroupStatus_Silent GroupStatus = 1 // more statuses ) -// Enum value maps for GroupType. +// Enum value maps for GroupStatus. var ( - GroupType_name = map[int32]string{ - 0: "Normal", + GroupStatus_name = map[int32]string{ + 0: "Active", + 1: "Silent", } - GroupType_value = map[string]int32{ - "Normal": 0, + GroupStatus_value = map[string]int32{ + "Active": 0, + "Silent": 1, } ) -func (x GroupType) Enum() *GroupType { - p := new(GroupType) +func (x GroupStatus) Enum() *GroupStatus { + p := new(GroupStatus) *p = x return p } -func (x GroupType) String() string { +func (x GroupStatus) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (GroupType) Descriptor() protoreflect.EnumDescriptor { +func (GroupStatus) Descriptor() protoreflect.EnumDescriptor { return file_user_group_v1_group_proto_enumTypes[0].Descriptor() } -func (GroupType) Type() protoreflect.EnumType { +func (GroupStatus) Type() protoreflect.EnumType { return &file_user_group_v1_group_proto_enumTypes[0] } -func (x GroupType) Number() protoreflect.EnumNumber { +func (x GroupStatus) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use GroupType.Descriptor instead. -func (GroupType) EnumDescriptor() ([]byte, []int) { +// Deprecated: Use GroupStatus.Descriptor instead. +func (GroupStatus) EnumDescriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{0} } -type GroupStatus int32 +type GroupMember_Status int32 const ( - GroupStatus_Active GroupStatus = 0 - GroupStatus_Silent GroupStatus = 1 // more statuses + GroupMember_StatusActive GroupMember_Status = 0 + GroupMember_StatusSilent GroupMember_Status = 1 // more statuses ) -// Enum value maps for GroupStatus. +// Enum value maps for GroupMember_Status. var ( - GroupStatus_name = map[int32]string{ - 0: "Active", - 1: "Silent", + GroupMember_Status_name = map[int32]string{ + 0: "StatusActive", + 1: "StatusSilent", } - GroupStatus_value = map[string]int32{ - "Active": 0, - "Silent": 1, + GroupMember_Status_value = map[string]int32{ + "StatusActive": 0, + "StatusSilent": 1, } ) -func (x GroupStatus) Enum() *GroupStatus { - p := new(GroupStatus) +func (x GroupMember_Status) Enum() *GroupMember_Status { + p := new(GroupMember_Status) *p = x return p } -func (x GroupStatus) String() string { +func (x GroupMember_Status) String() string { return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) } -func (GroupStatus) Descriptor() protoreflect.EnumDescriptor { +func (GroupMember_Status) Descriptor() protoreflect.EnumDescriptor { return file_user_group_v1_group_proto_enumTypes[1].Descriptor() } -func (GroupStatus) Type() protoreflect.EnumType { +func (GroupMember_Status) Type() protoreflect.EnumType { return &file_user_group_v1_group_proto_enumTypes[1] } -func (x GroupStatus) Number() protoreflect.EnumNumber { +func (x GroupMember_Status) Number() protoreflect.EnumNumber { return protoreflect.EnumNumber(x) } -// Deprecated: Use GroupStatus.Descriptor instead. -func (GroupStatus) EnumDescriptor() ([]byte, []int) { - return file_user_group_v1_group_proto_rawDescGZIP(), []int{1} +// Deprecated: Use GroupMember_Status.Descriptor instead. +func (GroupMember_Status) EnumDescriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{1, 0} +} + +type GroupMember_Type int32 + +const ( + GroupMember_TypeOwner GroupMember_Type = 0 + GroupMember_TypeMember GroupMember_Type = 1 // more types +) + +// Enum value maps for GroupMember_Type. +var ( + GroupMember_Type_name = map[int32]string{ + 0: "TypeOwner", + 1: "TypeMember", + } + GroupMember_Type_value = map[string]int32{ + "TypeOwner": 0, + "TypeMember": 1, + } +) + +func (x GroupMember_Type) Enum() *GroupMember_Type { + p := new(GroupMember_Type) + *p = x + return p +} + +func (x GroupMember_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (GroupMember_Type) Descriptor() protoreflect.EnumDescriptor { + return file_user_group_v1_group_proto_enumTypes[2].Descriptor() +} + +func (GroupMember_Type) Type() protoreflect.EnumType { + return &file_user_group_v1_group_proto_enumTypes[2] +} + +func (x GroupMember_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use GroupMember_Type.Descriptor instead. +func (GroupMember_Type) EnumDescriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{1, 1} } type Group struct { @@ -115,15 +165,16 @@ type Group struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,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"` - Type GroupType `protobuf:"varint,4,opt,name=type,proto3,enum=api.user.group.v1.GroupType" json:"type,omitempty"` - Status GroupStatus `protobuf:"varint,5,opt,name=status,proto3,enum=api.user.group.v1.GroupStatus" json:"status,omitempty"` - CreatedBy string `protobuf:"bytes,6,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` - Members []string `protobuf:"bytes,7,rep,name=members,proto3" json:"members,omitempty"` - CreatedAt int64 `protobuf:"varint,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt int64 `protobuf:"varint,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,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 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"` + MemberCount int32 `protobuf:"varint,10,opt,name=member_count,json=memberCount,proto3" json:"member_count,omitempty"` + Status GroupStatus `protobuf:"varint,11,opt,name=status,proto3,enum=api.user.group.v1.GroupStatus" json:"status,omitempty"` } func (x *Group) Reset() { @@ -158,9 +209,9 @@ func (*Group) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{0} } -func (x *Group) GetId() int64 { +func (x *Group) GetGid() int64 { if x != nil { - return x.Id + return x.Gid } return 0 } @@ -179,56 +230,69 @@ func (x *Group) GetDescription() string { return "" } -func (x *Group) GetType() GroupType { +func (x *Group) GetAvatar() string { if x != nil { - return x.Type + return x.Avatar } - return GroupType_Normal + return "" } -func (x *Group) GetStatus() GroupStatus { +func (x *Group) GetOwnerUid() int64 { if x != nil { - return x.Status + return x.OwnerUid } - return GroupStatus_Active + return 0 } -func (x *Group) GetCreatedBy() string { +func (x *Group) GetOwner() *GroupMember { if x != nil { - return x.CreatedBy + return x.Owner } - return "" + return nil } -func (x *Group) GetMembers() []string { +func (x *Group) GetMembers() []*GroupMember { if x != nil { return x.Members } return nil } -func (x *Group) GetCreatedAt() int64 { +func (x *Group) GetMaxMembers() int32 { if x != nil { - return x.CreatedAt + return x.MaxMembers } return 0 } -func (x *Group) GetUpdatedAt() int64 { +func (x *Group) GetMemberCount() int32 { if x != nil { - return x.UpdatedAt + return x.MemberCount } return 0 } -type Empty struct { +func (x *Group) GetStatus() GroupStatus { + if x != nil { + return x.Status + } + return GroupStatus_Active +} + +type GroupMember struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + 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"` } -func (x *Empty) Reset() { - *x = Empty{} +func (x *GroupMember) Reset() { + *x = GroupMember{} if protoimpl.UnsafeEnabled { mi := &file_user_group_v1_group_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -236,13 +300,13 @@ func (x *Empty) Reset() { } } -func (x *Empty) String() string { +func (x *GroupMember) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Empty) ProtoMessage() {} +func (*GroupMember) ProtoMessage() {} -func (x *Empty) ProtoReflect() protoreflect.Message { +func (x *GroupMember) ProtoReflect() protoreflect.Message { mi := &file_user_group_v1_group_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -254,143 +318,1138 @@ func (x *Empty) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Empty.ProtoReflect.Descriptor instead. -func (*Empty) Descriptor() ([]byte, []int) { +// Deprecated: Use GroupMember.ProtoReflect.Descriptor instead. +func (*GroupMember) Descriptor() ([]byte, []int) { return file_user_group_v1_group_proto_rawDescGZIP(), []int{1} } -var File_user_group_v1_group_proto protoreflect.FileDescriptor +func (x *GroupMember) GetGid() int64 { + if x != nil { + return x.Gid + } + return 0 +} -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, 0x12, - 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xae, 0x02, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 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, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x1c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, - 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, 0x12, 0x1d, 0x0a, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x61, 0x74, 0x18, 0x08, 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, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x41, 0x74, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x2a, 0x17, 0x0a, 0x09, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x6f, 0x72, - 0x6d, 0x61, 0x6c, 0x10, 0x00, 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, 0xea, 0x03, 0x0a, - 0x0c, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, - 0x08, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 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, 0x12, 0x41, 0x0a, - 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 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, - 0x12, 0x41, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, - 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 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, 0x12, 0x41, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x42, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x1a, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x44, 0x0a, 0x0e, 0x41, 0x64, - 0x64, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, - 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x47, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, - 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, - 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 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, +func (x *GroupMember) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 } -var ( - file_user_group_v1_group_proto_rawDescOnce sync.Once - file_user_group_v1_group_proto_rawDescData = file_user_group_v1_group_proto_rawDesc -) +func (x *GroupMember) GetUser() *v1.User { + if x != nil { + return x.User + } + return nil +} -func file_user_group_v1_group_proto_rawDescGZIP() []byte { - file_user_group_v1_group_proto_rawDescOnce.Do(func() { - file_user_group_v1_group_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_group_v1_group_proto_rawDescData) - }) - return file_user_group_v1_group_proto_rawDescData +func (x *GroupMember) GetStatus() GroupMember_Status { + if x != nil { + return x.Status + } + return GroupMember_StatusActive } -var file_user_group_v1_group_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_user_group_v1_group_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_user_group_v1_group_proto_goTypes = []interface{}{ - (GroupType)(0), // 0: api.user.group.v1.GroupType - (GroupStatus)(0), // 1: api.user.group.v1.GroupStatus - (*Group)(nil), // 2: api.user.group.v1.Group - (*Empty)(nil), // 3: api.user.group.v1.Empty - (*v1.UserList)(nil), // 4: api.user.v1.UserList +func (x *GroupMember) GetType() GroupMember_Type { + if x != nil { + return x.Type + } + return GroupMember_TypeOwner } -var file_user_group_v1_group_proto_depIdxs = []int32{ - 0, // 0: api.user.group.v1.Group.type:type_name -> api.user.group.v1.GroupType - 1, // 1: api.user.group.v1.Group.status:type_name -> api.user.group.v1.GroupStatus - 3, // 2: api.user.group.v1.GroupService.GetGroup:input_type -> api.user.group.v1.Empty - 3, // 3: api.user.group.v1.GroupService.CreateGroup:input_type -> api.user.group.v1.Empty - 3, // 4: api.user.group.v1.GroupService.UpdateGroup:input_type -> api.user.group.v1.Empty - 3, // 5: api.user.group.v1.GroupService.DeleteGroup:input_type -> api.user.group.v1.Empty - 3, // 6: api.user.group.v1.GroupService.GetGroupMembers:input_type -> api.user.group.v1.Empty - 3, // 7: api.user.group.v1.GroupService.AddGroupMember:input_type -> api.user.group.v1.Empty - 3, // 8: api.user.group.v1.GroupService.RemoveGroupMember:input_type -> api.user.group.v1.Empty - 2, // 9: api.user.group.v1.GroupService.GetGroup:output_type -> api.user.group.v1.Group - 2, // 10: api.user.group.v1.GroupService.CreateGroup:output_type -> api.user.group.v1.Group - 2, // 11: api.user.group.v1.GroupService.UpdateGroup:output_type -> api.user.group.v1.Group - 3, // 12: api.user.group.v1.GroupService.DeleteGroup:output_type -> api.user.group.v1.Empty - 4, // 13: api.user.group.v1.GroupService.GetGroupMembers:output_type -> api.user.v1.UserList - 3, // 14: api.user.group.v1.GroupService.AddGroupMember:output_type -> api.user.group.v1.Empty - 3, // 15: api.user.group.v1.GroupService.RemoveGroupMember:output_type -> api.user.group.v1.Empty - 9, // [9:16] is the sub-list for method output_type - 2, // [2:9] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + +type GetGroupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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 init() { file_user_group_v1_group_proto_init() } -func file_user_group_v1_group_proto_init() { - if File_user_group_v1_group_proto != nil { - return +func (x *GetGroupRequest) Reset() { + *x = GetGroupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - if !protoimpl.UnsafeEnabled { - file_user_group_v1_group_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Group); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } +} + +func (x *GetGroupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupRequest) ProtoMessage() {} + +func (x *GetGroupRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_group_v1_group_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) } - file_user_group_v1_group_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Empty); i { + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupRequest.ProtoReflect.Descriptor instead. +func (*GetGroupRequest) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{2} +} + +func (x *GetGroupRequest) GetGid() int64 { + if x != nil { + return x.Gid + } + return 0 +} + +func (x *GetGroupRequest) GetOwnerUid() int64 { + if x != nil { + return x.OwnerUid + } + return 0 +} + +func (x *GetGroupRequest) GetWithMembers() bool { + if x != nil { + return x.WithMembers + } + 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 + + 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() { + *x = GetGroupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGroupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGroupResponse) ProtoMessage() {} + +func (x *GetGroupResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_group_v1_group_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetGroupResponse.ProtoReflect.Descriptor instead. +func (*GetGroupResponse) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{3} +} + +func (x *GetGroupResponse) GetError() *errors.Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *GetGroupResponse) GetGroup() *Group { + if x != nil { + return x.Group + } + return nil +} + +type ListGroupsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // list all groups no matter user is member or owner. + 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() { + *x = ListGroupsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListGroupsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGroupsRequest) ProtoMessage() {} + +func (x *ListGroupsRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_group_v1_group_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGroupsRequest.ProtoReflect.Descriptor instead. +func (*ListGroupsRequest) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{4} +} + +func (x *ListGroupsRequest) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *ListGroupsRequest) GetPage() int32 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *ListGroupsRequest) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type ListGroupsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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() { + *x = ListGroupsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListGroupsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListGroupsResponse) ProtoMessage() {} + +func (x *ListGroupsResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_group_v1_group_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListGroupsResponse.ProtoReflect.Descriptor instead. +func (*ListGroupsResponse) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{5} +} + +func (x *ListGroupsResponse) GetError() *errors.Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *ListGroupsResponse) GetGroups() []*Group { + if x != nil { + return x.Groups + } + return nil +} + +type CreateGroupRequest struct { + state protoimpl.MessageState + 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 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() { + *x = CreateGroupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateGroupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateGroupRequest) ProtoMessage() {} + +func (x *CreateGroupRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_group_v1_group_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 CreateGroupRequest.ProtoReflect.Descriptor instead. +func (*CreateGroupRequest) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{6} +} + +func (x *CreateGroupRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateGroupRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreateGroupRequest) GetAvatar() string { + if x != nil { + return x.Avatar + } + return "" +} + +func (x *CreateGroupRequest) GetOwnerUid() int64 { + if x != nil { + return x.OwnerUid + } + return 0 +} + +func (x *CreateGroupRequest) GetMembersUid() []int64 { + if x != nil { + return x.MembersUid + } + return nil +} + +type CreateGroupResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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() { + *x = CreateGroupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateGroupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateGroupResponse) ProtoMessage() {} + +func (x *CreateGroupResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_group_v1_group_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateGroupResponse.ProtoReflect.Descriptor instead. +func (*CreateGroupResponse) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{7} +} + +func (x *CreateGroupResponse) GetError() *errors.Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *CreateGroupResponse) GetGroup() *Group { + if x != nil { + return x.Group + } + return nil +} + +type UpdateGroupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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() { + *x = UpdateGroupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateGroupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateGroupRequest) ProtoMessage() {} + +func (x *UpdateGroupRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_group_v1_group_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 UpdateGroupRequest.ProtoReflect.Descriptor instead. +func (*UpdateGroupRequest) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateGroupRequest) GetGid() int64 { + if x != nil { + return x.Gid + } + return 0 +} + +func (x *UpdateGroupRequest) GetName() string { + if x != nil && x.Name != nil { + return *x.Name + } + return "" +} + +func (x *UpdateGroupRequest) GetDescription() string { + if x != nil && x.Description != nil { + return *x.Description + } + return "" +} + +func (x *UpdateGroupRequest) GetAvatar() string { + if x != nil && x.Avatar != nil { + return *x.Avatar + } + return "" +} + +func (x *UpdateGroupRequest) GetOwnerUid() int64 { + if x != nil { + return x.OwnerUid + } + return 0 +} + +type UpdateGroupResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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() { + *x = UpdateGroupResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateGroupResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateGroupResponse) ProtoMessage() {} + +func (x *UpdateGroupResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_group_v1_group_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 UpdateGroupResponse.ProtoReflect.Descriptor instead. +func (*UpdateGroupResponse) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{9} +} + +func (x *UpdateGroupResponse) GetError() *errors.Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *UpdateGroupResponse) GetGroup() *Group { + if x != nil { + return x.Group + } + return nil +} + +type DeleteGroupRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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() { + *x = DeleteGroupRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteGroupRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteGroupRequest) ProtoMessage() {} + +func (x *DeleteGroupRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_group_v1_group_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 DeleteGroupRequest.ProtoReflect.Descriptor instead. +func (*DeleteGroupRequest) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{10} +} + +func (x *DeleteGroupRequest) GetGid() int64 { + if x != nil { + return x.Gid + } + return 0 +} + +func (x *DeleteGroupRequest) GetOwnerUid() int64 { + if x != nil { + return x.OwnerUid + } + return 0 +} + +// ChangeGroupMemberRequest add or remove group member +type ChangeGroupMemberRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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 *ChangeGroupMemberRequest) Reset() { + *x = ChangeGroupMemberRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeGroupMemberRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeGroupMemberRequest) ProtoMessage() {} + +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)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeGroupMemberRequest.ProtoReflect.Descriptor instead. +func (*ChangeGroupMemberRequest) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{11} +} + +func (x *ChangeGroupMemberRequest) GetGid() int64 { + if x != nil { + return x.Gid + } + return 0 +} + +func (x *ChangeGroupMemberRequest) GetOwnerUid() int64 { + if x != nil { + return x.OwnerUid + } + return 0 +} + +func (x *ChangeGroupMemberRequest) GetUids() []int64 { + if x != nil { + return x.Uids + } + return nil +} + +type ChangeGroupMemberResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + 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 *ChangeGroupMemberResponse) Reset() { + *x = ChangeGroupMemberResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_group_v1_group_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ChangeGroupMemberResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChangeGroupMemberResponse) ProtoMessage() {} + +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 { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ChangeGroupMemberResponse.ProtoReflect.Descriptor instead. +func (*ChangeGroupMemberResponse) Descriptor() ([]byte, []int) { + return file_user_group_v1_group_proto_rawDescGZIP(), []int{12} +} + +func (x *ChangeGroupMemberResponse) GetError() *errors.Error { + if x != nil { + return x.Error + } + return nil +} + +func (x *ChangeGroupMemberResponse) GetCount() int32 { + if x != nil { + return x.Count + } + return 0 +} + +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, 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, 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, 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, + 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, 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 ( + file_user_group_v1_group_proto_rawDescOnce sync.Once + file_user_group_v1_group_proto_rawDescData = file_user_group_v1_group_proto_rawDesc +) + +func file_user_group_v1_group_proto_rawDescGZIP() []byte { + file_user_group_v1_group_proto_rawDescOnce.Do(func() { + file_user_group_v1_group_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_group_v1_group_proto_rawDescData) + }) + return file_user_group_v1_group_proto_rawDescData +} + +var file_user_group_v1_group_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +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 + (GroupMember_Type)(0), // 2: api.user.group.v1.GroupMember.Type + (*Group)(nil), // 3: api.user.group.v1.Group + (*GroupMember)(nil), // 4: api.user.group.v1.GroupMember + (*GetGroupRequest)(nil), // 5: api.user.group.v1.GetGroupRequest + (*GetGroupResponse)(nil), // 6: api.user.group.v1.GetGroupResponse + (*ListGroupsRequest)(nil), // 7: api.user.group.v1.ListGroupsRequest + (*ListGroupsResponse)(nil), // 8: api.user.group.v1.ListGroupsResponse + (*CreateGroupRequest)(nil), // 9: api.user.group.v1.CreateGroupRequest + (*CreateGroupResponse)(nil), // 10: api.user.group.v1.CreateGroupResponse + (*UpdateGroupRequest)(nil), // 11: api.user.group.v1.UpdateGroupRequest + (*UpdateGroupResponse)(nil), // 12: api.user.group.v1.UpdateGroupResponse + (*DeleteGroupRequest)(nil), // 13: api.user.group.v1.DeleteGroupRequest + (*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 + 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 + 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 + 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 + 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 + 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 + 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() } +func file_user_group_v1_group_proto_init() { + if File_user_group_v1_group_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_group_v1_group_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Group); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_group_v1_group_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GroupMember); 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[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupRequest); 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[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGroupResponse); 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[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListGroupsRequest); 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[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListGroupsResponse); 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[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateGroupRequest); 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[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateGroupResponse); 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[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateGroupRequest); 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[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateGroupResponse); 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[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteGroupRequest); 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[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeGroupMemberRequest); 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[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ChangeGroupMemberResponse); i { case 0: return &v.state case 1: @@ -402,13 +1461,16 @@ 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: 2, - NumMessages: 2, + NumEnums: 3, + 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 44c000a..a17d46f 100644 --- a/user/group/v1/group.pb.validate.go +++ b/user/group/v1/group.pb.validate.go @@ -56,21 +56,88 @@ 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 // no validation rules for Description - // no validation rules for Type + // no validation rules for Avatar + + // no validation rules for OwnerUid + + for idx, item := range m.GetMembers() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GroupValidationError{ + field: fmt.Sprintf("Members[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GroupValidationError{ + field: fmt.Sprintf("Members[%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 GroupValidationError{ + field: fmt.Sprintf("Members[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + // no validation rules for MaxMembers + + // no validation rules for MemberCount // no validation rules for Status - // no validation rules for CreatedBy + if m.Owner != nil { - // no validation rules for CreatedAt + if all { + switch v := interface{}(m.GetOwner()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GroupValidationError{ + field: "Owner", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GroupValidationError{ + field: "Owner", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetOwner()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GroupValidationError{ + field: "Owner", + reason: "embedded message failed validation", + cause: err, + } + } + } - // no validation rules for UpdatedAt + } if len(errors) > 0 { return GroupMultiError(errors) @@ -149,40 +216,82 @@ var _ interface { ErrorName() string } = GroupValidationError{} -// Validate checks the field values on Empty with the rules defined in the -// proto definition for this message. If any rules are violated, the first +// Validate checks the field values on GroupMember 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 *Empty) Validate() error { +func (m *GroupMember) Validate() error { return m.validate(false) } -// ValidateAll checks the field values on Empty 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 EmptyMultiError, or nil if none found. -func (m *Empty) ValidateAll() error { +// ValidateAll checks the field values on GroupMember 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 GroupMemberMultiError, or +// nil if none found. +func (m *GroupMember) ValidateAll() error { return m.validate(true) } -func (m *Empty) validate(all bool) error { +func (m *GroupMember) validate(all bool) error { if m == nil { return nil } var errors []error + // no validation rules for Gid + + // no validation rules for Uid + + // no validation rules for Status + + // no validation rules for Type + + if m.User != nil { + + if all { + switch v := interface{}(m.GetUser()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GroupMemberValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GroupMemberValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetUser()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GroupMemberValidationError{ + field: "User", + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + if len(errors) > 0 { - return EmptyMultiError(errors) + return GroupMemberMultiError(errors) } return nil } -// EmptyMultiError is an error wrapping multiple validation errors returned by -// Empty.ValidateAll() if the designated constraints aren't met. -type EmptyMultiError []error +// GroupMemberMultiError is an error wrapping multiple validation errors +// returned by GroupMember.ValidateAll() if the designated constraints aren't met. +type GroupMemberMultiError []error // Error returns a concatenation of all the error messages it wraps. -func (m EmptyMultiError) Error() string { +func (m GroupMemberMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -191,11 +300,383 @@ func (m EmptyMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m EmptyMultiError) AllErrors() []error { return m } +func (m GroupMemberMultiError) AllErrors() []error { return m } -// EmptyValidationError is the validation error returned by Empty.Validate if -// the designated constraints aren't met. -type EmptyValidationError struct { +// GroupMemberValidationError is the validation error returned by +// GroupMember.Validate if the designated constraints aren't met. +type GroupMemberValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GroupMemberValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GroupMemberValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GroupMemberValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GroupMemberValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GroupMemberValidationError) ErrorName() string { return "GroupMemberValidationError" } + +// Error satisfies the builtin error interface +func (e GroupMemberValidationError) 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 %sGroupMember.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GroupMemberValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GroupMemberValidationError{} + +// Validate checks the field values on GetGroupRequest 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 *GetGroupRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetGroupRequest 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 +// GetGroupRequestMultiError, or nil if none found. +func (m *GetGroupRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *GetGroupRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []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) + } + + return nil +} + +// GetGroupRequestMultiError is an error wrapping multiple validation errors +// returned by GetGroupRequest.ValidateAll() if the designated constraints +// aren't met. +type GetGroupRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetGroupRequestMultiError) 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 GetGroupRequestMultiError) AllErrors() []error { return m } + +// GetGroupRequestValidationError is the validation error returned by +// GetGroupRequest.Validate if the designated constraints aren't met. +type GetGroupRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetGroupRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetGroupRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetGroupRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetGroupRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetGroupRequestValidationError) ErrorName() string { return "GetGroupRequestValidationError" } + +// Error satisfies the builtin error interface +func (e GetGroupRequestValidationError) 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 %sGetGroupRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetGroupRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetGroupRequestValidationError{} + +// Validate checks the field values on GetGroupResponse 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 *GetGroupResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on GetGroupResponse 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 +// GetGroupResponseMultiError, or nil if none found. +func (m *GetGroupResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *GetGroupResponse) 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, GetGroupResponseValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetGroupResponseValidationError{ + 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 GetGroupResponseValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetGroup()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, GetGroupResponseValidationError{ + field: "Group", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, GetGroupResponseValidationError{ + field: "Group", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGroup()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return GetGroupResponseValidationError{ + field: "Group", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return GetGroupResponseMultiError(errors) + } + + return nil +} + +// GetGroupResponseMultiError is an error wrapping multiple validation errors +// returned by GetGroupResponse.ValidateAll() if the designated constraints +// aren't met. +type GetGroupResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m GetGroupResponseMultiError) 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 GetGroupResponseMultiError) AllErrors() []error { return m } + +// GetGroupResponseValidationError is the validation error returned by +// GetGroupResponse.Validate if the designated constraints aren't met. +type GetGroupResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e GetGroupResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e GetGroupResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e GetGroupResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e GetGroupResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e GetGroupResponseValidationError) ErrorName() string { return "GetGroupResponseValidationError" } + +// Error satisfies the builtin error interface +func (e GetGroupResponseValidationError) 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 %sGetGroupResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = GetGroupResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = GetGroupResponseValidationError{} + +// Validate checks the field values on ListGroupsRequest 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 *ListGroupsRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListGroupsRequest 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 +// ListGroupsRequestMultiError, or nil if none found. +func (m *ListGroupsRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *ListGroupsRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Uid + + // no validation rules for Page + + // no validation rules for PageSize + + if len(errors) > 0 { + return ListGroupsRequestMultiError(errors) + } + + return nil +} + +// ListGroupsRequestMultiError is an error wrapping multiple validation errors +// returned by ListGroupsRequest.ValidateAll() if the designated constraints +// aren't met. +type ListGroupsRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListGroupsRequestMultiError) 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 ListGroupsRequestMultiError) AllErrors() []error { return m } + +// ListGroupsRequestValidationError is the validation error returned by +// ListGroupsRequest.Validate if the designated constraints aren't met. +type ListGroupsRequestValidationError struct { field string reason string cause error @@ -203,22 +684,1082 @@ type EmptyValidationError struct { } // Field function returns field value. -func (e EmptyValidationError) Field() string { return e.field } +func (e ListGroupsRequestValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e EmptyValidationError) Reason() string { return e.reason } +func (e ListGroupsRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e EmptyValidationError) Cause() error { return e.cause } +func (e ListGroupsRequestValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e EmptyValidationError) Key() bool { return e.key } +func (e ListGroupsRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e EmptyValidationError) ErrorName() string { return "EmptyValidationError" } +func (e ListGroupsRequestValidationError) ErrorName() string { + return "ListGroupsRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e ListGroupsRequestValidationError) 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 %sListGroupsRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListGroupsRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListGroupsRequestValidationError{} + +// Validate checks the field values on ListGroupsResponse 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 *ListGroupsResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on ListGroupsResponse 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 +// ListGroupsResponseMultiError, or nil if none found. +func (m *ListGroupsResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ListGroupsResponse) 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, ListGroupsResponseValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListGroupsResponseValidationError{ + 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 ListGroupsResponseValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + } + } + } + + for idx, item := range m.GetGroups() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, ListGroupsResponseValidationError{ + field: fmt.Sprintf("Groups[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ListGroupsResponseValidationError{ + field: fmt.Sprintf("Groups[%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 ListGroupsResponseValidationError{ + field: fmt.Sprintf("Groups[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + + if len(errors) > 0 { + return ListGroupsResponseMultiError(errors) + } + + return nil +} + +// ListGroupsResponseMultiError is an error wrapping multiple validation errors +// returned by ListGroupsResponse.ValidateAll() if the designated constraints +// aren't met. +type ListGroupsResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ListGroupsResponseMultiError) 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 ListGroupsResponseMultiError) AllErrors() []error { return m } + +// ListGroupsResponseValidationError is the validation error returned by +// ListGroupsResponse.Validate if the designated constraints aren't met. +type ListGroupsResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e ListGroupsResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ListGroupsResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ListGroupsResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ListGroupsResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ListGroupsResponseValidationError) ErrorName() string { + return "ListGroupsResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e ListGroupsResponseValidationError) 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 %sListGroupsResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ListGroupsResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ListGroupsResponseValidationError{} + +// Validate checks the field values on CreateGroupRequest 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 *CreateGroupRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateGroupRequest 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 +// CreateGroupRequestMultiError, or nil if none found. +func (m *CreateGroupRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateGroupRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Name + + // no validation rules for Description + + // no validation rules for Avatar + + // no validation rules for OwnerUid + + if len(errors) > 0 { + return CreateGroupRequestMultiError(errors) + } + + return nil +} + +// CreateGroupRequestMultiError is an error wrapping multiple validation errors +// returned by CreateGroupRequest.ValidateAll() if the designated constraints +// aren't met. +type CreateGroupRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateGroupRequestMultiError) 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 CreateGroupRequestMultiError) AllErrors() []error { return m } + +// CreateGroupRequestValidationError is the validation error returned by +// CreateGroupRequest.Validate if the designated constraints aren't met. +type CreateGroupRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateGroupRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateGroupRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateGroupRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateGroupRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateGroupRequestValidationError) ErrorName() string { + return "CreateGroupRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateGroupRequestValidationError) 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 %sCreateGroupRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateGroupRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateGroupRequestValidationError{} + +// Validate checks the field values on CreateGroupResponse 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 *CreateGroupResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on CreateGroupResponse 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 +// CreateGroupResponseMultiError, or nil if none found. +func (m *CreateGroupResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *CreateGroupResponse) 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, CreateGroupResponseValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateGroupResponseValidationError{ + 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 CreateGroupResponseValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetGroup()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, CreateGroupResponseValidationError{ + field: "Group", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, CreateGroupResponseValidationError{ + field: "Group", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGroup()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return CreateGroupResponseValidationError{ + field: "Group", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return CreateGroupResponseMultiError(errors) + } + + return nil +} + +// CreateGroupResponseMultiError is an error wrapping multiple validation +// errors returned by CreateGroupResponse.ValidateAll() if the designated +// constraints aren't met. +type CreateGroupResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m CreateGroupResponseMultiError) 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 CreateGroupResponseMultiError) AllErrors() []error { return m } + +// CreateGroupResponseValidationError is the validation error returned by +// CreateGroupResponse.Validate if the designated constraints aren't met. +type CreateGroupResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e CreateGroupResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e CreateGroupResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e CreateGroupResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e CreateGroupResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e CreateGroupResponseValidationError) ErrorName() string { + return "CreateGroupResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e CreateGroupResponseValidationError) 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 %sCreateGroupResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = CreateGroupResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = CreateGroupResponseValidationError{} + +// Validate checks the field values on UpdateGroupRequest 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 *UpdateGroupRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateGroupRequest 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 +// UpdateGroupRequestMultiError, or nil if none found. +func (m *UpdateGroupRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateGroupRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Gid + + // no validation rules for OwnerUid + + if m.Name != nil { + // no validation rules for Name + } + + if m.Description != nil { + // no validation rules for Description + } + + if m.Avatar != nil { + // no validation rules for Avatar + } + + if len(errors) > 0 { + return UpdateGroupRequestMultiError(errors) + } + + return nil +} + +// UpdateGroupRequestMultiError is an error wrapping multiple validation errors +// returned by UpdateGroupRequest.ValidateAll() if the designated constraints +// aren't met. +type UpdateGroupRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateGroupRequestMultiError) 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 UpdateGroupRequestMultiError) AllErrors() []error { return m } + +// UpdateGroupRequestValidationError is the validation error returned by +// UpdateGroupRequest.Validate if the designated constraints aren't met. +type UpdateGroupRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateGroupRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateGroupRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateGroupRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateGroupRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateGroupRequestValidationError) ErrorName() string { + return "UpdateGroupRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateGroupRequestValidationError) 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 %sUpdateGroupRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateGroupRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateGroupRequestValidationError{} + +// Validate checks the field values on UpdateGroupResponse 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 *UpdateGroupResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on UpdateGroupResponse 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 +// UpdateGroupResponseMultiError, or nil if none found. +func (m *UpdateGroupResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *UpdateGroupResponse) 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, UpdateGroupResponseValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateGroupResponseValidationError{ + 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 UpdateGroupResponseValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetGroup()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, UpdateGroupResponseValidationError{ + field: "Group", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, UpdateGroupResponseValidationError{ + field: "Group", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGroup()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return UpdateGroupResponseValidationError{ + field: "Group", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if len(errors) > 0 { + return UpdateGroupResponseMultiError(errors) + } + + return nil +} + +// UpdateGroupResponseMultiError is an error wrapping multiple validation +// errors returned by UpdateGroupResponse.ValidateAll() if the designated +// constraints aren't met. +type UpdateGroupResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m UpdateGroupResponseMultiError) 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 UpdateGroupResponseMultiError) AllErrors() []error { return m } + +// UpdateGroupResponseValidationError is the validation error returned by +// UpdateGroupResponse.Validate if the designated constraints aren't met. +type UpdateGroupResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e UpdateGroupResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e UpdateGroupResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e UpdateGroupResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e UpdateGroupResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e UpdateGroupResponseValidationError) ErrorName() string { + return "UpdateGroupResponseValidationError" +} + +// Error satisfies the builtin error interface +func (e UpdateGroupResponseValidationError) 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 %sUpdateGroupResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = UpdateGroupResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = UpdateGroupResponseValidationError{} + +// Validate checks the field values on DeleteGroupRequest 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 *DeleteGroupRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on DeleteGroupRequest 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 +// DeleteGroupRequestMultiError, or nil if none found. +func (m *DeleteGroupRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *DeleteGroupRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Gid + + // no validation rules for OwnerUid + + if len(errors) > 0 { + return DeleteGroupRequestMultiError(errors) + } + + return nil +} + +// DeleteGroupRequestMultiError is an error wrapping multiple validation errors +// returned by DeleteGroupRequest.ValidateAll() if the designated constraints +// aren't met. +type DeleteGroupRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m DeleteGroupRequestMultiError) 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 DeleteGroupRequestMultiError) AllErrors() []error { return m } + +// DeleteGroupRequestValidationError is the validation error returned by +// DeleteGroupRequest.Validate if the designated constraints aren't met. +type DeleteGroupRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e DeleteGroupRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e DeleteGroupRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e DeleteGroupRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e DeleteGroupRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e DeleteGroupRequestValidationError) ErrorName() string { + return "DeleteGroupRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e DeleteGroupRequestValidationError) 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 %sDeleteGroupRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = DeleteGroupRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = DeleteGroupRequestValidationError{} + +// 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 *ChangeGroupMemberRequest) Validate() error { + return m.validate(false) +} + +// 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 +// ChangeGroupMemberRequestMultiError, or nil if none found. +func (m *ChangeGroupMemberRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *ChangeGroupMemberRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + // no validation rules for Gid + + // no validation rules for OwnerUid + + if len(errors) > 0 { + return ChangeGroupMemberRequestMultiError(errors) + } + + return nil +} + +// ChangeGroupMemberRequestMultiError is an error wrapping multiple validation +// errors returned by ChangeGroupMemberRequest.ValidateAll() if the designated +// constraints aren't met. +type ChangeGroupMemberRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ChangeGroupMemberRequestMultiError) 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 ChangeGroupMemberRequestMultiError) AllErrors() []error { return m } + +// 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 + key bool +} + +// Field function returns field value. +func (e ChangeGroupMemberRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ChangeGroupMemberRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ChangeGroupMemberRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ChangeGroupMemberRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ChangeGroupMemberRequestValidationError) ErrorName() string { + return "ChangeGroupMemberRequestValidationError" +} + +// Error satisfies the builtin error interface +func (e ChangeGroupMemberRequestValidationError) 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 %sChangeGroupMemberRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = ChangeGroupMemberRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = ChangeGroupMemberRequestValidationError{} + +// 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 *ChangeGroupMemberResponse) Validate() error { + return m.validate(false) +} + +// 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 +// ChangeGroupMemberResponseMultiError, or nil if none found. +func (m *ChangeGroupMemberResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *ChangeGroupMemberResponse) 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, ChangeGroupMemberResponseValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, ChangeGroupMemberResponseValidationError{ + 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 ChangeGroupMemberResponseValidationError{ + field: "Error", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for Count + + if len(errors) > 0 { + return ChangeGroupMemberResponseMultiError(errors) + } + + return nil +} + +// ChangeGroupMemberResponseMultiError is an error wrapping multiple validation +// errors returned by ChangeGroupMemberResponse.ValidateAll() if the +// designated constraints aren't met. +type ChangeGroupMemberResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m ChangeGroupMemberResponseMultiError) 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 ChangeGroupMemberResponseMultiError) AllErrors() []error { return m } + +// 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 + key bool +} + +// Field function returns field value. +func (e ChangeGroupMemberResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e ChangeGroupMemberResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e ChangeGroupMemberResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e ChangeGroupMemberResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e ChangeGroupMemberResponseValidationError) ErrorName() string { + return "ChangeGroupMemberResponseValidationError" +} // Error satisfies the builtin error interface -func (e EmptyValidationError) Error() string { +func (e ChangeGroupMemberResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -230,14 +1771,14 @@ func (e EmptyValidationError) Error() string { } return fmt.Sprintf( - "invalid %sEmpty.%s: %s%s", + "invalid %sChangeGroupMemberResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = EmptyValidationError{} +var _ error = ChangeGroupMemberResponseValidationError{} var _ interface { Field() string @@ -245,4 +1786,4 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = EmptyValidationError{} +} = ChangeGroupMemberResponseValidationError{} diff --git a/user/group/v1/group.proto b/user/group/v1/group.proto index 9d99f65..79bf5ad 100644 --- a/user/group/v1/group.proto +++ b/user/group/v1/group.proto @@ -1,26 +1,23 @@ syntax = "proto3"; package api.user.group.v1; -option go_package = "github.com/go-goim/api/user/group/v1"; +import "errors/errors.proto"; import "user/v1/user.proto"; -message Group { - int64 id = 1; - string name = 2; - string description = 3; - GroupType type = 4; - GroupStatus status = 5; - string created_by = 6; - repeated string members = 7; - int64 created_at = 8; - int64 updated_at = 9; -} - +option go_package = "github.com/go-goim/api/user/group/v1"; -enum GroupType { - Normal = 0; - // more types +message Group { + int64 gid = 2; + string name = 3; + string description = 4; + string avatar = 5; + int64 owner_uid = 6; + optional GroupMember owner = 7; + repeated GroupMember members = 8; + int32 max_members = 9; + int32 member_count = 10; + GroupStatus status = 11; } enum GroupStatus { @@ -29,14 +26,107 @@ enum GroupStatus { // more statuses } -message Empty {} +message GroupMember { + int64 gid = 2; + int64 uid = 3; + optional user.v1.User user = 4; + enum Status { + StatusActive = 0; + StatusSilent = 1; + // more statuses + } + Status status = 5; + enum Type { + TypeOwner = 0; + TypeMember = 1; + // more types + } + Type type = 6; +} + +// GetGroup + +message GetGroupRequest { + int64 gid = 1; + int64 owner_uid = 2; + bool with_members = 3; + bool with_info = 4; +} + +message GetGroupResponse { + errors.Error error = 1; + Group group = 2; +} + +// ListGroups + +message ListGroupsRequest { + // list all groups no matter user is member or owner. + int64 uid = 1; + int32 page = 2; + int32 page_size = 3; +} + +message ListGroupsResponse { + errors.Error error = 1; + repeated Group groups = 2; +} + +// CreateGroup + +message CreateGroupRequest { + string name = 1; + string description = 2; + string avatar = 3; + int64 owner_uid = 4; + repeated int64 members_uid = 5; +} + +message CreateGroupResponse { + errors.Error error = 1; + Group group = 2; +} + +// UpdateGroup + +message UpdateGroupRequest { + int64 gid = 1; + optional string name = 2; + optional string description = 3; + optional string avatar = 4; + int64 owner_uid = 5; // current user id +} + +message UpdateGroupResponse { + errors.Error error = 1; + Group group = 2; +} + +// DeleteGroup + +message DeleteGroupRequest { + int64 gid = 1; + int64 owner_uid = 2; +} + +// ChangeGroupMemberRequest add or remove group member +message ChangeGroupMemberRequest { + int64 gid = 1; + int64 owner_uid = 2; + repeated int64 uids = 3; +} + +message ChangeGroupMemberResponse { + errors.Error error = 1; + int32 count = 2; // count of members changed +} service GroupService { - rpc GetGroup(Empty) returns (Group); - rpc CreateGroup(Empty) returns (Group); - rpc UpdateGroup(Empty) returns (Group); - rpc DeleteGroup(Empty) returns (Empty); - rpc GetGroupMembers(Empty) returns (user.v1.UserList); - rpc AddGroupMember(Empty) returns (Empty); - rpc RemoveGroupMember(Empty) returns (Empty); -} \ No newline at end of file + rpc GetGroup(GetGroupRequest) returns (GetGroupResponse); + rpc ListGroups(ListGroupsRequest) returns (ListGroupsResponse); + rpc CreateGroup(CreateGroupRequest) returns (CreateGroupResponse); + rpc UpdateGroup(UpdateGroupRequest) returns (UpdateGroupResponse); + 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 a417b1d..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" - v1 "github.com/go-goim/api/user/v1" + 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,17 +19,27 @@ 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. type GroupServiceClient interface { - GetGroup(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Group, error) - CreateGroup(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Group, error) - UpdateGroup(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Group, error) - DeleteGroup(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) - GetGroupMembers(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*v1.UserList, error) - AddGroupMember(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) - RemoveGroupMember(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) + GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*GetGroupResponse, error) + 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) (*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 { @@ -36,63 +50,63 @@ func NewGroupServiceClient(cc grpc.ClientConnInterface) GroupServiceClient { return &groupServiceClient{cc} } -func (c *groupServiceClient) GetGroup(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Group, error) { - out := new(Group) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/GetGroup", in, out, opts...) +func (c *groupServiceClient) GetGroup(ctx context.Context, in *GetGroupRequest, opts ...grpc.CallOption) (*GetGroupResponse, error) { + out := new(GetGroupResponse) + err := c.cc.Invoke(ctx, GroupService_GetGroup_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupServiceClient) CreateGroup(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Group, error) { - out := new(Group) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/CreateGroup", in, out, opts...) +func (c *groupServiceClient) ListGroups(ctx context.Context, in *ListGroupsRequest, opts ...grpc.CallOption) (*ListGroupsResponse, error) { + out := new(ListGroupsResponse) + err := c.cc.Invoke(ctx, GroupService_ListGroups_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupServiceClient) UpdateGroup(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Group, error) { - out := new(Group) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/UpdateGroup", in, out, opts...) +func (c *groupServiceClient) CreateGroup(ctx context.Context, in *CreateGroupRequest, opts ...grpc.CallOption) (*CreateGroupResponse, error) { + out := new(CreateGroupResponse) + err := c.cc.Invoke(ctx, GroupService_CreateGroup_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupServiceClient) DeleteGroup(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/DeleteGroup", in, out, opts...) +func (c *groupServiceClient) UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...grpc.CallOption) (*UpdateGroupResponse, error) { + out := new(UpdateGroupResponse) + err := c.cc.Invoke(ctx, GroupService_UpdateGroup_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *groupServiceClient) GetGroupMembers(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*v1.UserList, error) { - out := new(v1.UserList) - err := c.cc.Invoke(ctx, "/api.user.group.v1.GroupService/GetGroupMembers", 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 *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - 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 *Empty, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - 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 } @@ -103,13 +117,13 @@ func (c *groupServiceClient) RemoveGroupMember(ctx context.Context, in *Empty, o // All implementations must embed UnimplementedGroupServiceServer // for forward compatibility type GroupServiceServer interface { - GetGroup(context.Context, *Empty) (*Group, error) - CreateGroup(context.Context, *Empty) (*Group, error) - UpdateGroup(context.Context, *Empty) (*Group, error) - DeleteGroup(context.Context, *Empty) (*Empty, error) - GetGroupMembers(context.Context, *Empty) (*v1.UserList, error) - AddGroupMember(context.Context, *Empty) (*Empty, error) - RemoveGroupMember(context.Context, *Empty) (*Empty, error) + GetGroup(context.Context, *GetGroupRequest) (*GetGroupResponse, error) + ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) + CreateGroup(context.Context, *CreateGroupRequest) (*CreateGroupResponse, error) + UpdateGroup(context.Context, *UpdateGroupRequest) (*UpdateGroupResponse, error) + DeleteGroup(context.Context, *DeleteGroupRequest) (*errors.Error, error) + AddGroupMember(context.Context, *ChangeGroupMemberRequest) (*ChangeGroupMemberResponse, error) + RemoveGroupMember(context.Context, *ChangeGroupMemberRequest) (*ChangeGroupMemberResponse, error) mustEmbedUnimplementedGroupServiceServer() } @@ -117,25 +131,25 @@ type GroupServiceServer interface { type UnimplementedGroupServiceServer struct { } -func (UnimplementedGroupServiceServer) GetGroup(context.Context, *Empty) (*Group, error) { +func (UnimplementedGroupServiceServer) GetGroup(context.Context, *GetGroupRequest) (*GetGroupResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetGroup not implemented") } -func (UnimplementedGroupServiceServer) CreateGroup(context.Context, *Empty) (*Group, error) { +func (UnimplementedGroupServiceServer) ListGroups(context.Context, *ListGroupsRequest) (*ListGroupsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListGroups not implemented") +} +func (UnimplementedGroupServiceServer) CreateGroup(context.Context, *CreateGroupRequest) (*CreateGroupResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateGroup not implemented") } -func (UnimplementedGroupServiceServer) UpdateGroup(context.Context, *Empty) (*Group, error) { +func (UnimplementedGroupServiceServer) UpdateGroup(context.Context, *UpdateGroupRequest) (*UpdateGroupResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateGroup not implemented") } -func (UnimplementedGroupServiceServer) DeleteGroup(context.Context, *Empty) (*Empty, error) { +func (UnimplementedGroupServiceServer) DeleteGroup(context.Context, *DeleteGroupRequest) (*errors.Error, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteGroup not implemented") } -func (UnimplementedGroupServiceServer) GetGroupMembers(context.Context, *Empty) (*v1.UserList, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetGroupMembers not implemented") -} -func (UnimplementedGroupServiceServer) AddGroupMember(context.Context, *Empty) (*Empty, error) { +func (UnimplementedGroupServiceServer) AddGroupMember(context.Context, *ChangeGroupMemberRequest) (*ChangeGroupMemberResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddGroupMember not implemented") } -func (UnimplementedGroupServiceServer) RemoveGroupMember(context.Context, *Empty) (*Empty, error) { +func (UnimplementedGroupServiceServer) RemoveGroupMember(context.Context, *ChangeGroupMemberRequest) (*ChangeGroupMemberResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveGroupMember not implemented") } func (UnimplementedGroupServiceServer) mustEmbedUnimplementedGroupServiceServer() {} @@ -152,7 +166,7 @@ func RegisterGroupServiceServer(s grpc.ServiceRegistrar, srv GroupServiceServer) } func _GroupService_GetGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) + in := new(GetGroupRequest) if err := dec(in); err != nil { return nil, err } @@ -161,88 +175,88 @@ 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.(*Empty)) + return srv.(GroupServiceServer).GetGroup(ctx, req.(*GetGroupRequest)) } return interceptor(ctx, in, info, handler) } -func _GroupService_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) +func _GroupService_ListGroups_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListGroupsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(GroupServiceServer).CreateGroup(ctx, in) + return srv.(GroupServiceServer).ListGroups(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/CreateGroup", + FullMethod: GroupService_ListGroups_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).CreateGroup(ctx, req.(*Empty)) + return srv.(GroupServiceServer).ListGroups(ctx, req.(*ListGroupsRequest)) } return interceptor(ctx, in, info, handler) } -func _GroupService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) +func _GroupService_CreateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateGroupRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(GroupServiceServer).UpdateGroup(ctx, in) + return srv.(GroupServiceServer).CreateGroup(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/UpdateGroup", + FullMethod: GroupService_CreateGroup_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).UpdateGroup(ctx, req.(*Empty)) + return srv.(GroupServiceServer).CreateGroup(ctx, req.(*CreateGroupRequest)) } return interceptor(ctx, in, info, handler) } -func _GroupService_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) +func _GroupService_UpdateGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateGroupRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(GroupServiceServer).DeleteGroup(ctx, in) + return srv.(GroupServiceServer).UpdateGroup(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/DeleteGroup", + FullMethod: GroupService_UpdateGroup_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).DeleteGroup(ctx, req.(*Empty)) + return srv.(GroupServiceServer).UpdateGroup(ctx, req.(*UpdateGroupRequest)) } return interceptor(ctx, in, info, handler) } -func _GroupService_GetGroupMembers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) +func _GroupService_DeleteGroup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteGroupRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(GroupServiceServer).GetGroupMembers(ctx, in) + return srv.(GroupServiceServer).DeleteGroup(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/api.user.group.v1.GroupService/GetGroupMembers", + FullMethod: GroupService_DeleteGroup_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(GroupServiceServer).GetGroupMembers(ctx, req.(*Empty)) + return srv.(GroupServiceServer).DeleteGroup(ctx, req.(*DeleteGroupRequest)) } return interceptor(ctx, in, info, handler) } func _GroupService_AddGroupMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) + 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.(*Empty)) + 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(Empty) + 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.(*Empty)) + return srv.(GroupServiceServer).RemoveGroupMember(ctx, req.(*ChangeGroupMemberRequest)) } return interceptor(ctx, in, info, handler) } @@ -288,6 +302,10 @@ var GroupService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetGroup", Handler: _GroupService_GetGroup_Handler, }, + { + MethodName: "ListGroups", + Handler: _GroupService_ListGroups_Handler, + }, { MethodName: "CreateGroup", Handler: _GroupService_CreateGroup_Handler, @@ -300,10 +318,6 @@ var GroupService_ServiceDesc = grpc.ServiceDesc{ MethodName: "DeleteGroup", Handler: _GroupService_DeleteGroup_Handler, }, - { - MethodName: "GetGroupMembers", - Handler: _GroupService_GetGroupMembers_Handler, - }, { MethodName: "AddGroupMember", Handler: _GroupService_AddGroupMember_Handler, diff --git a/user/session/v1/session.pb.go b/user/session/v1/session.pb.go deleted file mode 100644 index 2b5cfa7..0000000 --- a/user/session/v1/session.pb.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc v3.19.4 -// 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 -) - -// Enum value maps for SessionType. -var ( - SessionType_name = map[int32]string{ - 0: "SingleChat", - 1: "GroupChat", - } - SessionType_value = map[string]int32{ - "SingleChat": 0, - "GroupChat": 1, - } -) - -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, 0x2c, 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, 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 5f3c6bb..0000000 --- a/user/session/v1/session.proto +++ /dev/null @@ -1,11 +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; -} -// more session message type \ No newline at end of file diff --git a/user/v1/user.ext.go b/user/v1/user.ext.go deleted file mode 100644 index bac2682..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.GetEmail(), - Phone: x.GetPhone(), - Avatar: x.GetAvatar(), - ConnectUrl: x.PushServerIp, - LoginStatus: x.GetLoginStatus(), - } -} diff --git a/user/v1/user.pb.go b/user/v1/user.pb.go index 0dac113..cf56068 100644 --- a/user/v1/user.pb.go +++ b/user/v1/user.pb.go @@ -1,14 +1,14 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.0 -// protoc v3.19.4 +// protoc-gen-go v1.34.1 +// protoc (unknown) // source: user/v1/user.proto 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" 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"` - // 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 { - return x.Email - } - return "" -} - -func (x *User) GetPhone() string { - if x != 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, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, - 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 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,102 +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, 0xe3, 0x01, 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, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, - 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, - 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, 0x00, 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, 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 ( @@ -992,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() } @@ -1036,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: @@ -1048,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 @@ -1071,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 @@ -1083,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 @@ -1095,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 @@ -1107,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 @@ -1119,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 @@ -1131,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 @@ -1145,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), } @@ -1164,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 840cc0b..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,19 +116,18 @@ func (m *UserInternalResponse) validate(all bool) error { } if len(errors) > 0 { - return UserInternalResponseMultiError(errors) + return UserResponseMultiError(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 +// 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 UserInternalResponseMultiError) Error() string { +func (m UserResponseMultiError) Error() string { var msgs []string for _, err := range m { msgs = append(msgs, err.Error()) @@ -137,11 +136,11 @@ func (m UserInternalResponseMultiError) Error() string { } // AllErrors returns a list of validation violation errors. -func (m UserInternalResponseMultiError) AllErrors() []error { return m } +func (m UserResponseMultiError) AllErrors() []error { return m } -// UserInternalResponseValidationError is the validation error returned by -// UserInternalResponse.Validate if the designated constraints aren't met. -type UserInternalResponseValidationError 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 @@ -149,24 +148,22 @@ type UserInternalResponseValidationError struct { } // Field function returns field value. -func (e UserInternalResponseValidationError) Field() string { return e.field } +func (e UserResponseValidationError) Field() string { return e.field } // Reason function returns reason value. -func (e UserInternalResponseValidationError) Reason() string { return e.reason } +func (e UserResponseValidationError) Reason() string { return e.reason } // Cause function returns cause value. -func (e UserInternalResponseValidationError) Cause() error { return e.cause } +func (e UserResponseValidationError) Cause() error { return e.cause } // Key function returns key value. -func (e UserInternalResponseValidationError) Key() bool { return e.key } +func (e UserResponseValidationError) Key() bool { return e.key } // ErrorName returns error name. -func (e UserInternalResponseValidationError) ErrorName() string { - return "UserInternalResponseValidationError" -} +func (e UserResponseValidationError) ErrorName() string { return "UserResponseValidationError" } // Error satisfies the builtin error interface -func (e UserInternalResponseValidationError) Error() string { +func (e UserResponseValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) @@ -178,14 +175,14 @@ func (e UserInternalResponseValidationError) Error() string { } return fmt.Sprintf( - "invalid %sUserInternalResponse.%s: %s%s", + "invalid %sUserResponse.%s: %s%s", key, e.field, e.reason, cause) } -var _ error = UserInternalResponseValidationError{} +var _ error = UserResponseValidationError{} var _ interface { Field() string @@ -193,24 +190,23 @@ var _ interface { Key() bool Cause() error ErrorName() string -} = UserInternalResponseValidationError{} +} = UserResponseValidationError{} -// 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 { +// 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 +// encountered is returned, or nil if there are no violations. +func (m *User) 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 { +// ValidateAll checks the field values on User 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 UserMultiError, or nil if none found. +func (m *User) ValidateAll() error { return m.validate(true) } -func (m *UserInternal) validate(all bool) error { +func (m *User) validate(all bool) error { if m == nil { return nil } @@ -243,120 +239,6 @@ func (m *UserInternal) validate(all bool) error { // no validation rules for PushServerIp } - if len(errors) > 0 { - return UserInternalMultiError(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 - -// Error returns a concatenation of all the error messages it wraps. -func (m UserInternalMultiError) 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 UserInternalMultiError) AllErrors() []error { return m } - -// UserInternalValidationError is the validation error returned by -// UserInternal.Validate if the designated constraints aren't met. -type UserInternalValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UserInternalValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UserInternalValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UserInternalValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UserInternalValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UserInternalValidationError) ErrorName() string { return "UserInternalValidationError" } - -// Error satisfies the builtin error interface -func (e UserInternalValidationError) 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 %sUserInternal.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UserInternalValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UserInternalValidationError{} - -// 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 -// encountered is returned, or nil if there are no violations. -func (m *User) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on User 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 UserMultiError, or nil if none found. -func (m *User) ValidateAll() error { - return m.validate(true) -} - -func (m *User) 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 Email - - // no validation rules for Phone - - // no validation rules for Avatar - - // no validation rules for LoginStatus - - if m.ConnectUrl != nil { - // no validation rules for ConnectUrl - } - if len(errors) > 0 { return UserMultiError(errors) } @@ -589,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 @@ -702,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{ @@ -719,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{ @@ -732,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 { @@ -917,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{ @@ -934,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{ @@ -947,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 { @@ -1112,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 @@ -1184,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) } @@ -1342,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{ @@ -1359,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{ @@ -1372,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 6e9e0ba..54b0ea5 100644 --- a/user/v1/user.proto +++ b/user/v1/user.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package api.user.v1; -option go_package = "github.com/go-goim/api/user/v1"; +// import api/transport/v1/http.proto; +import "errors/errors.proto"; import "validate/validate.proto"; -// import api/transport/v1/http.proto; -import "transport/response/response.proto"; +option go_package = "github.com/go-goim/api/user/v1"; enum LoginStatus { LOGIN = 0; @@ -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,71 +35,81 @@ message UserInternal { int64 updated_at = 10; } -// User use for return user info to client. -message User { - string uid = 1; - string name = 2; - string email = 3; - 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}$"]; } } - message CreateUserRequest { - string name = 1 [(validate.rules).string = {min_len: 2, max_len: 20}]; - oneof user { + string name = 1 [(validate.rules).string = { + min_len: 2, + max_len: 20 + }]; + 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}$"]; } - string password = 4 [(validate.rules).string = {min_len: 6, max_len: 20}]; + string password = 4 [(validate.rules).string = { + min_len: 6, + max_len: 20 + }]; } message UpdateUserRequest { - string uid = 1 [(validate.rules).string = {min_len: 20, max_len: 24}]; - string name = 2 [(validate.rules).string = {min_len: 2, max_len: 20, ignore_empty: true}]; - string email = 3 [(validate.rules).string = {email: true,ignore_empty: true}]; - string phone = 4 [(validate.rules).string = {pattern: "^1[3-9]\\d{9}$", ignore_empty: true}]; - string avatar = 5 [(validate.rules).string = {max_len:128, ignore_empty: true}]; + int64 uid = 1 [(validate.rules).int64 = { + gt: 0 + }]; + string name = 2 [(validate.rules).string = { + min_len: 2, + max_len: 20, + ignore_empty: true + }]; + string email = 3 [(validate.rules).string = { + email: true, + ignore_empty: true + }]; + string phone = 4 [(validate.rules).string = { + pattern: "^1[3-9]\\d{9}$", + ignore_empty: true + }]; + string avatar = 5 [(validate.rules).string = { + 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))