rename cmd foldor

This commit is contained in:
zhuyasen 2022-11-11 22:54:22 +08:00
parent 92ce2e60ff
commit d665bfa30b
36 changed files with 986 additions and 472 deletions

9
.gitignore vendored
View File

@ -22,11 +22,14 @@ dist/
*.ipr
*.iws
cmd/serverNameExample_mixExample/serverNameExample_mixExample*
cmd/serverNameExample/serverNameExample
# delete the templates code start
cmd/sponge/sponge
cmd/protoc-gen-go-gin/protoc-gen-go-gin
cmd/serverNameExample_grpcExample/serverNameExample_grpcExample
cmd/serverNameExample_gwExample/serverNameExample_gwExample
cmd/serverNameExample_grpcPbExample/serverNameExample_grpcPbExample
cmd/serverNameExample_httpExample/serverNameExample_httpExample
cmd/serverNameExample_grpcGwPbExample/serverNameExample_grpcGwPbExample
cmd/serverNameExample_httpPbExample/serverNameExample_httpPbExample
cmd/serverNameExample_mixExample/serverNameExample_mixExample
cmd/sponge/sponge
# delete the templates code end

View File

@ -10,11 +10,8 @@
package v1
import (
_ "github.com/envoyproxy/protoc-gen-validate/validate"
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
_ "github.com/srikrsna/protoc-gen-gotag/tagger"
types "github.com/zhufuyi/sponge/api/types"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@ -913,192 +910,191 @@ var file_api_serverNameExample_v1_userExample_proto_rawDesc = []byte{
0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72,
0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76,
0x31, 0x2e, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x42, 0x08, 0xfa, 0x42,
0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x31,
0x05, 0x82, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x28,
0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x04, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x52, 0x02, 0x69,
0x64, 0x22, 0x44, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x24, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xfa,
0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x9a, 0x84, 0x9e, 0x03, 0x08, 0x75, 0x72, 0x69, 0x3a, 0x22,
0x69, 0x64, 0x22, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44,
0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0xbb, 0x02, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x04, 0x42, 0x14, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x9a, 0x84, 0x9e, 0x03, 0x08,
0x75, 0x72, 0x69, 0x3a, 0x22, 0x69, 0x64, 0x22, 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, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f,
0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f,
0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x44, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49,
0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x9a, 0x84, 0x9e,
0x03, 0x08, 0x75, 0x72, 0x69, 0x3a, 0x22, 0x69, 0x64, 0x22, 0x52, 0x02, 0x69, 0x64, 0x22, 0x1c,
0x0a, 0x1a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0xbb, 0x02, 0x0a,
0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xfa, 0x42, 0x04, 0x32, 0x02,
0x28, 0x01, 0x9a, 0x84, 0x9e, 0x03, 0x08, 0x75, 0x72, 0x69, 0x3a, 0x22, 0x69, 0x64, 0x22, 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, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a,
0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f,
0x6e, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12,
0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52,
0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x07,
0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x67, 0x65, 0x6e,
0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52,
0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28,
0x03, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x74, 0x22, 0x1c, 0x0a, 0x1a, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42,
0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0xb6, 0x02, 0x0a, 0x0b, 0x55, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x04, 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, 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, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72,
0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61,
0x67, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01,
0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72,
0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61,
0x67, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e,
0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65,
0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72,
0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05,
0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05,
0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x69,
0x6e, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x69,
0x6e, 0x41, 0x74, 0x22, 0x1c, 0x0a, 0x1a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c,
0x79, 0x22, 0xb6, 0x02, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 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, 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, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65,
0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x3c, 0x0a, 0x06, 0x67,
0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70,
0x65, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61,
0x74, 0x75, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20,
0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a,
0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 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, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52,
0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x41, 0x0a, 0x19, 0x47, 0x65,
0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x04, 0x42, 0x14, 0xfa, 0x42, 0x04, 0x32, 0x02, 0x28, 0x01, 0x9a, 0x84, 0x9e, 0x03,
0x08, 0x75, 0x72, 0x69, 0x3a, 0x22, 0x69, 0x64, 0x22, 0x52, 0x02, 0x69, 0x64, 0x22, 0x62, 0x0a,
0x17, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42,
0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x47, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x22, 0x2f, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x03, 0x69,
0x64, 0x73, 0x22, 0x66, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12,
0x49, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0c, 0x75, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x22, 0x49, 0x0a, 0x16, 0x4c, 0x69,
0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x72,
0x61, 0x6d, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70,
0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x77, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a,
0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f,
0x74, 0x61, 0x6c, 0x12, 0x49, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x52, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2a, 0x2f,
0x0a, 0x0a, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07,
0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x41, 0x4c,
0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x45, 0x4d, 0x41, 0x4c, 0x45, 0x10, 0x02, 0x32,
0xff, 0x0a, 0x0a, 0x12, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xd0, 0x01, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x12, 0x32, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61,
0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31,
0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x60, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22,
0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x01, 0x2a, 0x92, 0x41, 0x3f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x11, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0x75,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x1a, 0x1d, 0xe6, 0x8f, 0x90, 0xe4,
0xba, 0xa4, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0x75, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0xda, 0x01, 0x0a, 0x0a, 0x44, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x42, 0x79, 0x49, 0x44, 0x12, 0x36, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73,
0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x34, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d,
0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49,
0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x5e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18,
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x92, 0x41, 0x3b, 0x0a, 0x0b, 0x75, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x11, 0xe5, 0x88, 0xa0, 0xe9, 0x99, 0xa4,
0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x1a, 0x19, 0xe6, 0xa0, 0xb9,
0xe6, 0x8d, 0xae, 0x69, 0x64, 0xe5, 0x88, 0xa0, 0xe9, 0x99, 0xa4, 0x75, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0xe9, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x42, 0x79, 0x49, 0x44, 0x12, 0x36, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31,
0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x22, 0x6d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x1a, 0x18, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x92, 0x41, 0x47, 0x0a, 0x0b, 0x75, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x17, 0xe6, 0x9b, 0xb4, 0xe6, 0x96, 0xb0,
0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0xe4, 0xbf, 0xa1, 0xe6, 0x81,
0xaf, 0x1a, 0x1f, 0xe6, 0xa0, 0xb9, 0xe6, 0x8d, 0xae, 0x69, 0x64, 0xe6, 0x9b, 0xb4, 0xe6, 0x96,
0xb0, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0xe4, 0xbf, 0xa1, 0xe6,
0x81, 0xaf, 0x12, 0xdd, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x42, 0x79, 0x49, 0x44, 0x12, 0x33,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47,
0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49,
0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x6a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18,
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x92, 0x41, 0x47, 0x0a, 0x0b, 0x75, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x17, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96,
0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0xe8, 0xaf, 0xa6, 0xe6, 0x83,
0x85, 0x1a, 0x1f, 0xe6, 0xa0, 0xb9, 0xe6, 0x8d, 0xae, 0x69, 0x64, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f,
0x96, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0xe8, 0xaf, 0xa6, 0xe6,
0x83, 0x85, 0x12, 0x8e, 0x02, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x49, 0x44, 0x73,
0x12, 0x35, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d,
0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,
0x6e, 0x5f, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x69,
0x6e, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61,
0x74, 0x18, 0x0a, 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, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41,
0x74, 0x22, 0x41, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24,
0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x14, 0xfa, 0x42, 0x04, 0x32,
0x02, 0x28, 0x01, 0x9a, 0x84, 0x9e, 0x03, 0x08, 0x75, 0x72, 0x69, 0x3a, 0x22, 0x69, 0x64, 0x22,
0x52, 0x02, 0x69, 0x64, 0x22, 0x62, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12,
0x47, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e,
0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0b, 0x75, 0x73, 0x65,
0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x22, 0x2f, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74,
0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x04, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x66, 0x0a, 0x19, 0x4c, 0x69, 0x73,
0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44,
0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x49, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x73, 0x22, 0x49, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x06, 0x70,
0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x74, 0x79,
0x70, 0x65, 0x73, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a,
0x01, 0x02, 0x10, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x77, 0x0a, 0x14,
0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x49, 0x0a, 0x0c, 0x75, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x25, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d,
0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2a, 0x2f, 0x0a, 0x0a, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x54,
0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00,
0x12, 0x08, 0x0a, 0x04, 0x4d, 0x41, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x45,
0x4d, 0x41, 0x4c, 0x45, 0x10, 0x02, 0x32, 0xff, 0x0a, 0x0a, 0x12, 0x75, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xd0, 0x01,
0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x32, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73,
0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x60,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x22, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f,
0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x3a, 0x01, 0x2a, 0x92, 0x41,
0x3f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x11,
0xe5, 0x88, 0x9b, 0xe5, 0xbb, 0xba, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x1a, 0x1d, 0xe6, 0x8f, 0x90, 0xe4, 0xba, 0xa4, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0xe5,
0x88, 0x9b, 0xe5, 0xbb, 0xba, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x12, 0xda, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x79, 0x49, 0x44, 0x12,
0x36, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e,
0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x5e, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x92,
0x41, 0x3b, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12,
0x11, 0xe5, 0x88, 0xa0, 0xe9, 0x99, 0xa4, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x1a, 0x19, 0xe6, 0xa0, 0xb9, 0xe6, 0x8d, 0xae, 0x69, 0x64, 0xe5, 0x88, 0xa0, 0xe9,
0x99, 0xa4, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0xe9, 0x01,
0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x79, 0x49, 0x44, 0x12, 0x36, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x6d, 0x82, 0xd3, 0xe4, 0x93,
0x02, 0x1d, 0x1a, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x92,
0x41, 0x47, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12,
0x17, 0xe6, 0x9b, 0xb4, 0xe6, 0x96, 0xb0, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x1a, 0x1f, 0xe6, 0xa0, 0xb9, 0xe6, 0x8d, 0xae,
0x69, 0x64, 0xe6, 0x9b, 0xb4, 0xe6, 0x96, 0xb0, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0xe4, 0xbf, 0xa1, 0xe6, 0x81, 0xaf, 0x12, 0xdd, 0x01, 0x0a, 0x07, 0x47, 0x65,
0x74, 0x42, 0x79, 0x49, 0x44, 0x12, 0x33, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31,
0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42,
0x79, 0x49, 0x44, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x6a, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x92,
0x41, 0x47, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12,
0x17, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0xe8, 0xaf, 0xa6, 0xe6, 0x83, 0x85, 0x1a, 0x1f, 0xe6, 0xa0, 0xb9, 0xe6, 0x8d, 0xae,
0x69, 0x64, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0xe8, 0xaf, 0xa6, 0xe6, 0x83, 0x85, 0x12, 0x8e, 0x02, 0x0a, 0x09, 0x4c, 0x69,
0x73, 0x74, 0x42, 0x79, 0x49, 0x44, 0x73, 0x12, 0x35, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65,
0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e,
0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x94, 0x01, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x2f, 0x69, 0x64, 0x73, 0x3a,
0x01, 0x2a, 0x92, 0x41, 0x6e, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x12, 0x25, 0xe6, 0xa0, 0xb9, 0xe6, 0x8d, 0xae, 0xe5, 0xa4, 0x9a, 0xe4, 0xb8, 0xaa,
0x69, 0x64, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0xe5, 0x88, 0x97, 0xe8, 0xa1, 0xa8, 0x1a, 0x38, 0xe4, 0xbd, 0xbf, 0xe7, 0x94,
0xa8, 0x70, 0x6f, 0x73, 0x74, 0xe8, 0xaf, 0xb7, 0xe6, 0xb1, 0x82, 0xef, 0xbc, 0x8c, 0xe6, 0xa0,
0xb9, 0xe6, 0x8d, 0xae, 0xe5, 0xa4, 0x9a, 0xe4, 0xb8, 0xaa, 0x69, 0x64, 0xe8, 0x8e, 0xb7, 0xe5,
0x8f, 0x96, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0xe5, 0x88, 0x97,
0xe8, 0xa1, 0xa8, 0x12, 0xdb, 0x01, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x30, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72,
0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e,
0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x71,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x22, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f,
0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x92,
0x41, 0x4f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12,
0x17, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0xe5, 0x88, 0x97, 0xe8, 0xa1, 0xa8, 0x1a, 0x27, 0xe4, 0xbd, 0xbf, 0xe7, 0x94, 0xa8,
0x70, 0x6f, 0x73, 0x74, 0xe8, 0xaf, 0xb7, 0xe6, 0xb1, 0x82, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96,
0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0xe5, 0x88, 0x97, 0xe8, 0xa1,
0xa8, 0x42, 0x98, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x7a, 0x68, 0x75, 0x66, 0x75, 0x79, 0x69, 0x2f, 0x73, 0x70, 0x6f, 0x6e, 0x67, 0x65, 0x2f,
0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78,
0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, 0x92, 0x41, 0x5e, 0x12, 0x24,
0x0a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d,
0x70, 0x6c, 0x65, 0x20, 0x61, 0x70, 0x69, 0x20, 0x64, 0x6f, 0x63, 0x73, 0x32, 0x06, 0x76, 0x30,
0x2e, 0x30, 0x2e, 0x30, 0x1a, 0x0e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x3a,
0x38, 0x30, 0x38, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x42, 0x79, 0x49, 0x44, 0x73, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x22, 0x94, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c,
0x65, 0x73, 0x2f, 0x69, 0x64, 0x73, 0x3a, 0x01, 0x2a, 0x92, 0x41, 0x6e, 0x0a, 0x0b, 0x75, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x25, 0xe6, 0xa0, 0xb9, 0xe6, 0x8d,
0xae, 0xe5, 0xa4, 0x9a, 0xe4, 0xb8, 0xaa, 0x69, 0x64, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0x75,
0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0xe5, 0x88, 0x97, 0xe8, 0xa1, 0xa8,
0x1a, 0x38, 0xe4, 0xbd, 0xbf, 0xe7, 0x94, 0xa8, 0x70, 0x6f, 0x73, 0x74, 0xe8, 0xaf, 0xb7, 0xe6,
0xb1, 0x82, 0xef, 0xbc, 0x8c, 0xe6, 0xa0, 0xb9, 0xe6, 0x8d, 0xae, 0xe5, 0xa4, 0x9a, 0xe4, 0xb8,
0xaa, 0x69, 0x64, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61,
0x6d, 0x70, 0x6c, 0x65, 0xe5, 0x88, 0x97, 0xe8, 0xa1, 0xa8, 0x12, 0xdb, 0x01, 0x0a, 0x04, 0x4c,
0x69, 0x73, 0x74, 0x12, 0x30, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72,
0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c,
0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x73, 0x65, 0x72, 0x76,
0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x76, 0x31,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x71, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x22, 0x14, 0x2f,
0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x73, 0x3a, 0x01, 0x2a, 0x92, 0x41, 0x4f, 0x0a, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x45,
0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x12, 0x17, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0x75, 0x73,
0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0xe5, 0x88, 0x97, 0xe8, 0xa1, 0xa8, 0x1a,
0x27, 0xe4, 0xbd, 0xbf, 0xe7, 0x94, 0xa8, 0x70, 0x6f, 0x73, 0x74, 0xe8, 0xaf, 0xb7, 0xe6, 0xb1,
0x82, 0xe8, 0x8e, 0xb7, 0xe5, 0x8f, 0x96, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0xe5, 0x88, 0x97, 0xe8, 0xa1, 0xa8, 0x42, 0x98, 0x01, 0x5a, 0x35, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x7a, 0x68, 0x75, 0x66, 0x75, 0x79, 0x69, 0x2f,
0x73, 0x70, 0x6f, 0x6e, 0x67, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65,
0x72, 0x4e, 0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b,
0x76, 0x31, 0x92, 0x41, 0x5e, 0x12, 0x24, 0x0a, 0x1a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4e,
0x61, 0x6d, 0x65, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x61, 0x70, 0x69, 0x20, 0x64,
0x6f, 0x63, 0x73, 0x32, 0x06, 0x76, 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x1a, 0x0e, 0x6c, 0x6f, 0x63,
0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x3a, 0x38, 0x30, 0x38, 0x30, 0x2a, 0x02, 0x01, 0x02, 0x32,
0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f,
0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a,
0x73, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -299,16 +299,7 @@ func (m *CreateUserExampleReply) validate(all bool) error {
var errors []error
if m.GetId() < 1 {
err := CreateUserExampleReplyValidationError{
field: "Id",
reason: "value must be greater than or equal to 1",
}
if !all {
return err
}
errors = append(errors, err)
}
// no validation rules for Id
if len(errors) > 0 {
return CreateUserExampleReplyMultiError(errors)

View File

@ -23,7 +23,7 @@ func RegisterServers() []app.IServer {
// 创建http服务
httpAddr := ":" + strconv.Itoa(cfg.HTTP.Port)
httpRegistry, httpInstance := registryService("http", cfg.App.Host, cfg.HTTP.Port)
httpServer := server.NewHTTPServer(httpAddr,
httpServer := server.NewHTTPServer_pbExample(httpAddr,
server.WithHTTPReadTimeout(time.Second*time.Duration(cfg.HTTP.ReadTimeout)),
server.WithHTTPWriteTimeout(time.Second*time.Duration(cfg.HTTP.WriteTimeout)),
server.WithHTTPRegistry(httpRegistry, httpInstance),

View File

@ -0,0 +1,16 @@
package main
import (
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcGwPbExample/initial"
"github.com/zhufuyi/sponge/pkg/app"
)
func main() {
initial.Config()
servers := initial.RegisterServers()
closes := initial.RegisterClose(servers)
a := app.New(servers, closes)
a.Run()
}

View File

@ -0,0 +1,104 @@
package initial
import (
"flag"
"fmt"
"strconv"
"github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/nacoscli"
"github.com/zhufuyi/sponge/pkg/stat"
"github.com/zhufuyi/sponge/pkg/tracer"
"github.com/jinzhu/copier"
)
var (
version string
configFile string
enableConfigCenter bool
)
// Config 初始化配置
func Config() {
initConfig()
cfg := config.Get()
// 初始化日志
_, _ = logger.Init(
logger.WithLevel(cfg.Logger.Level),
logger.WithFormat(cfg.Logger.Format),
logger.WithSave(cfg.Logger.IsSave),
)
// 初始化数据库
//model.InitMysql()
//model.InitCache(cfg.App.CacheType)
// 初始化链路跟踪
if cfg.App.EnableTracing {
tracer.InitWithConfig(
cfg.App.Name,
cfg.App.Env,
cfg.App.Version,
cfg.Jaeger.AgentHost,
strconv.Itoa(cfg.Jaeger.AgentPort),
cfg.App.TracingSamplingRate,
)
}
// 初始化打印系统和进程资源
if cfg.App.EnableStat {
stat.Init(stat.WithLog(logger.Get()))
}
}
// 初始化配置
func initConfig() {
flag.StringVar(&version, "version", "", "service Version Number")
flag.BoolVar(&enableConfigCenter, "enable-cc", false, "whether to get from the configuration center, "+
"if true, the '-c' parameter indicates the configuration center")
flag.StringVar(&configFile, "c", "", "configuration file")
flag.Parse()
if enableConfigCenter {
// 从配置中心获取配置(先获取nacos配置再根据nacos配置中心读取服务配置)
if configFile == "" {
configFile = configs.Path("serverNameExample_cc.yml")
}
nacosConfig, err := config.NewCenter(configFile)
if err != nil {
panic(err)
}
appConfig := &config.Config{}
params := &nacoscli.Params{}
_ = copier.Copy(params, &nacosConfig.Nacos)
err = nacoscli.Init(appConfig, params)
if err != nil {
panic(fmt.Sprintf("connect to configuration center err, %v", err))
}
if appConfig.App.Name == "" {
panic("read the config from center error, config data is empty")
}
config.Set(appConfig)
} else {
// 从本地配置文件获取配置
if configFile == "" {
configFile = configs.Path("serverNameExample.yml")
}
err := config.Init(configFile)
if err != nil {
panic("init config error: " + err.Error())
}
}
if version != "" {
config.Get().App.Version = version
}
//fmt.Println(config.Show())
}

View File

@ -0,0 +1,44 @@
package initial
import (
"context"
"time"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/tracer"
)
// RegisterClose 注册app需要释放的资源
func RegisterClose(servers []app.IServer) []app.Close {
var closes []app.Close
// 关闭服务
for _, s := range servers {
closes = append(closes, s.Stop)
}
// 关闭mysql
//closes = append(closes, func() error {
// return model.CloseMysql()
//})
// 关闭redis
//if config.Get().App.CacheType == "redis" {
// closes = append(closes, func() error {
// return model.CloseRedis()
// })
//}
// 关闭trace
if config.Get().App.EnableTracing {
closes = append(closes, func() error {
ctx, _ := context.WithTimeout(context.Background(), 2*time.Second) //nolint
return tracer.Close(ctx)
})
}
return closes
}

View File

@ -0,0 +1,82 @@
package initial
import (
"fmt"
"strconv"
"time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
"github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
)
// RegisterServers 注册app服务
func RegisterServers() []app.IServer {
var cfg = config.Get()
var servers []app.IServer
// 创建grpc服务
grpcAddr := ":" + strconv.Itoa(cfg.Grpc.Port)
grpcRegistry, grpcInstance := registryService("grpc", cfg.App.Host, cfg.Grpc.Port)
grpcServer := server.NewGRPCServer(grpcAddr,
server.WithGrpcReadTimeout(time.Duration(cfg.Grpc.ReadTimeout)*time.Second),
server.WithGrpcWriteTimeout(time.Duration(cfg.Grpc.WriteTimeout)*time.Second),
server.WithGrpcRegistry(grpcRegistry, grpcInstance),
)
servers = append(servers, grpcServer)
return servers
}
func registryService(scheme string, host string, port int) (registry.Registry, *registry.ServiceInstance) {
instanceEndpoint := fmt.Sprintf("%s://%s:%d", scheme, host, port)
cfg := config.Get()
switch cfg.App.RegistryDiscoveryType {
// 使用consul注册服务
case "consul":
iRegistry, instance, err := consul.NewRegistry(
cfg.Consul.Addr,
cfg.App.Name+"_"+scheme+"_"+host,
cfg.App.Name,
[]string{instanceEndpoint},
)
if err != nil {
panic(err)
}
return iRegistry, instance
// 使用etcd注册服务
case "etcd":
iRegistry, instance, err := etcd.NewRegistry(
cfg.Etcd.Addrs,
cfg.App.Name+"_"+scheme+"_"+host,
cfg.App.Name,
[]string{instanceEndpoint},
)
if err != nil {
panic(err)
}
return iRegistry, instance
// 使用nacos注册服务
case "nacos":
iRegistry, instance, err := nacos.NewRegistry(
cfg.NacosRd.IPAddr,
cfg.NacosRd.Port,
cfg.NacosRd.NamespaceID,
cfg.App.Name+"_"+scheme+"_"+host,
cfg.App.Name,
[]string{instanceEndpoint},
)
if err != nil {
panic(err)
}
return iRegistry, instance
}
return nil, nil
}

View File

@ -1,7 +1,7 @@
package main
import (
"github.com/zhufuyi/sponge/cmd/serverNameExample_gwExample/initial"
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcPbExample/initial"
"github.com/zhufuyi/sponge/pkg/app"
)

View File

@ -0,0 +1,104 @@
package initial
import (
"flag"
"fmt"
"strconv"
"github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/nacoscli"
"github.com/zhufuyi/sponge/pkg/stat"
"github.com/zhufuyi/sponge/pkg/tracer"
"github.com/jinzhu/copier"
)
var (
version string
configFile string
enableConfigCenter bool
)
// Config 初始化配置
func Config() {
initConfig()
cfg := config.Get()
// 初始化日志
_, _ = logger.Init(
logger.WithLevel(cfg.Logger.Level),
logger.WithFormat(cfg.Logger.Format),
logger.WithSave(cfg.Logger.IsSave),
)
// 初始化数据库
//model.InitMysql()
//model.InitCache(cfg.App.CacheType)
// 初始化链路跟踪
if cfg.App.EnableTracing {
tracer.InitWithConfig(
cfg.App.Name,
cfg.App.Env,
cfg.App.Version,
cfg.Jaeger.AgentHost,
strconv.Itoa(cfg.Jaeger.AgentPort),
cfg.App.TracingSamplingRate,
)
}
// 初始化打印系统和进程资源
if cfg.App.EnableStat {
stat.Init(stat.WithLog(logger.Get()))
}
}
// 初始化配置
func initConfig() {
flag.StringVar(&version, "version", "", "service Version Number")
flag.BoolVar(&enableConfigCenter, "enable-cc", false, "whether to get from the configuration center, "+
"if true, the '-c' parameter indicates the configuration center")
flag.StringVar(&configFile, "c", "", "configuration file")
flag.Parse()
if enableConfigCenter {
// 从配置中心获取配置(先获取nacos配置再根据nacos配置中心读取服务配置)
if configFile == "" {
configFile = configs.Path("serverNameExample_cc.yml")
}
nacosConfig, err := config.NewCenter(configFile)
if err != nil {
panic(err)
}
appConfig := &config.Config{}
params := &nacoscli.Params{}
_ = copier.Copy(params, &nacosConfig.Nacos)
err = nacoscli.Init(appConfig, params)
if err != nil {
panic(fmt.Sprintf("connect to configuration center err, %v", err))
}
if appConfig.App.Name == "" {
panic("read the config from center error, config data is empty")
}
config.Set(appConfig)
} else {
// 从本地配置文件获取配置
if configFile == "" {
configFile = configs.Path("serverNameExample.yml")
}
err := config.Init(configFile)
if err != nil {
panic("init config error: " + err.Error())
}
}
if version != "" {
config.Get().App.Version = version
}
//fmt.Println(config.Show())
}

View File

@ -0,0 +1,44 @@
package initial
import (
"context"
"time"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/tracer"
)
// RegisterClose 注册app需要释放的资源
func RegisterClose(servers []app.IServer) []app.Close {
var closes []app.Close
// 关闭服务
for _, s := range servers {
closes = append(closes, s.Stop)
}
// 关闭mysql
//closes = append(closes, func() error {
// return model.CloseMysql()
//})
// 关闭redis
//if config.Get().App.CacheType == "redis" {
// closes = append(closes, func() error {
// return model.CloseRedis()
// })
//}
// 关闭trace
if config.Get().App.EnableTracing {
closes = append(closes, func() error {
ctx, _ := context.WithTimeout(context.Background(), 2*time.Second) //nolint
return tracer.Close(ctx)
})
}
return closes
}

View File

@ -0,0 +1,83 @@
package initial
import (
"fmt"
"strconv"
"time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
"github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
)
// RegisterServers 注册app服务
func RegisterServers() []app.IServer {
var cfg = config.Get()
var servers []app.IServer
// 创建http服务
httpAddr := ":" + strconv.Itoa(cfg.HTTP.Port)
httpRegistry, httpInstance := registryService("http", cfg.App.Host, cfg.HTTP.Port)
httpServer := server.NewHTTPServer_pbExample(httpAddr,
server.WithHTTPReadTimeout(time.Second*time.Duration(cfg.HTTP.ReadTimeout)),
server.WithHTTPWriteTimeout(time.Second*time.Duration(cfg.HTTP.WriteTimeout)),
server.WithHTTPRegistry(httpRegistry, httpInstance),
server.WithHTTPIsProd(cfg.App.Env == "prod"),
)
servers = append(servers, httpServer)
return servers
}
func registryService(scheme string, host string, port int) (registry.Registry, *registry.ServiceInstance) {
instanceEndpoint := fmt.Sprintf("%s://%s:%d", scheme, host, port)
cfg := config.Get()
switch cfg.App.RegistryDiscoveryType {
// 使用consul注册服务
case "consul":
iRegistry, instance, err := consul.NewRegistry(
cfg.Consul.Addr,
cfg.App.Name+"_"+scheme+"_"+host,
cfg.App.Name,
[]string{instanceEndpoint},
)
if err != nil {
panic(err)
}
return iRegistry, instance
// 使用etcd注册服务
case "etcd":
iRegistry, instance, err := etcd.NewRegistry(
cfg.Etcd.Addrs,
cfg.App.Name+"_"+scheme+"_"+host,
cfg.App.Name,
[]string{instanceEndpoint},
)
if err != nil {
panic(err)
}
return iRegistry, instance
// 使用nacos注册服务
case "nacos":
iRegistry, instance, err := nacos.NewRegistry(
cfg.NacosRd.IPAddr,
cfg.NacosRd.Port,
cfg.NacosRd.NamespaceID,
cfg.App.Name+"_"+scheme+"_"+host,
cfg.App.Name,
[]string{instanceEndpoint},
)
if err != nil {
panic(err)
}
return iRegistry, instance
}
return nil, nil
}

View File

@ -0,0 +1,16 @@
package main
import (
"github.com/zhufuyi/sponge/cmd/serverNameExample_httpPbExample/initial"
"github.com/zhufuyi/sponge/pkg/app"
)
func main() {
initial.Config()
servers := initial.RegisterServers()
closes := initial.RegisterClose(servers)
a := app.New(servers, closes)
a.Run()
}

View File

@ -1,12 +1,8 @@
package generate
import (
"bytes"
"errors"
"fmt"
"os"
"path/filepath"
"regexp"
"github.com/zhufuyi/sponge/pkg/replacer"
@ -22,7 +18,7 @@ func RPCGwCommand() *cobra.Command {
projectName string // 项目名称
repoAddr string // 镜像仓库地址
outPath string // 输出目录
protobufFile string // proto file文件指定这个文件生成路由和service
protobufFile string // proto file文件
)
//nolint
@ -58,18 +54,22 @@ Examples:
_ = cmd.MarkFlagRequired("protobuf-file")
cmd.Flags().StringVarP(&repoAddr, "repo-addr", "r", "", "docker image repository address, excluding http and repository names")
cmd.Flags().StringVarP(&outPath, "out", "o", "", "output directory, default is ./serverName_rpc_<time>")
cmd.Flags().StringVarP(&outPath, "out", "o", "", "output directory, default is ./serverName_rpc-gw_<time>")
return cmd
}
func runGenRPCGwCommand(moduleName string, serverName string, projectName string, protobufFile string, repoAddr string, outPath string) error {
protoData, err := os.ReadFile(protobufFile)
if err != nil {
return err
}
err = getServiceName(protoData)
//protoData, err := os.ReadFile(protobufFile)
//if err != nil {
// return err
//}
//
//err = getServiceName(protoData)
//if err != nil {
// return err
//}
protobufFiles, isImportTypes, err := parseProtobufFiles(protobufFile)
if err != nil {
return err
}
@ -89,19 +89,22 @@ func runGenRPCGwCommand(moduleName string, serverName string, projectName string
"internal/handler", "internal/types", "api/serverNameExample",
} // 指定子目录下忽略处理的目录
ignoreFiles := []string{"grpc.go", "grpc_option.go", "grpc_test.go", "LICENSE",
"grpc_userExample.go", "grpc_systemCode.go", "grpc_systemCode_test.go",
"userExample_rpc.go", "systemCode_rpc.go",
"codecov.yml", "routers.go", "routers_test.go", "userExample_gwExample.go", "userExample.go",
"routers_gwExample_test.go", "userExample_gwExample.go", "types.pb.validate.go", "types.pb.go",
"swagger.json", "swagger.yaml", "apis.swagger.json", "proto.html", "docs.go", "doc.go",
} // 指定子目录下忽略处理的文件
if !bytes.Contains(protoData, []byte("api/types/types.proto")) {
//if !bytes.Contains(protoData, []byte("api/types/types.proto")) {
// ignoreFiles = append(ignoreFiles, "types.proto")
//}
if !isImportTypes {
ignoreFiles = append(ignoreFiles, "types.proto")
}
r.SetSubDirs(subDirs...)
r.SetSubDirsAndFiles(subDirs)
r.SetIgnoreSubDirs(ignoreDirs...)
r.SetIgnoreFiles(ignoreFiles...)
r.SetIgnoreSubFiles(ignoreFiles...)
fields := addRPCGwFields(moduleName, serverName, projectName, repoAddr, r)
r.SetReplacementFields(fields)
_ = r.SetOutputDir(outPath, serverName+"_"+subTplName)
@ -109,25 +112,30 @@ func runGenRPCGwCommand(moduleName string, serverName string, projectName string
return err
}
err = saveProtobufFiles(moduleName, serverName, r.GetOutputDir(), protobufFiles)
if err != nil {
return err
}
fmt.Printf("generate %s's rpc gateway server codes successfully, out = %s\n\n", serverName, r.GetOutputDir())
// 保存moduleName和serverName到指定文件给外部使用
genInfo := moduleName + "," + serverName
file := r.GetOutputDir() + "/docs/gen.info"
err = os.WriteFile(file, []byte(genInfo), 0666)
if err != nil {
fmt.Printf("save file %s error, %v\n", file, err)
}
// 复制protobuf文件
_, name := filepath.Split(protobufFile)
dir := r.GetOutputDir() + "/api/" + serverName + "/v1"
_ = os.MkdirAll(dir, 0666)
file = dir + "/" + name
err = os.WriteFile(file, protoData, 0666)
if err != nil {
fmt.Printf("save file %s error, %v\n", file, err)
}
//// 保存moduleName和serverName到指定文件给外部使用
//genInfo := moduleName + "," + serverName
//file := r.GetOutputDir() + "/docs/gen.info"
//err = os.WriteFile(file, []byte(genInfo), 0666)
//if err != nil {
// fmt.Printf("save file %s error, %v\n", file, err)
//}
//
//// 复制protobuf文件
//_, name := filepath.Split(protobufFile)
//dir := r.GetOutputDir() + "/api/" + serverName + "/v1"
//_ = os.MkdirAll(dir, 0666)
//file = dir + "/" + name
//err = os.WriteFile(file, protoData, 0666)
//if err != nil {
// fmt.Printf("save file %s error, %v\n", file, err)
//}
return nil
}
@ -154,7 +162,6 @@ func addRPCGwFields(moduleName string, serverName string, projectName string, re
fields = append(fields, deleteFieldsMark(r, gitIgnoreFile, wellStartMark, wellEndMark)...)
fields = append(fields, deleteFieldsMark(r, protoShellFile, wellStartMark, wellEndMark)...)
fields = append(fields, replaceFileContentMark(r, readmeFile, "## "+serverName)...)
//fields = append(fields, replaceFileContentMark(r, protoFile, string(protoData))...)
fields = append(fields, []replacer.Field{
{ // 替换Dockerfile文件内容
Old: dockerFileMark,
@ -235,12 +242,12 @@ func addRPCGwFields(moduleName string, serverName string, projectName string, re
return fields
}
func getServiceName(data []byte) error {
servicePattern := `\nservice (\w+)`
re := regexp.MustCompile(servicePattern)
matchArr := re.FindStringSubmatch(string(data))
if len(matchArr) < 2 {
return fmt.Errorf("not found service name in protobuf file, the protobuf file requires at least one service")
}
return nil
}
//func getServiceName(data []byte) error {
// servicePattern := `\nservice (\w+)`
// re := regexp.MustCompile(servicePattern)
// matchArr := re.FindStringSubmatch(string(data))
// if len(matchArr) < 2 {
// return fmt.Errorf("not found service name in protobuf file, the protobuf file requires at least one service")
// }
// return nil
//}

View File

@ -179,66 +179,66 @@
<ul>
<li>
<a href="#api.userExample.v1.CreateUserExampleReply"><span class="badge">M</span>CreateUserExampleReply</a>
<a href="#api.serverNameExample.v1.CreateUserExampleReply"><span class="badge">M</span>CreateUserExampleReply</a>
</li>
<li>
<a href="#api.userExample.v1.CreateUserExampleRequest"><span class="badge">M</span>CreateUserExampleRequest</a>
<a href="#api.serverNameExample.v1.CreateUserExampleRequest"><span class="badge">M</span>CreateUserExampleRequest</a>
</li>
<li>
<a href="#api.userExample.v1.DeleteUserExampleByIDReply"><span class="badge">M</span>DeleteUserExampleByIDReply</a>
<a href="#api.serverNameExample.v1.DeleteUserExampleByIDReply"><span class="badge">M</span>DeleteUserExampleByIDReply</a>
</li>
<li>
<a href="#api.userExample.v1.DeleteUserExampleByIDRequest"><span class="badge">M</span>DeleteUserExampleByIDRequest</a>
<a href="#api.serverNameExample.v1.DeleteUserExampleByIDRequest"><span class="badge">M</span>DeleteUserExampleByIDRequest</a>
</li>
<li>
<a href="#api.userExample.v1.GetUserExampleByIDReply"><span class="badge">M</span>GetUserExampleByIDReply</a>
<a href="#api.serverNameExample.v1.GetUserExampleByIDReply"><span class="badge">M</span>GetUserExampleByIDReply</a>
</li>
<li>
<a href="#api.userExample.v1.GetUserExampleByIDRequest"><span class="badge">M</span>GetUserExampleByIDRequest</a>
<a href="#api.serverNameExample.v1.GetUserExampleByIDRequest"><span class="badge">M</span>GetUserExampleByIDRequest</a>
</li>
<li>
<a href="#api.userExample.v1.ListUserExampleByIDsReply"><span class="badge">M</span>ListUserExampleByIDsReply</a>
<a href="#api.serverNameExample.v1.ListUserExampleByIDsReply"><span class="badge">M</span>ListUserExampleByIDsReply</a>
</li>
<li>
<a href="#api.userExample.v1.ListUserExampleByIDsRequest"><span class="badge">M</span>ListUserExampleByIDsRequest</a>
<a href="#api.serverNameExample.v1.ListUserExampleByIDsRequest"><span class="badge">M</span>ListUserExampleByIDsRequest</a>
</li>
<li>
<a href="#api.userExample.v1.ListUserExampleReply"><span class="badge">M</span>ListUserExampleReply</a>
<a href="#api.serverNameExample.v1.ListUserExampleReply"><span class="badge">M</span>ListUserExampleReply</a>
</li>
<li>
<a href="#api.userExample.v1.ListUserExampleRequest"><span class="badge">M</span>ListUserExampleRequest</a>
<a href="#api.serverNameExample.v1.ListUserExampleRequest"><span class="badge">M</span>ListUserExampleRequest</a>
</li>
<li>
<a href="#api.userExample.v1.UpdateUserExampleByIDReply"><span class="badge">M</span>UpdateUserExampleByIDReply</a>
<a href="#api.serverNameExample.v1.UpdateUserExampleByIDReply"><span class="badge">M</span>UpdateUserExampleByIDReply</a>
</li>
<li>
<a href="#api.userExample.v1.UpdateUserExampleByIDRequest"><span class="badge">M</span>UpdateUserExampleByIDRequest</a>
<a href="#api.serverNameExample.v1.UpdateUserExampleByIDRequest"><span class="badge">M</span>UpdateUserExampleByIDRequest</a>
</li>
<li>
<a href="#api.userExample.v1.UserExample"><span class="badge">M</span>UserExample</a>
<a href="#api.serverNameExample.v1.UserExample"><span class="badge">M</span>UserExample</a>
</li>
<li>
<a href="#api.userExample.v1.GenderType"><span class="badge">E</span>GenderType</a>
<a href="#api.serverNameExample.v1.GenderType"><span class="badge">E</span>GenderType</a>
</li>
<li>
<a href="#api.userExample.v1.userExampleService"><span class="badge">S</span>userExampleService</a>
<a href="#api.serverNameExample.v1.userExampleService"><span class="badge">S</span>userExampleService</a>
</li>
</ul>
@ -275,7 +275,7 @@
<p></p>
<h3 id="api.userExample.v1.CreateUserExampleReply">CreateUserExampleReply</h3>
<h3 id="api.serverNameExample.v1.CreateUserExampleReply">CreateUserExampleReply</h3>
<p></p>
@ -296,37 +296,10 @@
</table>
<h4>Validated Fields</h4>
<table>
<thead>
<tr>
<td>Field</td>
<td>Validations</td>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>
<ul>
<li>uint64.gte: 1</li>
</ul>
</td>
</tr>
</tbody>
</table>
<h3 id="api.userExample.v1.CreateUserExampleRequest">CreateUserExampleRequest</h3>
<h3 id="api.serverNameExample.v1.CreateUserExampleRequest">CreateUserExampleRequest</h3>
<p></p>
@ -380,7 +353,7 @@
<tr>
<td>gender</td>
<td><a href="#api.userExample.v1.GenderType">GenderType</a></td>
<td><a href="#api.serverNameExample.v1.GenderType">GenderType</a></td>
<td></td>
<td><p>性别0:未知1:男2:女 </p></td>
</tr>
@ -487,14 +460,14 @@
<h3 id="api.userExample.v1.DeleteUserExampleByIDReply">DeleteUserExampleByIDReply</h3>
<h3 id="api.serverNameExample.v1.DeleteUserExampleByIDReply">DeleteUserExampleByIDReply</h3>
<p></p>
<h3 id="api.userExample.v1.DeleteUserExampleByIDRequest">DeleteUserExampleByIDRequest</h3>
<h3 id="api.serverNameExample.v1.DeleteUserExampleByIDRequest">DeleteUserExampleByIDRequest</h3>
<p></p>
@ -545,7 +518,7 @@
<h3 id="api.userExample.v1.GetUserExampleByIDReply">GetUserExampleByIDReply</h3>
<h3 id="api.serverNameExample.v1.GetUserExampleByIDReply">GetUserExampleByIDReply</h3>
<p></p>
@ -557,7 +530,7 @@
<tr>
<td>userExample</td>
<td><a href="#api.userExample.v1.UserExample">UserExample</a></td>
<td><a href="#api.serverNameExample.v1.UserExample">UserExample</a></td>
<td></td>
<td><p> </p></td>
</tr>
@ -569,7 +542,7 @@
<h3 id="api.userExample.v1.GetUserExampleByIDRequest">GetUserExampleByIDRequest</h3>
<h3 id="api.serverNameExample.v1.GetUserExampleByIDRequest">GetUserExampleByIDRequest</h3>
<p></p>
@ -620,7 +593,7 @@
<h3 id="api.userExample.v1.ListUserExampleByIDsReply">ListUserExampleByIDsReply</h3>
<h3 id="api.serverNameExample.v1.ListUserExampleByIDsReply">ListUserExampleByIDsReply</h3>
<p></p>
@ -632,7 +605,7 @@
<tr>
<td>userExamples</td>
<td><a href="#api.userExample.v1.UserExample">UserExample</a></td>
<td><a href="#api.serverNameExample.v1.UserExample">UserExample</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
@ -644,7 +617,7 @@
<h3 id="api.userExample.v1.ListUserExampleByIDsRequest">ListUserExampleByIDsRequest</h3>
<h3 id="api.serverNameExample.v1.ListUserExampleByIDsRequest">ListUserExampleByIDsRequest</h3>
<p></p>
@ -668,7 +641,7 @@
<h3 id="api.userExample.v1.ListUserExampleReply">ListUserExampleReply</h3>
<h3 id="api.serverNameExample.v1.ListUserExampleReply">ListUserExampleReply</h3>
<p></p>
@ -687,7 +660,7 @@
<tr>
<td>userExamples</td>
<td><a href="#api.userExample.v1.UserExample">UserExample</a></td>
<td><a href="#api.serverNameExample.v1.UserExample">UserExample</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
@ -699,7 +672,7 @@
<h3 id="api.userExample.v1.ListUserExampleRequest">ListUserExampleRequest</h3>
<h3 id="api.serverNameExample.v1.ListUserExampleRequest">ListUserExampleRequest</h3>
<p></p>
@ -750,14 +723,14 @@
<h3 id="api.userExample.v1.UpdateUserExampleByIDReply">UpdateUserExampleByIDReply</h3>
<h3 id="api.serverNameExample.v1.UpdateUserExampleByIDReply">UpdateUserExampleByIDReply</h3>
<p></p>
<h3 id="api.userExample.v1.UpdateUserExampleByIDRequest">UpdateUserExampleByIDRequest</h3>
<h3 id="api.serverNameExample.v1.UpdateUserExampleByIDRequest">UpdateUserExampleByIDRequest</h3>
<p></p>
@ -799,7 +772,7 @@
<td>phone</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>手机号码,必须在前加&#39;&#43;86&#39; </p></td>
<td><p>手机号码 </p></td>
</tr>
<tr>
@ -818,7 +791,7 @@
<tr>
<td>gender</td>
<td><a href="#api.userExample.v1.GenderType">GenderType</a></td>
<td><a href="#api.serverNameExample.v1.GenderType">GenderType</a></td>
<td></td>
<td><p>性别1:男2:女 </p></td>
</tr>
@ -871,7 +844,7 @@
<h3 id="api.userExample.v1.UserExample">UserExample</h3>
<h3 id="api.serverNameExample.v1.UserExample">UserExample</h3>
<p></p>
@ -906,7 +879,7 @@
<td>phone</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p>手机号码,必须在前加&#39;&#43;86&#39; </p></td>
<td><p>手机号码 </p></td>
</tr>
<tr>
@ -925,7 +898,7 @@
<tr>
<td>gender</td>
<td><a href="#api.userExample.v1.GenderType">GenderType</a></td>
<td><a href="#api.serverNameExample.v1.GenderType">GenderType</a></td>
<td></td>
<td><p>性别1:男2:女 </p></td>
</tr>
@ -967,7 +940,7 @@
<h3 id="api.userExample.v1.GenderType">GenderType</h3>
<h3 id="api.serverNameExample.v1.GenderType">GenderType</h3>
<p></p>
<table class="enum-table">
<thead>
@ -1000,7 +973,7 @@
<h3 id="api.userExample.v1.userExampleService">userExampleService</h3>
<h3 id="api.serverNameExample.v1.userExampleService">userExampleService</h3>
<p></p>
<table class="enum-table">
<thead>
@ -1010,43 +983,43 @@
<tr>
<td>Create</td>
<td><a href="#api.userExample.v1.CreateUserExampleRequest">CreateUserExampleRequest</a></td>
<td><a href="#api.userExample.v1.CreateUserExampleReply">CreateUserExampleReply</a></td>
<td><a href="#api.serverNameExample.v1.CreateUserExampleRequest">CreateUserExampleRequest</a></td>
<td><a href="#api.serverNameExample.v1.CreateUserExampleReply">CreateUserExampleReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>DeleteByID</td>
<td><a href="#api.userExample.v1.DeleteUserExampleByIDRequest">DeleteUserExampleByIDRequest</a></td>
<td><a href="#api.userExample.v1.DeleteUserExampleByIDReply">DeleteUserExampleByIDReply</a></td>
<td><a href="#api.serverNameExample.v1.DeleteUserExampleByIDRequest">DeleteUserExampleByIDRequest</a></td>
<td><a href="#api.serverNameExample.v1.DeleteUserExampleByIDReply">DeleteUserExampleByIDReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>UpdateByID</td>
<td><a href="#api.userExample.v1.UpdateUserExampleByIDRequest">UpdateUserExampleByIDRequest</a></td>
<td><a href="#api.userExample.v1.UpdateUserExampleByIDReply">UpdateUserExampleByIDReply</a></td>
<td><a href="#api.serverNameExample.v1.UpdateUserExampleByIDRequest">UpdateUserExampleByIDRequest</a></td>
<td><a href="#api.serverNameExample.v1.UpdateUserExampleByIDReply">UpdateUserExampleByIDReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>GetByID</td>
<td><a href="#api.userExample.v1.GetUserExampleByIDRequest">GetUserExampleByIDRequest</a></td>
<td><a href="#api.userExample.v1.GetUserExampleByIDReply">GetUserExampleByIDReply</a></td>
<td><a href="#api.serverNameExample.v1.GetUserExampleByIDRequest">GetUserExampleByIDRequest</a></td>
<td><a href="#api.serverNameExample.v1.GetUserExampleByIDReply">GetUserExampleByIDReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>ListByIDs</td>
<td><a href="#api.userExample.v1.ListUserExampleByIDsRequest">ListUserExampleByIDsRequest</a></td>
<td><a href="#api.userExample.v1.ListUserExampleByIDsReply">ListUserExampleByIDsReply</a></td>
<td><a href="#api.serverNameExample.v1.ListUserExampleByIDsRequest">ListUserExampleByIDsRequest</a></td>
<td><a href="#api.serverNameExample.v1.ListUserExampleByIDsReply">ListUserExampleByIDsReply</a></td>
<td><p></p></td>
</tr>
<tr>
<td>List</td>
<td><a href="#api.userExample.v1.ListUserExampleRequest">ListUserExampleRequest</a></td>
<td><a href="#api.userExample.v1.ListUserExampleReply">ListUserExampleReply</a></td>
<td><a href="#api.serverNameExample.v1.ListUserExampleRequest">ListUserExampleRequest</a></td>
<td><a href="#api.serverNameExample.v1.ListUserExampleReply">ListUserExampleReply</a></td>
<td><p></p></td>
</tr>
@ -1054,6 +1027,84 @@
</table>
<h4>Methods with HTTP bindings</h4>
<table>
<thead>
<tr>
<td>Method Name</td>
<td>Method</td>
<td>Pattern</td>
<td>Body</td>
</tr>
</thead>
<tbody>
<tr>
<td>Create</td>
<td>POST</td>
<td>/api/v1/userExample</td>
<td>*</td>
</tr>
<tr>
<td>DeleteByID</td>
<td>DELETE</td>
<td>/api/v1/userExample/{id}</td>
<td></td>
</tr>
<tr>
<td>UpdateByID</td>
<td>PUT</td>
<td>/api/v1/userExample/{id}</td>
<td>*</td>
</tr>
<tr>
<td>GetByID</td>
<td>GET</td>
<td>/api/v1/userExample/{id}</td>
<td></td>
</tr>
<tr>
<td>ListByIDs</td>
<td>POST</td>
<td>/api/v1/userExamples/ids</td>
<td>*</td>
</tr>
<tr>
<td>List</td>
<td>POST</td>
<td>/api/v1/userExamples</td>
<td>*</td>
</tr>
</tbody>
</table>
<div class="file-heading">

5
go.mod
View File

@ -8,7 +8,6 @@ require (
github.com/blastrain/vitess-sqlparser v0.0.0-20201030050434-a139afbb1aba
github.com/bojand/ghz v0.110.0
github.com/dgraph-io/ristretto v0.1.0
github.com/envoyproxy/protoc-gen-validate v0.6.2
github.com/felixge/fgprof v0.9.3
github.com/fsnotify/fsnotify v1.5.4
github.com/gin-contrib/cors v1.3.1
@ -21,7 +20,6 @@ require (
github.com/golang/snappy v0.0.3
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0
github.com/hashicorp/consul/api v1.12.0
github.com/huandu/xstrings v1.3.1
github.com/jinzhu/copier v0.3.5
@ -33,7 +31,6 @@ require (
github.com/spf13/cast v1.5.0
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.12.0
github.com/srikrsna/protoc-gen-gotag v0.6.2
github.com/stretchr/testify v1.8.0
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a
github.com/swaggo/gin-swagger v1.5.2
@ -84,6 +81,7 @@ require (
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.6.2 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.2.3 // indirect
@ -101,6 +99,7 @@ require (
github.com/golang/glog v1.0.0 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect

7
go.sum
View File

@ -174,7 +174,6 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g=
github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
@ -305,6 +304,7 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@ -349,8 +349,6 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0 h1:kr3j8iIMR4ywO/O0rvksXaJvauGGCMg2zAZIiNZ9uIQ=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.12.0/go.mod h1:ummNFgdgLhhX7aIiy35vVmQNS0rWXknfPE0qe6fmFXg=
github.com/hashicorp/consul/api v1.12.0 h1:k3y1FYv6nuKyNTqj6w9gXOx5r5CfLj/k/euUeBXj1OY=
github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0=
github.com/hashicorp/consul/sdk v0.8.0 h1:OJtKBtEjboEZvG6AOUdh4Z1Zbyu0WcxQ0qatRrZHTVU=
@ -602,7 +600,6 @@ github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4=
github.com/spf13/afero v1.5.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo=
github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo=
@ -617,8 +614,6 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ=
github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI=
github.com/srikrsna/protoc-gen-gotag v0.6.2 h1:ULdarjI7FNUA6CNlLPIzSNvjdV2P4C2LSygPLvCVtfA=
github.com/srikrsna/protoc-gen-gotag v0.6.2/go.mod h1:cplWV0ZNBhuF54gnj6rU9pLNrqjXf5vh65Xqa1Kjy+4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=

View File

@ -1,15 +0,0 @@
package ecode
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestAny(t *testing.T) {
detail := Any("foo", "bar")
assert.Contains(t, detail.String(), "foo")
detail = Any("foo1", "bar1")
assert.NotContains(t, detail.String(), "any-key")
}

View File

@ -1,25 +0,0 @@
// nolint
package ecode
import (
"github.com/zhufuyi/sponge/pkg/errcode"
)
const (
// todo must be modified manually
// 每个资源名称对应唯一编号编号范围1~1000如果存在编号相同启动服务会报错
_userExampleNO = 1
// userExample对应的中文名称
_userExampleName = "userExample_cn_name"
)
// 服务级别错误码
var (
StatusCreateUserExample = errcode.NewGRPCStatus(errcode.GCode(_userExampleNO)+1, "创建"+_userExampleName+"失败") // todo 补充错误码注释,例如 400101
StatusDeleteUserExample = errcode.NewGRPCStatus(errcode.GCode(_userExampleNO)+2, "删除"+_userExampleName+"失败")
StatusUpdateUserExample = errcode.NewGRPCStatus(errcode.GCode(_userExampleNO)+3, "更新"+_userExampleName+"失败")
StatusGetUserExample = errcode.NewGRPCStatus(errcode.GCode(_userExampleNO)+4, "获取"+_userExampleName+"失败")
StatusListUserExample = errcode.NewGRPCStatus(errcode.GCode(_userExampleNO)+5, "获取"+_userExampleName+"列表失败")
// 每添加一个错误码,在上一个错误码基础上+1
)

View File

@ -1,25 +0,0 @@
// nolint
package ecode
import (
"github.com/zhufuyi/sponge/pkg/errcode"
)
const (
// todo must be modified manually
// 每个资源名称对应唯一编号编号范围1~1000如果存在编号相同启动服务会报错
userExampleNO = 1
// userExample对应的中文名称
userExampleName = "userExample_cn_name"
)
// 服务级别错误码有Err前缀
var (
ErrCreateUserExample = errcode.NewError(errcode.HCode(userExampleNO)+1, "创建"+userExampleName+"失败") // todo 补充错误码注释,例如 200101
ErrDeleteUserExample = errcode.NewError(errcode.HCode(userExampleNO)+2, "删除"+userExampleName+"失败")
ErrUpdateUserExample = errcode.NewError(errcode.HCode(userExampleNO)+3, "更新"+userExampleName+"失败")
ErrGetUserExample = errcode.NewError(errcode.HCode(userExampleNO)+4, "获取"+userExampleName+"失败")
ErrListUserExample = errcode.NewError(errcode.HCode(userExampleNO)+5, "获取"+userExampleName+"列表失败")
// 每添加一个错误码,在上一个错误码基础上+1
)

View File

@ -6,7 +6,7 @@ import (
"github.com/zhufuyi/sponge/pkg/errcode"
)
// http系统级别错误码无Err前缀错误码范围100000~200000
// http system level error code, error code range 10000~20000
var (
Success = errcode.Success
InvalidParams = errcode.InvalidParams
@ -19,8 +19,8 @@ var (
Forbidden = errcode.Forbidden
LimitExceed = errcode.LimitExceed
DeadlineExceeded = errcode.DeadlineExceeded
AccessDenied = errcode.AccessDenied
MethodNotAllowed = errcode.MethodNotAllowed
MethodServiceUnavailable = errcode.MethodServiceUnavailable
DeadlineExceeded = errcode.DeadlineExceeded
AccessDenied = errcode.AccessDenied
MethodNotAllowed = errcode.MethodNotAllowed
ServiceUnavailable = errcode.ServiceUnavailable
)

View File

@ -6,7 +6,7 @@ import (
"github.com/zhufuyi/sponge/pkg/errcode"
)
// rpc系统级别错误码有status前缀错误码范围300000~400000
// rpc system level error code, with status prefix, error code range 30000~40000
var (
StatusSuccess = errcode.StatusSuccess

View File

@ -0,0 +1,22 @@
// nolint
package ecode
import (
"github.com/zhufuyi/sponge/pkg/errcode"
)
// userExample http服务级别错误码
// 每个资源名称对应唯一编号(http类型)编号范围1~100如果存在编号相同触发panic
var (
userExampleNO = 1
userExampleName = "userExample"
userExampleBaseCode = errcode.HCode(userExampleNO)
ErrCreateUserExample = errcode.NewError(userExampleBaseCode+1, "failed to create "+userExampleName)
ErrDeleteUserExample = errcode.NewError(userExampleBaseCode+2, "failed to delete "+userExampleName)
ErrUpdateUserExample = errcode.NewError(userExampleBaseCode+3, "failed to update "+userExampleName)
ErrGetUserExample = errcode.NewError(userExampleBaseCode+4, "failed to get "+userExampleName+" details")
ErrListUserExample = errcode.NewError(userExampleBaseCode+5, "failed to get list of "+userExampleName)
// 每添加一个错误码,在上一个错误码基础上+1
)

View File

@ -0,0 +1,22 @@
// nolint
package ecode
import (
"github.com/zhufuyi/sponge/pkg/errcode"
)
// userExample rpc服务级别错误码
// 每个资源名称对应唯一编号(rpc类型)编号范围1~100如果存在编号相同触发panic
var (
_userExampleNO = 1
_userExampleName = "userExample"
_userExampleBaseCode = errcode.RCode(_userExampleNO)
StatusCreateUserExample = errcode.NewRPCStatus(_userExampleBaseCode+1, "failed to create "+_userExampleName)
StatusDeleteUserExample = errcode.NewRPCStatus(_userExampleBaseCode+2, "failed to delete "+_userExampleName)
StatusUpdateUserExample = errcode.NewRPCStatus(_userExampleBaseCode+3, "failed to update "+_userExampleName)
StatusGetUserExample = errcode.NewRPCStatus(_userExampleBaseCode+4, "failed to get "+_userExampleName+" details")
StatusListUserExample = errcode.NewRPCStatus(_userExampleBaseCode+5, "failed to get list of "+_userExampleName)
// 每添加一个错误码,在上一个错误码基础上+1
)

View File

@ -18,5 +18,5 @@ func userExampleRouter(group *gin.RouterGroup, h handler.UserExampleHandler) {
group.PUT("/userExample/:id", h.UpdateByID)
group.GET("/userExample/:id", h.GetByID)
group.POST("/userExamples/ids", h.ListByIDs)
group.POST("/userExamples", h.List) // 通过post任意列组合查询
group.POST("/userExamples", h.List)
}

View File

@ -1,20 +0,0 @@
package errcode
import "google.golang.org/grpc/codes"
// nolint
// rpc服务级别错误码有Status前缀
var (
// StatusUserCreate = NewGRPCStatus(GCode(1)+1, "创建用户失败") // 400101
// StatusUserDelete = NewGRPCStatus(GCode(1)+2, "删除用户失败") // 400102
// StatusUserUpdate = NewGRPCStatus(GCode(1)+3, "更新用户失败") // 400103
// StatusUserGet = NewGRPCStatus(GCode(1)+4, "获取用户失败") // 400104
)
// GCode 根据编号生成400000~500000之间的错误码
func GCode(NO int) codes.Code {
if NO > 1000 {
panic("NO must be < 1000")
}
return codes.Code(400000 + NO*100)
}

View File

@ -1,22 +0,0 @@
package errcode
// nolint
// rpc系统级别错误码有status前缀
var (
StatusSuccess = NewGRPCStatus(0, "ok")
StatusInvalidParams = NewGRPCStatus(300001, "参数错误")
StatusUnauthorized = NewGRPCStatus(300002, "认证错误")
StatusInternalServerError = NewGRPCStatus(300003, "服务内部错误")
StatusNotFound = NewGRPCStatus(300004, "资源不存在")
StatusAlreadyExists = NewGRPCStatus(300005, "资源已存在")
StatusTimeout = NewGRPCStatus(300006, "访问超时")
StatusTooManyRequests = NewGRPCStatus(300007, "请求过多")
StatusForbidden = NewGRPCStatus(300008, "拒绝访问")
StatusLimitExceed = NewGRPCStatus(300009, "访问限制")
StatusDeadlineExceeded = NewGRPCStatus(300010, "已超过最后期限")
StatusAccessDenied = NewGRPCStatus(300011, "拒绝访问")
StatusMethodNotAllowed = NewGRPCStatus(300012, "不允许使用的方法")
StatusServiceUnavailable = NewGRPCStatus(300013, "服务不可用")
)

View File

@ -8,22 +8,22 @@ import (
"google.golang.org/grpc/status"
)
// GRPCStatus grpc 状态
type GRPCStatus struct {
// RPCStatus grpc 状态
type RPCStatus struct {
status *status.Status
}
var statusCodes = map[codes.Code]string{}
// NewGRPCStatus 新建一个status
func NewGRPCStatus(code codes.Code, msg string) *GRPCStatus {
// NewRPCStatus 新建一个status
func NewRPCStatus(code codes.Code, msg string) *RPCStatus {
if v, ok := statusCodes[code]; ok {
panic(fmt.Sprintf("grpc status code = %d already exists, please replace with a new error code, old msg = %s", code, v))
} else {
statusCodes[code] = msg
}
return &GRPCStatus{
return &RPCStatus{
status: status.New(code, msg),
}
}
@ -48,7 +48,7 @@ func Any(key string, val interface{}) Detail {
}
// Err return error
func (g *GRPCStatus) Err(details ...Detail) error {
func (g *RPCStatus) Err(details ...Detail) error {
var dts []string
for _, detail := range details {
dts = append(dts, detail.String())
@ -60,7 +60,7 @@ func (g *GRPCStatus) Err(details ...Detail) error {
}
// ToRPCErr converted to standard RPC error
func (g *GRPCStatus) ToRPCErr(desc ...string) error {
func (g *RPCStatus) ToRPCErr(desc ...string) error {
switch g.status.Code() {
case StatusInternalServerError.status.Code():
return toRPCErr(codes.Internal, desc...)
@ -96,7 +96,7 @@ func toRPCErr(code codes.Code, descs ...string) error {
}
// ToRPCCode converted to standard RPC error code
func (g *GRPCStatus) ToRPCCode() codes.Code {
func (g *RPCStatus) ToRPCCode() codes.Code {
switch g.status.Code() {
case StatusInternalServerError.status.Code():
return codes.Internal

View File

@ -6,8 +6,8 @@ import (
"github.com/stretchr/testify/assert"
)
func TestGRPCStatus(t *testing.T) {
st := NewGRPCStatus(101, "something is wrong")
func TestRPCStatus(t *testing.T) {
st := NewRPCStatus(41101, "something is wrong")
err := st.Err()
assert.Error(t, err)
err = st.Err(Any("foo", "bar"))
@ -16,11 +16,11 @@ func TestGRPCStatus(t *testing.T) {
defer func() {
recover()
}()
NewGRPCStatus(101, "something is wrong")
NewRPCStatus(41101, "something is wrong")
}
func TestToRPCCode(t *testing.T) {
status := []*GRPCStatus{
status := []*RPCStatus{
StatusSuccess,
StatusInvalidParams,
StatusUnauthorized,
@ -60,12 +60,12 @@ func TestToRPCCode(t *testing.T) {
t.Log(codeInt)
}
func TestGCode(t *testing.T) {
code := GCode(1)
func TestRCode(t *testing.T) {
code := RCode(1)
t.Log("error code is", int(code))
defer func() {
recover()
}()
code = GCode(10001)
code = RCode(101)
}

View File

@ -0,0 +1,20 @@
package errcode
import "google.golang.org/grpc/codes"
// RCode Generate an error code between 40000 and 50000 according to the number
//
// rpc service level error code, status prefix, example.
//
// var (
// StatusUserCreate = NewRPCStatus(RCode(1)+1, "failed to create user") // 40101
// StatusUserDelete = NewRPCStatus(RCode(1)+2, "failed to delete user") // 40102
// StatusUserUpdate = NewRPCStatus(RCode(1)+3, "failed to update user") // 40103
// StatusUserGet = NewRPCStatus(RCode(1)+4, "failed to get user details") // 40104
// )
func RCode(NO int) codes.Code {
if NO > 99 {
panic("NO must be < 100")
}
return codes.Code(40000 + NO*100)
}

View File

@ -0,0 +1,22 @@
package errcode
// nolint
// rpc系统级别错误码有status前缀
var (
StatusSuccess = NewRPCStatus(0, "ok")
StatusInvalidParams = NewRPCStatus(300001, "参数错误")
StatusUnauthorized = NewRPCStatus(300002, "认证错误")
StatusInternalServerError = NewRPCStatus(300003, "服务内部错误")
StatusNotFound = NewRPCStatus(300004, "资源不存在")
StatusAlreadyExists = NewRPCStatus(300005, "资源已存在")
StatusTimeout = NewRPCStatus(300006, "访问超时")
StatusTooManyRequests = NewRPCStatus(300007, "请求过多")
StatusForbidden = NewRPCStatus(300008, "拒绝访问")
StatusLimitExceed = NewRPCStatus(300009, "访问限制")
StatusDeadlineExceeded = NewRPCStatus(300010, "已超过最后期限")
StatusAccessDenied = NewRPCStatus(300011, "拒绝访问")
StatusMethodNotAllowed = NewRPCStatus(300012, "不允许使用的方法")
StatusServiceUnavailable = NewRPCStatus(300013, "服务不可用")
)

View File

@ -33,11 +33,11 @@ function listFiles(){
listFiles $protoBasePath
protoc --proto_path=. --proto_path=./third_party \
--doc_out=. --doc_opt=html,proto.html \
--doc_out=. --doc_opt=html,apis.html \
$allProtoFiles
checkResult $?
mv -f proto.html docs/proto.html
mv -f apis.html docs/apis.html
echo "generate proto doc file successfully, see by 'docs/proto.html'"
echo "generate proto doc file successfully, see by 'docs/apis.html'"

View File

@ -1,10 +1,5 @@
#!/bin/bash
# 插件版本
# protoc v3.20.1
# protoc-gen-go v1.28.0
# protoc-gen-validate v0.6.7
# proto文件所在的目录
protoBasePath="api"
allProtoFiles=""
@ -62,6 +57,11 @@ function listPbGoFiles(){
# 获取所有proto文件路径
listProtoFiles $protoBasePath
if [ "$protoBasePath"x = x ];then
echo "Error: not found protobuf file in path $protoBasePath"
exit 1
fi
# 生成文件 *_pb.go, *_grpc_pb.go
protoc --proto_path=. --proto_path=./third_party \
--go_out=. --go_opt=paths=source_relative \
@ -77,6 +77,15 @@ protoc --proto_path=. --proto_path=./third_party \
checkResult $?
# 对*_pb.go字段嵌入tag
protoc --proto_path=. --proto_path=./third_party \
--gotag_out=:. --gotag_opt=paths=source_relative \
$allProtoFiles
checkResult $?
# todo generate router code for gin here
# delete the templates code start
# 生成swagger文档所有文件合并到docs/apis.swagger.json
protoc --proto_path=. --proto_path=./third_party \
--openapiv2_out=. --openapiv2_opt=logtostderr=true --openapiv2_opt=allow_merge=true --openapiv2_opt=merge_file_name=docs/apis.json \
@ -84,24 +93,15 @@ protoc --proto_path=. --proto_path=./third_party \
checkResult $?
# 对*_pb.go字段嵌入tag
protoc --proto_path=. --proto_path=./third_party \
--gotag_out=:. --gotag_opt=paths=source_relative \
$allProtoFiles
checkResult $?
# todo generate router code for gin here
# delete the templates code start
# 生成_*router.pb.go和*_logic.go其中*_logic.go保存路径自定义
# 共生成4个文件分别是注册路由文件_*router.pb.go(保存在protobuf文件同一目录)、注入路由文件*_service.pb.go(默认保存路径在internal/routers)、
# 逻辑代码模板文件*_logic.go(默认保存路径在internal/service), 返回错误码模板文件*_http.go(默认保存路径在internal/ecode)
protoc --proto_path=. --proto_path=./third_party \
--go-gin_out=. --go-gin_opt=paths=source_relative --go-gin_opt=plugin=service \
--go-gin_opt=moduleName=github.com/zhufuyi/sponge --go-gin_opt=serverName=serverNameExample --go-gin_opt=out=internal/service \
--go-gin_opt=moduleName=github.com/zhufuyi/sponge --go-gin_opt=serverName=serverNameExample \
$allProtoFiles
checkResult $?
# delete the templates code end
listPbGoFiles $protoBasePath
go mod tidy