From 6c39e4fa3d7b53a9af70a74180a21c17c2a157e7 Mon Sep 17 00:00:00 2001 From: Monet Lee Date: Thu, 21 Sep 2023 07:20:16 +0800 Subject: [PATCH] feat & refactor: use consul as register and refactor rpc client implement (#133) Co-authored-by: intyou <123916296+intyouss@users.noreply.github.com> --- app/comment/service/cmd/main.go | 10 +- app/comment/service/cmd/wire.go | 2 +- app/comment/service/cmd/wire_gen.go | 14 +- app/comment/service/internal/conf/conf.pb.go | 595 ++++++++--------- app/comment/service/internal/conf/conf.proto | 24 +- app/comment/service/internal/data/comment.go | 6 +- app/comment/service/internal/data/user.go | 5 +- app/comment/service/internal/server/server.go | 44 +- app/favorite/service/cmd/main.go | 10 +- app/favorite/service/cmd/wire.go | 2 +- app/favorite/service/cmd/wire_gen.go | 14 +- app/favorite/service/internal/conf/conf.pb.go | 455 ++++++++----- app/favorite/service/internal/conf/conf.proto | 18 +- .../service/internal/data/favorite.go | 9 +- app/favorite/service/internal/data/publish.go | 8 +- .../service/internal/server/server.go | 43 +- app/message/service/cmd/main.go | 9 +- app/message/service/cmd/wire.go | 2 +- app/message/service/cmd/wire_gen.go | 5 +- app/message/service/internal/conf/conf.pb.go | 246 +++++-- app/message/service/internal/conf/conf.proto | 9 +- app/message/service/internal/server/server.go | 20 +- app/publish/service/cmd/main.go | 10 +- app/publish/service/cmd/wire.go | 2 +- app/publish/service/cmd/wire_gen.go | 16 +- app/publish/service/internal/conf/conf.pb.go | 615 ++++++++---------- app/publish/service/internal/conf/conf.proto | 25 +- app/publish/service/internal/data/favorite.go | 5 +- app/publish/service/internal/data/publish.go | 6 +- app/publish/service/internal/data/user.go | 5 +- app/publish/service/internal/server/server.go | 53 +- app/relation/service/cmd/main.go | 11 +- app/relation/service/cmd/wire.go | 2 +- app/relation/service/cmd/wire_gen.go | 10 +- app/relation/service/internal/conf/conf.pb.go | 484 +++++++------- app/relation/service/internal/conf/conf.proto | 27 +- .../service/internal/data/relation.go | 7 +- app/relation/service/internal/data/user.go | 6 +- .../service/internal/server/server.go | 40 +- app/user/service/cmd/main.go | 11 +- app/user/service/cmd/wire.go | 2 +- app/user/service/cmd/wire_gen.go | 14 +- app/user/service/internal/conf/conf.pb.go | 533 ++++++++------- app/user/service/internal/conf/conf.proto | 26 +- app/user/service/internal/data/relation.go | 5 +- app/user/service/internal/server/server.go | 46 +- configs/service/comment/config.yaml | 7 +- configs/service/comment/registry.yaml | 3 + configs/service/favorite/config.yaml | 5 - configs/service/favorite/registry.yaml | 3 + configs/service/message/registry.yaml | 3 + configs/service/publish/config.yaml | 7 +- configs/service/publish/registry.yaml | 3 + configs/service/relation/config.yaml | 5 +- configs/service/relation/registry.yaml | 3 + configs/service/user/config.yaml | 3 - configs/service/user/registry.yaml | 3 + docker/service/docker-compose.yaml | 62 +- go.mod | 25 +- go.sum | 186 +++++- 60 files changed, 2179 insertions(+), 1650 deletions(-) create mode 100644 configs/service/comment/registry.yaml create mode 100644 configs/service/favorite/registry.yaml create mode 100644 configs/service/message/registry.yaml create mode 100644 configs/service/publish/registry.yaml create mode 100644 configs/service/relation/registry.yaml create mode 100644 configs/service/user/registry.yaml diff --git a/app/comment/service/cmd/main.go b/app/comment/service/cmd/main.go index 2c5a373..470bcfc 100644 --- a/app/comment/service/cmd/main.go +++ b/app/comment/service/cmd/main.go @@ -11,6 +11,7 @@ import ( "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/go-kratos/kratos/v2/transport/http" @@ -26,7 +27,7 @@ func init() { flag.StringVar(&flagConf, "conf", "../configs", "config path, eg: -conf config.yaml") } -func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { +func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.Name(Name), kratos.Logger(logger), @@ -34,6 +35,7 @@ func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { gs, hs, ), + kratos.Registrar(rr), ) } @@ -60,7 +62,11 @@ func main() { if err := c.Scan(&bc); err != nil { panic(err) } - app, cleanup, err := wireApp(bc.Server, bc.Client, bc.Data, bc.Jwt, logger) + var rc conf.Registry + if err := c.Scan(&rc); err != nil { + panic(err) + } + app, cleanup, err := wireApp(bc.Server, &rc, bc.Data, bc.Jwt, logger) if err != nil { panic(err) } diff --git a/app/comment/service/cmd/wire.go b/app/comment/service/cmd/wire.go index ebda4c5..a721e16 100644 --- a/app/comment/service/cmd/wire.go +++ b/app/comment/service/cmd/wire.go @@ -18,6 +18,6 @@ import ( ) // wireApp init kratos application. -func wireApp(*conf.Server, *conf.Client, *conf.Data, *conf.JWT, log.Logger) (*kratos.App, func(), error) { +func wireApp(*conf.Server, *conf.Registry, *conf.Data, *conf.JWT, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } diff --git a/app/comment/service/cmd/wire_gen.go b/app/comment/service/cmd/wire_gen.go index 9e11ed1..9bff609 100644 --- a/app/comment/service/cmd/wire_gen.go +++ b/app/comment/service/cmd/wire_gen.go @@ -22,21 +22,23 @@ import ( // Injectors from wire.go: // wireApp init kratos application. -func wireApp(confServer *conf.Server, client *conf.Client, confData *conf.Data, jwt *conf.JWT, logger log.Logger) (*kratos.App, func(), error) { +func wireApp(confServer *conf.Server, registry *conf.Registry, confData *conf.Data, jwt *conf.JWT, logger log.Logger) (*kratos.App, func(), error) { db := data.NewMysqlConn(confData, logger) - redisClient := data.NewRedisConn(confData, logger) + client := data.NewRedisConn(confData, logger) writer := data.NewKafkaWriter(confData, logger) - dataData, cleanup, err := data.NewData(db, redisClient, writer, logger) + dataData, cleanup, err := data.NewData(db, client, writer, logger) if err != nil { return nil, nil, err } - userConn := server.NewUserClient(client, logger) - commentRepo := data.NewCommentRepo(dataData, userConn, logger) + discovery := server.NewDiscovery(registry) + userServiceClient := server.NewUserClient(discovery, logger) + commentRepo := data.NewCommentRepo(dataData, userServiceClient, logger) commentUseCase := biz.NewCommentUseCase(commentRepo, logger) commentService := service.NewCommentService(commentUseCase, logger) grpcServer := server.NewGRPCServer(confServer, commentService, logger) httpServer := server.NewHTTPServer(confServer, jwt, commentService, logger) - app := newApp(logger, grpcServer, httpServer) + registrar := server.NewRegistrar(registry) + app := newApp(logger, grpcServer, httpServer, registrar) return app, func() { cleanup() }, nil diff --git a/app/comment/service/internal/conf/conf.pb.go b/app/comment/service/internal/conf/conf.pb.go index d33b86e..900747c 100644 --- a/app/comment/service/internal/conf/conf.pb.go +++ b/app/comment/service/internal/conf/conf.pb.go @@ -28,9 +28,8 @@ type Bootstrap struct { unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` - Client *Client `protobuf:"bytes,2,opt,name=client,proto3" json:"client,omitempty"` - Data *Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - Jwt *JWT `protobuf:"bytes,4,opt,name=jwt,proto3" json:"jwt,omitempty"` + Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Jwt *JWT `protobuf:"bytes,3,opt,name=jwt,proto3" json:"jwt,omitempty"` } func (x *Bootstrap) Reset() { @@ -72,13 +71,6 @@ func (x *Bootstrap) GetServer() *Server { return nil } -func (x *Bootstrap) GetClient() *Client { - if x != nil { - return x.Client - } - return nil -} - func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data @@ -148,17 +140,18 @@ func (x *Server) GetGrpc() *Server_GRPC { return nil } -type Client struct { +type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - User *Client_User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - Publish *Client_Publish `protobuf:"bytes,2,opt,name=publish,proto3" json:"publish,omitempty"` + Mysql *Data_Mysql `protobuf:"bytes,1,opt,name=mysql,proto3" json:"mysql,omitempty"` + Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` + Kafka *Data_Kafka `protobuf:"bytes,3,opt,name=kafka,proto3" json:"kafka,omitempty"` } -func (x *Client) Reset() { - *x = Client{} +func (x *Data) Reset() { + *x = Data{} if protoimpl.UnsafeEnabled { mi := &file_comment_service_internal_conf_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -166,13 +159,13 @@ func (x *Client) Reset() { } } -func (x *Client) String() string { +func (x *Data) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Client) ProtoMessage() {} +func (*Data) ProtoMessage() {} -func (x *Client) ProtoReflect() protoreflect.Message { +func (x *Data) ProtoReflect() protoreflect.Message { mi := &file_comment_service_internal_conf_conf_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -184,37 +177,43 @@ func (x *Client) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Client.ProtoReflect.Descriptor instead. -func (*Client) Descriptor() ([]byte, []int) { +// Deprecated: Use Data.ProtoReflect.Descriptor instead. +func (*Data) Descriptor() ([]byte, []int) { return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{2} } -func (x *Client) GetUser() *Client_User { +func (x *Data) GetMysql() *Data_Mysql { if x != nil { - return x.User + return x.Mysql } return nil } -func (x *Client) GetPublish() *Client_Publish { +func (x *Data) GetRedis() *Data_Redis { if x != nil { - return x.Publish + return x.Redis } return nil } -type Data struct { +func (x *Data) GetKafka() *Data_Kafka { + if x != nil { + return x.Kafka + } + return nil +} + +type JWT struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Mysql *Data_Mysql `protobuf:"bytes,1,opt,name=mysql,proto3" json:"mysql,omitempty"` - Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` - Kafka *Data_Kafka `protobuf:"bytes,3,opt,name=kafka,proto3" json:"kafka,omitempty"` + Http *JWT_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` + Grpc *JWT_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` } -func (x *Data) Reset() { - *x = Data{} +func (x *JWT) Reset() { + *x = JWT{} if protoimpl.UnsafeEnabled { mi := &file_comment_service_internal_conf_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -222,13 +221,13 @@ func (x *Data) Reset() { } } -func (x *Data) String() string { +func (x *JWT) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Data) ProtoMessage() {} +func (*JWT) ProtoMessage() {} -func (x *Data) ProtoReflect() protoreflect.Message { +func (x *JWT) ProtoReflect() protoreflect.Message { mi := &file_comment_service_internal_conf_conf_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -240,43 +239,35 @@ func (x *Data) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Data.ProtoReflect.Descriptor instead. -func (*Data) Descriptor() ([]byte, []int) { +// Deprecated: Use JWT.ProtoReflect.Descriptor instead. +func (*JWT) Descriptor() ([]byte, []int) { return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{3} } -func (x *Data) GetMysql() *Data_Mysql { - if x != nil { - return x.Mysql - } - return nil -} - -func (x *Data) GetRedis() *Data_Redis { +func (x *JWT) GetHttp() *JWT_HTTP { if x != nil { - return x.Redis + return x.Http } return nil } -func (x *Data) GetKafka() *Data_Kafka { +func (x *JWT) GetGrpc() *JWT_GRPC { if x != nil { - return x.Kafka + return x.Grpc } return nil } -type JWT struct { +type Registry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Http *JWT_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` - Grpc *JWT_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` + Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` } -func (x *JWT) Reset() { - *x = JWT{} +func (x *Registry) Reset() { + *x = Registry{} if protoimpl.UnsafeEnabled { mi := &file_comment_service_internal_conf_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -284,13 +275,13 @@ func (x *JWT) Reset() { } } -func (x *JWT) String() string { +func (x *Registry) String() string { return protoimpl.X.MessageStringOf(x) } -func (*JWT) ProtoMessage() {} +func (*Registry) ProtoMessage() {} -func (x *JWT) ProtoReflect() protoreflect.Message { +func (x *Registry) ProtoReflect() protoreflect.Message { mi := &file_comment_service_internal_conf_conf_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -302,21 +293,14 @@ func (x *JWT) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use JWT.ProtoReflect.Descriptor instead. -func (*JWT) Descriptor() ([]byte, []int) { +// Deprecated: Use Registry.ProtoReflect.Descriptor instead. +func (*Registry) Descriptor() ([]byte, []int) { return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{4} } -func (x *JWT) GetHttp() *JWT_HTTP { +func (x *Registry) GetConsul() *Registry_Consul { if x != nil { - return x.Http - } - return nil -} - -func (x *JWT) GetGrpc() *JWT_GRPC { - if x != nil { - return x.Grpc + return x.Consul } return nil } @@ -447,100 +431,6 @@ func (x *Server_GRPC) GetTimeout() *durationpb.Duration { return nil } -type Client_User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *Client_User) Reset() { - *x = Client_User{} - if protoimpl.UnsafeEnabled { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Client_User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Client_User) ProtoMessage() {} - -func (x *Client_User) ProtoReflect() protoreflect.Message { - mi := &file_comment_service_internal_conf_conf_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 Client_User.ProtoReflect.Descriptor instead. -func (*Client_User) Descriptor() ([]byte, []int) { - return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *Client_User) GetTo() string { - if x != nil { - return x.To - } - return "" -} - -type Client_Publish struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *Client_Publish) Reset() { - *x = Client_Publish{} - if protoimpl.UnsafeEnabled { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Client_Publish) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Client_Publish) ProtoMessage() {} - -func (x *Client_Publish) ProtoReflect() protoreflect.Message { - mi := &file_comment_service_internal_conf_conf_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 Client_Publish.ProtoReflect.Descriptor instead. -func (*Client_Publish) Descriptor() ([]byte, []int) { - return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *Client_Publish) GetTo() string { - if x != nil { - return x.To - } - return "" -} - type Data_Mysql struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -553,7 +443,7 @@ type Data_Mysql struct { func (x *Data_Mysql) Reset() { *x = Data_Mysql{} if protoimpl.UnsafeEnabled { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[9] + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -566,7 +456,7 @@ func (x *Data_Mysql) String() string { func (*Data_Mysql) ProtoMessage() {} func (x *Data_Mysql) ProtoReflect() protoreflect.Message { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[9] + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -579,7 +469,7 @@ func (x *Data_Mysql) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Mysql.ProtoReflect.Descriptor instead. func (*Data_Mysql) Descriptor() ([]byte, []int) { - return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} + return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} } func (x *Data_Mysql) GetDriver() string { @@ -611,7 +501,7 @@ type Data_Redis struct { func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -624,7 +514,7 @@ func (x *Data_Redis) String() string { func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -637,7 +527,7 @@ func (x *Data_Redis) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Redis.ProtoReflect.Descriptor instead. func (*Data_Redis) Descriptor() ([]byte, []int) { - return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 1} + return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 1} } func (x *Data_Redis) GetDb() int32 { @@ -690,7 +580,7 @@ type Data_Kafka struct { func (x *Data_Kafka) Reset() { *x = Data_Kafka{} if protoimpl.UnsafeEnabled { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[11] + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -703,7 +593,7 @@ func (x *Data_Kafka) String() string { func (*Data_Kafka) ProtoMessage() {} func (x *Data_Kafka) ProtoReflect() protoreflect.Message { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[11] + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -716,7 +606,7 @@ func (x *Data_Kafka) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Kafka.ProtoReflect.Descriptor instead. func (*Data_Kafka) Descriptor() ([]byte, []int) { - return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 2} + return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 2} } func (x *Data_Kafka) GetAddr() string { @@ -765,7 +655,7 @@ type JWT_HTTP struct { func (x *JWT_HTTP) Reset() { *x = JWT_HTTP{} if protoimpl.UnsafeEnabled { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[12] + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -778,7 +668,7 @@ func (x *JWT_HTTP) String() string { func (*JWT_HTTP) ProtoMessage() {} func (x *JWT_HTTP) ProtoReflect() protoreflect.Message { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[12] + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -791,7 +681,7 @@ func (x *JWT_HTTP) ProtoReflect() protoreflect.Message { // Deprecated: Use JWT_HTTP.ProtoReflect.Descriptor instead. func (*JWT_HTTP) Descriptor() ([]byte, []int) { - return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 0} + return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} } func (x *JWT_HTTP) GetTokenKey() string { @@ -812,7 +702,7 @@ type JWT_GRPC struct { func (x *JWT_GRPC) Reset() { *x = JWT_GRPC{} if protoimpl.UnsafeEnabled { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[13] + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -825,7 +715,7 @@ func (x *JWT_GRPC) String() string { func (*JWT_GRPC) ProtoMessage() {} func (x *JWT_GRPC) ProtoReflect() protoreflect.Message { - mi := &file_comment_service_internal_conf_conf_proto_msgTypes[13] + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -838,7 +728,7 @@ func (x *JWT_GRPC) ProtoReflect() protoreflect.Message { // Deprecated: Use JWT_GRPC.ProtoReflect.Descriptor instead. func (*JWT_GRPC) Descriptor() ([]byte, []int) { - return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 1} + return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 1} } func (x *JWT_GRPC) GetTokenKey() string { @@ -848,6 +738,61 @@ func (x *JWT_GRPC) GetTokenKey() string { return "" } +type Registry_Consul struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` +} + +func (x *Registry_Consul) Reset() { + *x = Registry_Consul{} + if protoimpl.UnsafeEnabled { + mi := &file_comment_service_internal_conf_conf_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Consul) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Consul) ProtoMessage() {} + +func (x *Registry_Consul) ProtoReflect() protoreflect.Message { + mi := &file_comment_service_internal_conf_conf_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 Registry_Consul.ProtoReflect.Descriptor instead. +func (*Registry_Consul) Descriptor() ([]byte, []int) { + return file_comment_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *Registry_Consul) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Consul) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + var File_comment_service_internal_conf_conf_proto protoreflect.FileDescriptor var file_comment_service_internal_conf_conf_proto_rawDesc = []byte{ @@ -857,117 +802,110 @@ var file_comment_service_internal_conf_conf_proto_rawDesc = []byte{ 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x01, 0x0a, 0x09, 0x42, 0x6f, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x34, - 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x52, - 0x03, 0x6a, 0x77, 0x74, 0x22, 0xde, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, - 0x3e, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, - 0x3e, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, - 0x69, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, - 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, - 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, - 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, - 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xc4, 0x01, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x12, 0x3e, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, - 0x12, 0x47, 0x0a, 0x07, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, - 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x52, 0x07, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x1a, 0x16, 0x0a, 0x04, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, - 0x6f, 0x1a, 0x19, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, - 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x22, 0xa3, 0x05, 0x0a, - 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, - 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x52, - 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x3f, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, - 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, 0x3f, 0x0a, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x61, 0x66, 0x6b, - 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x1a, 0x31, 0x0a, 0x05, 0x4d, 0x79, 0x73, 0x71, - 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x1a, 0xc5, 0x01, 0x0a, 0x05, - 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x1a, 0xdc, 0x01, 0x0a, 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x12, 0x0a, - 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, - 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x70, - 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x03, 0x4a, 0x57, 0x54, 0x12, 0x3b, 0x0a, 0x04, 0x68, 0x74, - 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x48, 0x54, 0x54, - 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x3b, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x34, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, + 0x52, 0x03, 0x6a, 0x77, 0x74, 0x22, 0xde, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x12, 0x3e, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, + 0x12, 0x3e, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, + 0x1a, 0x69, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, + 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, + 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, + 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xa3, 0x05, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x3f, 0x0a, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, + 0x12, 0x3f, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, + 0x73, 0x12, 0x3f, 0x0a, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, + 0x6b, 0x61, 0x1a, 0x31, 0x0a, 0x05, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, + 0x76, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x64, 0x73, 0x6e, 0x1a, 0xc5, 0x01, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, + 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, + 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, + 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, + 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, + 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0xdc, 0x01, + 0x0a, 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x63, + 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x70, 0x69, 0x63, + 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, + 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xc9, 0x01, 0x0a, + 0x03, 0x4a, 0x57, 0x54, 0x12, 0x3b, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, + 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, + 0x70, 0x12, 0x3b, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x4a, 0x57, 0x54, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x23, + 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x4b, 0x65, 0x79, 0x1a, 0x23, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x1b, 0x0a, 0x09, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x22, 0x8e, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, - 0x67, 0x72, 0x70, 0x63, 0x1a, 0x23, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x1b, 0x0a, 0x09, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x1a, 0x23, 0x0a, 0x04, 0x47, 0x52, 0x50, - 0x43, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x42, 0x48, - 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6f, - 0x6d, 0x61, 0x6e, 0x79, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, 0x75, - 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, - 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, + 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, 0x0a, + 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6f, 0x6d, 0x61, 0x6e, 0x79, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, 0x75, 0x73, 0x2f, 0x61, 0x70, 0x70, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, + 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -982,49 +920,46 @@ func file_comment_service_internal_conf_conf_proto_rawDescGZIP() []byte { return file_comment_service_internal_conf_conf_proto_rawDescData } -var file_comment_service_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_comment_service_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_comment_service_internal_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: comment.service.internal.conf.Bootstrap (*Server)(nil), // 1: comment.service.internal.conf.Server - (*Client)(nil), // 2: comment.service.internal.conf.Client - (*Data)(nil), // 3: comment.service.internal.conf.Data - (*JWT)(nil), // 4: comment.service.internal.conf.JWT + (*Data)(nil), // 2: comment.service.internal.conf.Data + (*JWT)(nil), // 3: comment.service.internal.conf.JWT + (*Registry)(nil), // 4: comment.service.internal.conf.Registry (*Server_HTTP)(nil), // 5: comment.service.internal.conf.Server.HTTP (*Server_GRPC)(nil), // 6: comment.service.internal.conf.Server.GRPC - (*Client_User)(nil), // 7: comment.service.internal.conf.Client.User - (*Client_Publish)(nil), // 8: comment.service.internal.conf.Client.Publish - (*Data_Mysql)(nil), // 9: comment.service.internal.conf.Data.Mysql - (*Data_Redis)(nil), // 10: comment.service.internal.conf.Data.Redis - (*Data_Kafka)(nil), // 11: comment.service.internal.conf.Data.Kafka - (*JWT_HTTP)(nil), // 12: comment.service.internal.conf.JWT.HTTP - (*JWT_GRPC)(nil), // 13: comment.service.internal.conf.JWT.GRPC - (*durationpb.Duration)(nil), // 14: google.protobuf.Duration + (*Data_Mysql)(nil), // 7: comment.service.internal.conf.Data.Mysql + (*Data_Redis)(nil), // 8: comment.service.internal.conf.Data.Redis + (*Data_Kafka)(nil), // 9: comment.service.internal.conf.Data.Kafka + (*JWT_HTTP)(nil), // 10: comment.service.internal.conf.JWT.HTTP + (*JWT_GRPC)(nil), // 11: comment.service.internal.conf.JWT.GRPC + (*Registry_Consul)(nil), // 12: comment.service.internal.conf.Registry.Consul + (*durationpb.Duration)(nil), // 13: google.protobuf.Duration } var file_comment_service_internal_conf_conf_proto_depIdxs = []int32{ 1, // 0: comment.service.internal.conf.Bootstrap.server:type_name -> comment.service.internal.conf.Server - 2, // 1: comment.service.internal.conf.Bootstrap.client:type_name -> comment.service.internal.conf.Client - 3, // 2: comment.service.internal.conf.Bootstrap.data:type_name -> comment.service.internal.conf.Data - 4, // 3: comment.service.internal.conf.Bootstrap.jwt:type_name -> comment.service.internal.conf.JWT - 5, // 4: comment.service.internal.conf.Server.http:type_name -> comment.service.internal.conf.Server.HTTP - 6, // 5: comment.service.internal.conf.Server.grpc:type_name -> comment.service.internal.conf.Server.GRPC - 7, // 6: comment.service.internal.conf.Client.user:type_name -> comment.service.internal.conf.Client.User - 8, // 7: comment.service.internal.conf.Client.publish:type_name -> comment.service.internal.conf.Client.Publish - 9, // 8: comment.service.internal.conf.Data.mysql:type_name -> comment.service.internal.conf.Data.Mysql - 10, // 9: comment.service.internal.conf.Data.redis:type_name -> comment.service.internal.conf.Data.Redis - 11, // 10: comment.service.internal.conf.Data.kafka:type_name -> comment.service.internal.conf.Data.Kafka - 12, // 11: comment.service.internal.conf.JWT.http:type_name -> comment.service.internal.conf.JWT.HTTP - 13, // 12: comment.service.internal.conf.JWT.grpc:type_name -> comment.service.internal.conf.JWT.GRPC - 14, // 13: comment.service.internal.conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration - 14, // 14: comment.service.internal.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration - 14, // 15: comment.service.internal.conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration - 14, // 16: comment.service.internal.conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration - 14, // 17: comment.service.internal.conf.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration - 14, // 18: comment.service.internal.conf.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration - 19, // [19:19] is the sub-list for method output_type - 19, // [19:19] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 2, // 1: comment.service.internal.conf.Bootstrap.data:type_name -> comment.service.internal.conf.Data + 3, // 2: comment.service.internal.conf.Bootstrap.jwt:type_name -> comment.service.internal.conf.JWT + 5, // 3: comment.service.internal.conf.Server.http:type_name -> comment.service.internal.conf.Server.HTTP + 6, // 4: comment.service.internal.conf.Server.grpc:type_name -> comment.service.internal.conf.Server.GRPC + 7, // 5: comment.service.internal.conf.Data.mysql:type_name -> comment.service.internal.conf.Data.Mysql + 8, // 6: comment.service.internal.conf.Data.redis:type_name -> comment.service.internal.conf.Data.Redis + 9, // 7: comment.service.internal.conf.Data.kafka:type_name -> comment.service.internal.conf.Data.Kafka + 10, // 8: comment.service.internal.conf.JWT.http:type_name -> comment.service.internal.conf.JWT.HTTP + 11, // 9: comment.service.internal.conf.JWT.grpc:type_name -> comment.service.internal.conf.JWT.GRPC + 12, // 10: comment.service.internal.conf.Registry.consul:type_name -> comment.service.internal.conf.Registry.Consul + 13, // 11: comment.service.internal.conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration + 13, // 12: comment.service.internal.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration + 13, // 13: comment.service.internal.conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration + 13, // 14: comment.service.internal.conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration + 13, // 15: comment.service.internal.conf.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration + 13, // 16: comment.service.internal.conf.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_comment_service_internal_conf_conf_proto_init() } @@ -1058,7 +993,7 @@ func file_comment_service_internal_conf_conf_proto_init() { } } file_comment_service_internal_conf_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client); i { + switch v := v.(*Data); i { case 0: return &v.state case 1: @@ -1070,7 +1005,7 @@ func file_comment_service_internal_conf_conf_proto_init() { } } file_comment_service_internal_conf_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data); i { + switch v := v.(*JWT); i { case 0: return &v.state case 1: @@ -1082,7 +1017,7 @@ func file_comment_service_internal_conf_conf_proto_init() { } } file_comment_service_internal_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT); i { + switch v := v.(*Registry); i { case 0: return &v.state case 1: @@ -1118,7 +1053,7 @@ func file_comment_service_internal_conf_conf_proto_init() { } } file_comment_service_internal_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client_User); i { + switch v := v.(*Data_Mysql); i { case 0: return &v.state case 1: @@ -1130,7 +1065,7 @@ func file_comment_service_internal_conf_conf_proto_init() { } } file_comment_service_internal_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client_Publish); i { + switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: @@ -1142,7 +1077,7 @@ func file_comment_service_internal_conf_conf_proto_init() { } } file_comment_service_internal_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Mysql); i { + switch v := v.(*Data_Kafka); i { case 0: return &v.state case 1: @@ -1154,7 +1089,7 @@ func file_comment_service_internal_conf_conf_proto_init() { } } file_comment_service_internal_conf_conf_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Redis); i { + switch v := v.(*JWT_HTTP); i { case 0: return &v.state case 1: @@ -1166,7 +1101,7 @@ func file_comment_service_internal_conf_conf_proto_init() { } } file_comment_service_internal_conf_conf_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Kafka); i { + switch v := v.(*JWT_GRPC); i { case 0: return &v.state case 1: @@ -1178,19 +1113,7 @@ func file_comment_service_internal_conf_conf_proto_init() { } } file_comment_service_internal_conf_conf_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT_HTTP); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_comment_service_internal_conf_conf_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT_GRPC); i { + switch v := v.(*Registry_Consul); i { case 0: return &v.state case 1: @@ -1208,7 +1131,7 @@ func file_comment_service_internal_conf_conf_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_comment_service_internal_conf_conf_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/app/comment/service/internal/conf/conf.proto b/app/comment/service/internal/conf/conf.proto index c68ab55..9426cfd 100644 --- a/app/comment/service/internal/conf/conf.proto +++ b/app/comment/service/internal/conf/conf.proto @@ -7,9 +7,8 @@ option go_package = "github.com/toomanysource/atreus/app/comment/service/interna message Bootstrap { Server server = 1; - Client client = 2; - Data data = 3; - JWT jwt = 4; + Data data = 2; + JWT jwt = 3; } message Server { @@ -27,17 +26,6 @@ message Server { GRPC grpc = 2; } -message Client { - message User { - string to = 1; - } - message Publish { - string to = 1; - } - User user = 1; - Publish publish = 2; -} - message Data { message Mysql { string driver = 1; @@ -72,3 +60,11 @@ message JWT { HTTP http = 1; GRPC grpc = 2; } + +message Registry { + message Consul { + string address = 1; + string scheme = 2; + } + Consul consul = 1; +} diff --git a/app/comment/service/internal/data/comment.go b/app/comment/service/internal/data/comment.go index b35691a..63dc2fa 100644 --- a/app/comment/service/internal/data/comment.go +++ b/app/comment/service/internal/data/comment.go @@ -9,6 +9,8 @@ import ( "strconv" "time" + userv1 "github.com/toomanysource/atreus/api/user/service/v1" + "github.com/toomanysource/atreus/pkg/kafkaX" "github.com/segmentio/kafka-go" @@ -17,8 +19,6 @@ import ( "github.com/toomanysource/atreus/middleware" - "github.com/toomanysource/atreus/app/comment/service/internal/server" - "github.com/jinzhu/copier" "github.com/toomanysource/atreus/app/comment/service/internal/biz" @@ -55,7 +55,7 @@ type commentRepo struct { } func NewCommentRepo( - data *Data, userConn server.UserConn, logger log.Logger, + data *Data, userConn userv1.UserServiceClient, logger log.Logger, ) biz.CommentRepo { return &commentRepo{ data: data, diff --git a/app/comment/service/internal/data/user.go b/app/comment/service/internal/data/user.go index 580a796..4971d8e 100644 --- a/app/comment/service/internal/data/user.go +++ b/app/comment/service/internal/data/user.go @@ -8,16 +8,15 @@ import ( pb "github.com/toomanysource/atreus/api/user/service/v1" "github.com/toomanysource/atreus/app/comment/service/internal/biz" - "github.com/toomanysource/atreus/app/comment/service/internal/server" ) type userRepo struct { client pb.UserServiceClient } -func NewUserRepo(conn server.UserConn) UserRepo { +func NewUserRepo(conn pb.UserServiceClient) UserRepo { return &userRepo{ - client: pb.NewUserServiceClient(conn), + client: conn, } } diff --git a/app/comment/service/internal/server/server.go b/app/comment/service/internal/server/server.go index 2f25cc2..2957b9a 100644 --- a/app/comment/service/internal/server/server.go +++ b/app/comment/service/internal/server/server.go @@ -8,24 +8,26 @@ import ( "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/logging" "github.com/go-kratos/kratos/v2/middleware/recovery" + "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/google/wire" - stdgrpc "google.golang.org/grpc" -) -// ProviderSet is server providers. -var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewUserClient) + "github.com/go-kratos/kratos/contrib/registry/consul/v2" + "github.com/hashicorp/consul/api" -type ( - UserConn stdgrpc.ClientConnInterface + userv1 "github.com/toomanysource/atreus/api/user/service/v1" ) +// ProviderSet is server providers. +var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewUserClient, NewDiscovery, NewRegistrar) + // NewUserClient 创建一个User服务客户端,接收User服务数据 -func NewUserClient(c *conf.Client, logger log.Logger) UserConn { +func NewUserClient(r registry.Discovery, logger log.Logger) userv1.UserServiceClient { logs := log.NewHelper(log.With(logger, "module", "server/user")) conn, err := grpc.DialInsecure( context.Background(), - grpc.WithEndpoint(c.User.To), + grpc.WithEndpoint("discovery:///atreus.user.service"), + grpc.WithDiscovery(r), grpc.WithMiddleware( recovery.Recovery(), logging.Client(logger), @@ -35,5 +37,29 @@ func NewUserClient(c *conf.Client, logger log.Logger) UserConn { logs.Fatalf("user service connect error, %v", err) } logs.Info("user service connect successfully") - return conn + return userv1.NewUserServiceClient(conn) +} + +func NewDiscovery(conf *conf.Registry) registry.Discovery { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) + } + r := consul.New(cli, consul.WithHealthCheck(false)) + return r +} + +func NewRegistrar(conf *conf.Registry) registry.Registrar { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) + } + r := consul.New(cli, consul.WithHealthCheck(false)) + return r } diff --git a/app/favorite/service/cmd/main.go b/app/favorite/service/cmd/main.go index 6947614..75268a1 100644 --- a/app/favorite/service/cmd/main.go +++ b/app/favorite/service/cmd/main.go @@ -8,6 +8,7 @@ import ( "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/go-kratos/kratos/v2/transport/http" @@ -27,7 +28,7 @@ func init() { flag.StringVar(&flagConf, "conf", "../configs", "config path, eg: -conf config.yaml") } -func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { +func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.Name(Name), kratos.Logger(logger), @@ -35,6 +36,7 @@ func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { gs, hs, ), + kratos.Registrar(rr), ) } @@ -61,7 +63,11 @@ func main() { if err := c.Scan(&bc); err != nil { panic(err) } - app, cleanup, err := wireApp(bc.Server, bc.Client, bc.Data, bc.Jwt, logger) + var rc conf.Registry + if err := c.Scan(&rc); err != nil { + panic(err) + } + app, cleanup, err := wireApp(bc.Server, &rc, bc.Data, bc.Jwt, logger) if err != nil { panic(err) } diff --git a/app/favorite/service/cmd/wire.go b/app/favorite/service/cmd/wire.go index 843df60..f60692e 100644 --- a/app/favorite/service/cmd/wire.go +++ b/app/favorite/service/cmd/wire.go @@ -18,6 +18,6 @@ import ( ) // wireApp init kratos application. -func wireApp(*conf.Server, *conf.Client, *conf.Data, *conf.JWT, log.Logger) (*kratos.App, func(), error) { +func wireApp(*conf.Server, *conf.Registry, *conf.Data, *conf.JWT, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } diff --git a/app/favorite/service/cmd/wire_gen.go b/app/favorite/service/cmd/wire_gen.go index 546f65a..1d3b85d 100644 --- a/app/favorite/service/cmd/wire_gen.go +++ b/app/favorite/service/cmd/wire_gen.go @@ -22,21 +22,23 @@ import ( // Injectors from wire.go: // wireApp init kratos application. -func wireApp(confServer *conf.Server, client *conf.Client, confData *conf.Data, jwt *conf.JWT, logger log.Logger) (*kratos.App, func(), error) { +func wireApp(confServer *conf.Server, registry *conf.Registry, confData *conf.Data, jwt *conf.JWT, logger log.Logger) (*kratos.App, func(), error) { db := data.NewMysqlConn(confData, logger) - redisClient := data.NewRedisConn(confData, logger) + client := data.NewRedisConn(confData, logger) kfkWriter := data.NewKafkaWriter(confData, logger) - dataData, cleanup, err := data.NewData(db, redisClient, kfkWriter, logger) + dataData, cleanup, err := data.NewData(db, client, kfkWriter, logger) if err != nil { return nil, nil, err } - publishConn := server.NewPublishClient(client, logger) - favoriteRepo := data.NewFavoriteRepo(dataData, publishConn, logger) + discovery := server.NewDiscovery(registry) + publishServiceClient := server.NewPublishClient(discovery, logger) + favoriteRepo := data.NewFavoriteRepo(dataData, publishServiceClient, logger) favoriteUseCase := biz.NewFavoriteUseCase(favoriteRepo, logger) favoriteService := service.NewFavoriteService(favoriteUseCase, logger) grpcServer := server.NewGRPCServer(confServer, favoriteService, logger) httpServer := server.NewHTTPServer(confServer, jwt, favoriteService, logger) - app := newApp(logger, grpcServer, httpServer) + registrar := server.NewRegistrar(registry) + app := newApp(logger, grpcServer, httpServer, registrar) return app, func() { cleanup() }, nil diff --git a/app/favorite/service/internal/conf/conf.pb.go b/app/favorite/service/internal/conf/conf.pb.go index 8517ceb..cbafc54 100644 --- a/app/favorite/service/internal/conf/conf.pb.go +++ b/app/favorite/service/internal/conf/conf.pb.go @@ -28,9 +28,8 @@ type Bootstrap struct { unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` - Client *Client `protobuf:"bytes,2,opt,name=client,proto3" json:"client,omitempty"` - Data *Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - Jwt *JWT `protobuf:"bytes,4,opt,name=jwt,proto3" json:"jwt,omitempty"` + Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Jwt *JWT `protobuf:"bytes,3,opt,name=jwt,proto3" json:"jwt,omitempty"` } func (x *Bootstrap) Reset() { @@ -72,13 +71,6 @@ func (x *Bootstrap) GetServer() *Server { return nil } -func (x *Bootstrap) GetClient() *Client { - if x != nil { - return x.Client - } - return nil -} - func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data @@ -321,6 +313,53 @@ func (x *JWT) GetGrpc() *JWT_GRPC { return nil } +type Registry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` +} + +func (x *Registry) Reset() { + *x = Registry{} + if protoimpl.UnsafeEnabled { + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry) ProtoMessage() {} + +func (x *Registry) ProtoReflect() protoreflect.Message { + mi := &file_favorite_service_internal_conf_conf_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 Registry.ProtoReflect.Descriptor instead. +func (*Registry) Descriptor() ([]byte, []int) { + return file_favorite_service_internal_conf_conf_proto_rawDescGZIP(), []int{5} +} + +func (x *Registry) GetConsul() *Registry_Consul { + if x != nil { + return x.Consul + } + return nil +} + type Server_HTTP struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -334,7 +373,7 @@ type Server_HTTP struct { func (x *Server_HTTP) Reset() { *x = Server_HTTP{} if protoimpl.UnsafeEnabled { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[5] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -347,7 +386,7 @@ func (x *Server_HTTP) String() string { func (*Server_HTTP) ProtoMessage() {} func (x *Server_HTTP) ProtoReflect() protoreflect.Message { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[5] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -397,7 +436,7 @@ type Server_GRPC struct { func (x *Server_GRPC) Reset() { *x = Server_GRPC{} if protoimpl.UnsafeEnabled { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[6] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -410,7 +449,7 @@ func (x *Server_GRPC) String() string { func (*Server_GRPC) ProtoMessage() {} func (x *Server_GRPC) ProtoReflect() protoreflect.Message { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[6] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -458,7 +497,7 @@ type Client_User struct { func (x *Client_User) Reset() { *x = Client_User{} if protoimpl.UnsafeEnabled { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[7] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -471,7 +510,7 @@ func (x *Client_User) String() string { func (*Client_User) ProtoMessage() {} func (x *Client_User) ProtoReflect() protoreflect.Message { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[7] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -505,7 +544,7 @@ type Client_Publish struct { func (x *Client_Publish) Reset() { *x = Client_Publish{} if protoimpl.UnsafeEnabled { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[8] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -518,7 +557,7 @@ func (x *Client_Publish) String() string { func (*Client_Publish) ProtoMessage() {} func (x *Client_Publish) ProtoReflect() protoreflect.Message { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[8] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -553,7 +592,7 @@ type Data_Mysql struct { func (x *Data_Mysql) Reset() { *x = Data_Mysql{} if protoimpl.UnsafeEnabled { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[9] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -566,7 +605,7 @@ func (x *Data_Mysql) String() string { func (*Data_Mysql) ProtoMessage() {} func (x *Data_Mysql) ProtoReflect() protoreflect.Message { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[9] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -611,7 +650,7 @@ type Data_Redis struct { func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -624,7 +663,7 @@ func (x *Data_Redis) String() string { func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -692,7 +731,7 @@ type Data_Kafka struct { func (x *Data_Kafka) Reset() { *x = Data_Kafka{} if protoimpl.UnsafeEnabled { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[11] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -705,7 +744,7 @@ func (x *Data_Kafka) String() string { func (*Data_Kafka) ProtoMessage() {} func (x *Data_Kafka) ProtoReflect() protoreflect.Message { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[11] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -781,7 +820,7 @@ type JWT_HTTP struct { func (x *JWT_HTTP) Reset() { *x = JWT_HTTP{} if protoimpl.UnsafeEnabled { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[12] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -794,7 +833,7 @@ func (x *JWT_HTTP) String() string { func (*JWT_HTTP) ProtoMessage() {} func (x *JWT_HTTP) ProtoReflect() protoreflect.Message { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[12] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -828,7 +867,7 @@ type JWT_GRPC struct { func (x *JWT_GRPC) Reset() { *x = JWT_GRPC{} if protoimpl.UnsafeEnabled { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[13] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -841,7 +880,7 @@ func (x *JWT_GRPC) String() string { func (*JWT_GRPC) ProtoMessage() {} func (x *JWT_GRPC) ProtoReflect() protoreflect.Message { - mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[13] + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -864,6 +903,61 @@ func (x *JWT_GRPC) GetTokenKey() string { return "" } +type Registry_Consul struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` +} + +func (x *Registry_Consul) Reset() { + *x = Registry_Consul{} + if protoimpl.UnsafeEnabled { + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Consul) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Consul) ProtoMessage() {} + +func (x *Registry_Consul) ProtoReflect() protoreflect.Message { + mi := &file_favorite_service_internal_conf_conf_proto_msgTypes[15] + 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 Registry_Consul.ProtoReflect.Descriptor instead. +func (*Registry_Consul) Descriptor() ([]byte, []int) { + return file_favorite_service_internal_conf_conf_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *Registry_Consul) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Consul) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + var File_favorite_service_internal_conf_conf_proto protoreflect.FileDescriptor var file_favorite_service_internal_conf_conf_proto_rawDesc = []byte{ @@ -872,108 +966,113 @@ var file_favorite_service_internal_conf_conf_proto_rawDesc = []byte{ 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x2a, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6b, 0x72, - 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x57, - 0x54, 0x52, 0x03, 0x6a, 0x77, 0x74, 0x22, 0xb8, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x17, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x2b, - 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6b, - 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x69, 0x0a, 0x04, 0x48, - 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, - 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, - 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, - 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6b, 0x72, 0x61, - 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x07, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6b, 0x72, 0x61, - 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x50, - 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x07, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x1a, - 0x16, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x1a, 0x19, 0x0a, 0x07, 0x50, 0x75, 0x62, 0x6c, 0x69, - 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x74, 0x6f, 0x22, 0xc3, 0x05, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x05, 0x6d, - 0x79, 0x73, 0x71, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6b, 0x72, 0x61, - 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x79, 0x73, - 0x71, 0x6c, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x2c, 0x0a, 0x05, 0x72, 0x65, 0x64, - 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, - 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x52, 0x05, - 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x1a, 0x31, 0x0a, 0x05, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x16, - 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x1a, 0xc5, 0x01, 0x0a, 0x05, 0x52, 0x65, 0x64, - 0x69, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, - 0x64, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x1a, 0xb5, 0x02, 0x0a, 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, - 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x30, - 0x0a, 0x14, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, - 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x76, 0x69, - 0x64, 0x65, 0x6f, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, - 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x70, - 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, - 0x74, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x61, 0x76, 0x6f, 0x72, - 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x66, 0x61, 0x76, 0x6f, 0x72, 0x65, 0x64, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x1c, 0x0a, 0x09, - 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, - 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, - 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xa3, 0x01, 0x0a, 0x03, 0x4a, 0x57, 0x54, - 0x12, 0x28, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, - 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x57, 0x54, 0x2e, - 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x28, 0x0a, 0x04, 0x67, 0x72, - 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, - 0x67, 0x72, 0x70, 0x63, 0x1a, 0x23, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x1b, 0x0a, 0x09, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x1a, 0x23, 0x0a, 0x04, 0x47, 0x52, 0x50, - 0x43, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x42, 0x49, - 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6f, - 0x6d, 0x61, 0x6e, 0x79, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, 0x75, - 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x2f, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x72, 0x12, 0x24, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x10, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, + 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x4a, 0x57, 0x54, 0x52, 0x03, 0x6a, 0x77, 0x74, 0x22, 0xb8, 0x02, 0x0a, 0x06, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, + 0x74, 0x70, 0x12, 0x2b, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x17, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x53, 0x65, + 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, + 0x69, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, + 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, + 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, + 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x9e, 0x01, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, + 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x34, 0x0a, + 0x07, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x52, 0x07, 0x70, 0x75, 0x62, 0x6c, + 0x69, 0x73, 0x68, 0x1a, 0x16, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x74, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x1a, 0x19, 0x0a, 0x07, 0x50, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x22, 0xc3, 0x05, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x2c, 0x0a, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x2e, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x2c, 0x0a, + 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6b, + 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, + 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x6b, + 0x61, 0x66, 0x6b, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6b, 0x72, 0x61, + 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x61, 0x66, + 0x6b, 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x1a, 0x31, 0x0a, 0x05, 0x4d, 0x79, 0x73, + 0x71, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x1a, 0xc5, 0x01, 0x0a, + 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x6f, 0x75, 0x74, 0x1a, 0xb5, 0x02, 0x0a, 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x12, + 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, + 0x64, 0x72, 0x12, 0x30, 0x0a, 0x14, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x66, 0x61, 0x76, 0x6f, + 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x12, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x54, + 0x6f, 0x70, 0x69, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, + 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x61, + 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x23, 0x0a, 0x0d, 0x66, + 0x61, 0x76, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0c, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x65, 0x64, 0x54, 0x6f, 0x70, 0x69, 0x63, + 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, + 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xa3, 0x01, 0x0a, + 0x03, 0x4a, 0x57, 0x54, 0x12, 0x28, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x4a, 0x57, 0x54, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x28, + 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6b, + 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x47, 0x52, + 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x23, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x1a, 0x23, 0x0a, + 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, + 0x65, 0x79, 0x22, 0x7b, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x33, + 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x6b, 0x72, 0x61, 0x74, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, + 0x73, 0x75, 0x6c, 0x1a, 0x3a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x42, + 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, + 0x6f, 0x6d, 0x61, 0x6e, 0x79, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, + 0x75, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x2f, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -988,44 +1087,46 @@ func file_favorite_service_internal_conf_conf_proto_rawDescGZIP() []byte { return file_favorite_service_internal_conf_conf_proto_rawDescData } -var file_favorite_service_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_favorite_service_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_favorite_service_internal_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: kratos.api.Bootstrap (*Server)(nil), // 1: kratos.api.Server (*Client)(nil), // 2: kratos.api.Client (*Data)(nil), // 3: kratos.api.Data (*JWT)(nil), // 4: kratos.api.JWT - (*Server_HTTP)(nil), // 5: kratos.api.Server.HTTP - (*Server_GRPC)(nil), // 6: kratos.api.Server.GRPC - (*Client_User)(nil), // 7: kratos.api.Client.User - (*Client_Publish)(nil), // 8: kratos.api.Client.Publish - (*Data_Mysql)(nil), // 9: kratos.api.Data.Mysql - (*Data_Redis)(nil), // 10: kratos.api.Data.Redis - (*Data_Kafka)(nil), // 11: kratos.api.Data.Kafka - (*JWT_HTTP)(nil), // 12: kratos.api.JWT.HTTP - (*JWT_GRPC)(nil), // 13: kratos.api.JWT.GRPC - (*durationpb.Duration)(nil), // 14: google.protobuf.Duration + (*Registry)(nil), // 5: kratos.api.Registry + (*Server_HTTP)(nil), // 6: kratos.api.Server.HTTP + (*Server_GRPC)(nil), // 7: kratos.api.Server.GRPC + (*Client_User)(nil), // 8: kratos.api.Client.User + (*Client_Publish)(nil), // 9: kratos.api.Client.Publish + (*Data_Mysql)(nil), // 10: kratos.api.Data.Mysql + (*Data_Redis)(nil), // 11: kratos.api.Data.Redis + (*Data_Kafka)(nil), // 12: kratos.api.Data.Kafka + (*JWT_HTTP)(nil), // 13: kratos.api.JWT.HTTP + (*JWT_GRPC)(nil), // 14: kratos.api.JWT.GRPC + (*Registry_Consul)(nil), // 15: kratos.api.Registry.Consul + (*durationpb.Duration)(nil), // 16: google.protobuf.Duration } var file_favorite_service_internal_conf_conf_proto_depIdxs = []int32{ 1, // 0: kratos.api.Bootstrap.server:type_name -> kratos.api.Server - 2, // 1: kratos.api.Bootstrap.client:type_name -> kratos.api.Client - 3, // 2: kratos.api.Bootstrap.data:type_name -> kratos.api.Data - 4, // 3: kratos.api.Bootstrap.jwt:type_name -> kratos.api.JWT - 5, // 4: kratos.api.Server.http:type_name -> kratos.api.Server.HTTP - 6, // 5: kratos.api.Server.grpc:type_name -> kratos.api.Server.GRPC - 7, // 6: kratos.api.Client.user:type_name -> kratos.api.Client.User - 8, // 7: kratos.api.Client.publish:type_name -> kratos.api.Client.Publish - 9, // 8: kratos.api.Data.mysql:type_name -> kratos.api.Data.Mysql - 10, // 9: kratos.api.Data.redis:type_name -> kratos.api.Data.Redis - 11, // 10: kratos.api.Data.kafka:type_name -> kratos.api.Data.Kafka - 12, // 11: kratos.api.JWT.http:type_name -> kratos.api.JWT.HTTP - 13, // 12: kratos.api.JWT.grpc:type_name -> kratos.api.JWT.GRPC - 14, // 13: kratos.api.Server.HTTP.timeout:type_name -> google.protobuf.Duration - 14, // 14: kratos.api.Server.GRPC.timeout:type_name -> google.protobuf.Duration - 14, // 15: kratos.api.Data.Redis.read_timeout:type_name -> google.protobuf.Duration - 14, // 16: kratos.api.Data.Redis.write_timeout:type_name -> google.protobuf.Duration - 14, // 17: kratos.api.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration - 14, // 18: kratos.api.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration + 3, // 1: kratos.api.Bootstrap.data:type_name -> kratos.api.Data + 4, // 2: kratos.api.Bootstrap.jwt:type_name -> kratos.api.JWT + 6, // 3: kratos.api.Server.http:type_name -> kratos.api.Server.HTTP + 7, // 4: kratos.api.Server.grpc:type_name -> kratos.api.Server.GRPC + 8, // 5: kratos.api.Client.user:type_name -> kratos.api.Client.User + 9, // 6: kratos.api.Client.publish:type_name -> kratos.api.Client.Publish + 10, // 7: kratos.api.Data.mysql:type_name -> kratos.api.Data.Mysql + 11, // 8: kratos.api.Data.redis:type_name -> kratos.api.Data.Redis + 12, // 9: kratos.api.Data.kafka:type_name -> kratos.api.Data.Kafka + 13, // 10: kratos.api.JWT.http:type_name -> kratos.api.JWT.HTTP + 14, // 11: kratos.api.JWT.grpc:type_name -> kratos.api.JWT.GRPC + 15, // 12: kratos.api.Registry.consul:type_name -> kratos.api.Registry.Consul + 16, // 13: kratos.api.Server.HTTP.timeout:type_name -> google.protobuf.Duration + 16, // 14: kratos.api.Server.GRPC.timeout:type_name -> google.protobuf.Duration + 16, // 15: kratos.api.Data.Redis.read_timeout:type_name -> google.protobuf.Duration + 16, // 16: kratos.api.Data.Redis.write_timeout:type_name -> google.protobuf.Duration + 16, // 17: kratos.api.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration + 16, // 18: kratos.api.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration 19, // [19:19] is the sub-list for method output_type 19, // [19:19] is the sub-list for method input_type 19, // [19:19] is the sub-list for extension type_name @@ -1100,7 +1201,7 @@ func file_favorite_service_internal_conf_conf_proto_init() { } } file_favorite_service_internal_conf_conf_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Server_HTTP); i { + switch v := v.(*Registry); i { case 0: return &v.state case 1: @@ -1112,7 +1213,7 @@ func file_favorite_service_internal_conf_conf_proto_init() { } } file_favorite_service_internal_conf_conf_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Server_GRPC); i { + switch v := v.(*Server_HTTP); i { case 0: return &v.state case 1: @@ -1124,7 +1225,7 @@ func file_favorite_service_internal_conf_conf_proto_init() { } } file_favorite_service_internal_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client_User); i { + switch v := v.(*Server_GRPC); i { case 0: return &v.state case 1: @@ -1136,7 +1237,7 @@ func file_favorite_service_internal_conf_conf_proto_init() { } } file_favorite_service_internal_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client_Publish); i { + switch v := v.(*Client_User); i { case 0: return &v.state case 1: @@ -1148,7 +1249,7 @@ func file_favorite_service_internal_conf_conf_proto_init() { } } file_favorite_service_internal_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Mysql); i { + switch v := v.(*Client_Publish); i { case 0: return &v.state case 1: @@ -1160,7 +1261,7 @@ func file_favorite_service_internal_conf_conf_proto_init() { } } file_favorite_service_internal_conf_conf_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Redis); i { + switch v := v.(*Data_Mysql); i { case 0: return &v.state case 1: @@ -1172,7 +1273,7 @@ func file_favorite_service_internal_conf_conf_proto_init() { } } file_favorite_service_internal_conf_conf_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Kafka); i { + switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: @@ -1184,7 +1285,7 @@ func file_favorite_service_internal_conf_conf_proto_init() { } } file_favorite_service_internal_conf_conf_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT_HTTP); i { + switch v := v.(*Data_Kafka); i { case 0: return &v.state case 1: @@ -1196,6 +1297,18 @@ func file_favorite_service_internal_conf_conf_proto_init() { } } file_favorite_service_internal_conf_conf_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JWT_HTTP); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_favorite_service_internal_conf_conf_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JWT_GRPC); i { case 0: return &v.state @@ -1207,6 +1320,18 @@ func file_favorite_service_internal_conf_conf_proto_init() { return nil } } + file_favorite_service_internal_conf_conf_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Consul); 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{ @@ -1214,7 +1339,7 @@ func file_favorite_service_internal_conf_conf_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_favorite_service_internal_conf_conf_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 16, NumExtensions: 0, NumServices: 0, }, diff --git a/app/favorite/service/internal/conf/conf.proto b/app/favorite/service/internal/conf/conf.proto index 801c207..3be2094 100644 --- a/app/favorite/service/internal/conf/conf.proto +++ b/app/favorite/service/internal/conf/conf.proto @@ -1,15 +1,14 @@ syntax = "proto3"; package kratos.api; -option go_package = "github.com/toomanysource/atreus/app/favorite/service/internal/conf;conf"; - import "google/protobuf/duration.proto"; +option go_package = "github.com/toomanysource/atreus/app/favorite/service/internal/conf;conf"; + message Bootstrap { Server server = 1; - Client client = 2; - Data data = 3; - JWT jwt = 4; + Data data = 2; + JWT jwt = 3; } message Server { @@ -17,7 +16,6 @@ message Server { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; - } message GRPC { string network = 1; @@ -75,3 +73,11 @@ message JWT { HTTP http = 1; GRPC grpc = 2; } + +message Registry { + message Consul { + string address = 1; + string scheme = 2; + } + Consul consul = 1; +} diff --git a/app/favorite/service/internal/data/favorite.go b/app/favorite/service/internal/data/favorite.go index 9d43468..edea9f7 100644 --- a/app/favorite/service/internal/data/favorite.go +++ b/app/favorite/service/internal/data/favorite.go @@ -8,16 +8,17 @@ import ( "strconv" "time" + publishv1 "github.com/toomanysource/atreus/api/publish/service/v1" + "gorm.io/gorm" "github.com/toomanysource/atreus/pkg/kafkaX" "github.com/go-redis/redis/v8" - "github.com/toomanysource/atreus/app/favorite/service/internal/biz" - "github.com/toomanysource/atreus/app/favorite/service/internal/server" - "github.com/go-kratos/kratos/v2/log" + + "github.com/toomanysource/atreus/app/favorite/service/internal/biz" ) const ( @@ -43,7 +44,7 @@ type favoriteRepo struct { } func NewFavoriteRepo( - data *Data, publishConn server.PublishConn, logger log.Logger, + data *Data, publishConn publishv1.PublishServiceClient, logger log.Logger, ) biz.FavoriteRepo { return &favoriteRepo{ data: data, diff --git a/app/favorite/service/internal/data/publish.go b/app/favorite/service/internal/data/publish.go index 91e4969..5347077 100644 --- a/app/favorite/service/internal/data/publish.go +++ b/app/favorite/service/internal/data/publish.go @@ -4,10 +4,8 @@ import ( "context" "errors" - "github.com/toomanysource/atreus/app/favorite/service/internal/biz" - "github.com/toomanysource/atreus/app/favorite/service/internal/server" - pb "github.com/toomanysource/atreus/api/publish/service/v1" + "github.com/toomanysource/atreus/app/favorite/service/internal/biz" "github.com/jinzhu/copier" ) @@ -16,9 +14,9 @@ type publishRepo struct { client pb.PublishServiceClient } -func NewPublishRepo(conn server.PublishConn) biz.PublishRepo { +func NewPublishRepo(conn pb.PublishServiceClient) biz.PublishRepo { return &publishRepo{ - client: pb.NewPublishServiceClient(conn), + client: conn, } } diff --git a/app/favorite/service/internal/server/server.go b/app/favorite/service/internal/server/server.go index 0b9c98e..d23291e 100644 --- a/app/favorite/service/internal/server/server.go +++ b/app/favorite/service/internal/server/server.go @@ -5,26 +5,27 @@ import ( "github.com/toomanysource/atreus/app/favorite/service/internal/conf" + "github.com/go-kratos/kratos/contrib/registry/consul/v2" "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/logging" "github.com/go-kratos/kratos/v2/middleware/recovery" + "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/google/wire" - stdgrpc "google.golang.org/grpc" -) - -var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewPublishClient) + "github.com/hashicorp/consul/api" -type ( - PublishConn stdgrpc.ClientConnInterface + publishv1 "github.com/toomanysource/atreus/api/publish/service/v1" ) +var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewPublishClient, NewDiscovery, NewRegistrar) + // NewPublishClient 创建一个Publish服务客户端,接收Publish服务数据 -func NewPublishClient(c *conf.Client, logger log.Logger) PublishConn { +func NewPublishClient(r registry.Discovery, logger log.Logger) publishv1.PublishServiceClient { logs := log.NewHelper(log.With(logger, "module", "server/publish")) conn, err := grpc.DialInsecure( context.Background(), - grpc.WithEndpoint(c.Publish.To), + grpc.WithEndpoint("discovery:///atreus.publish.service"), + grpc.WithDiscovery(r), grpc.WithMiddleware( recovery.Recovery(), logging.Client(logger), @@ -34,5 +35,29 @@ func NewPublishClient(c *conf.Client, logger log.Logger) PublishConn { logs.Fatalf("publish service connect error, %v", err) } logs.Info("publish service connect successfully") - return conn + return publishv1.NewPublishServiceClient(conn) +} + +func NewDiscovery(conf *conf.Registry) registry.Discovery { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) + } + r := consul.New(cli, consul.WithHealthCheck(false)) + return r +} + +func NewRegistrar(conf *conf.Registry) registry.Registrar { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) + } + r := consul.New(cli, consul.WithHealthCheck(false)) + return r } diff --git a/app/message/service/cmd/main.go b/app/message/service/cmd/main.go index 3cfe725..4a3d5d4 100644 --- a/app/message/service/cmd/main.go +++ b/app/message/service/cmd/main.go @@ -12,6 +12,7 @@ import ( "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/go-kratos/kratos/v2/transport/http" @@ -28,7 +29,7 @@ func init() { flag.StringVar(&flagConf, "conf", "../configs", "config path, eg: -conf config.yaml") } -func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { +func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.Name(Name), kratos.Logger(logger), @@ -63,8 +64,12 @@ func main() { if err := c.Scan(&bc); err != nil { panic(err) } + var rc conf.Registry + if err := c.Scan(&rc); err != nil { + panic(err) + } - app, cleanup, err := wireApp(bc.Server, bc.Data, bc.Jwt, logger) + app, cleanup, err := wireApp(bc.Server, &rc, bc.Data, bc.Jwt, logger) if err != nil { panic(err) } diff --git a/app/message/service/cmd/wire.go b/app/message/service/cmd/wire.go index ca0101d..a24ffe7 100644 --- a/app/message/service/cmd/wire.go +++ b/app/message/service/cmd/wire.go @@ -18,6 +18,6 @@ import ( ) // wireApp init kratos application. -func wireApp(*conf.Server, *conf.Data, *conf.JWT, log.Logger) (*kratos.App, func(), error) { +func wireApp(*conf.Server, *conf.Registry, *conf.Data, *conf.JWT, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } diff --git a/app/message/service/cmd/wire_gen.go b/app/message/service/cmd/wire_gen.go index e3712dc..95249dd 100644 --- a/app/message/service/cmd/wire_gen.go +++ b/app/message/service/cmd/wire_gen.go @@ -22,7 +22,7 @@ import ( // Injectors from wire.go: // wireApp init kratos application. -func wireApp(confServer *conf.Server, confData *conf.Data, jwt *conf.JWT, logger log.Logger) (*kratos.App, func(), error) { +func wireApp(confServer *conf.Server, registry *conf.Registry, confData *conf.Data, jwt *conf.JWT, logger log.Logger) (*kratos.App, func(), error) { db := data.NewMysqlConn(confData, logger) kafkaConn := data.NewKafkaConn(confData, logger) client := data.NewRedisConn(confData, logger) @@ -35,7 +35,8 @@ func wireApp(confServer *conf.Server, confData *conf.Data, jwt *conf.JWT, logger messageService := service.NewMessageService(messageUseCase, logger) grpcServer := server.NewGRPCServer(confServer, messageService, logger) httpServer := server.NewHTTPServer(confServer, jwt, messageService, logger) - app := newApp(logger, grpcServer, httpServer) + registrar := server.NewRegistrar(registry) + app := newApp(logger, grpcServer, httpServer, registrar) return app, func() { cleanup() }, nil diff --git a/app/message/service/internal/conf/conf.pb.go b/app/message/service/internal/conf/conf.pb.go index f87a564..1a8ab44 100644 --- a/app/message/service/internal/conf/conf.pb.go +++ b/app/message/service/internal/conf/conf.pb.go @@ -258,6 +258,53 @@ func (x *JWT) GetGrpc() *JWT_GRPC { return nil } +type Registry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` +} + +func (x *Registry) Reset() { + *x = Registry{} + if protoimpl.UnsafeEnabled { + mi := &file_message_service_internal_conf_conf_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry) ProtoMessage() {} + +func (x *Registry) ProtoReflect() protoreflect.Message { + mi := &file_message_service_internal_conf_conf_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 Registry.ProtoReflect.Descriptor instead. +func (*Registry) Descriptor() ([]byte, []int) { + return file_message_service_internal_conf_conf_proto_rawDescGZIP(), []int{4} +} + +func (x *Registry) GetConsul() *Registry_Consul { + if x != nil { + return x.Consul + } + return nil +} + type Server_HTTP struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -271,7 +318,7 @@ type Server_HTTP struct { func (x *Server_HTTP) Reset() { *x = Server_HTTP{} if protoimpl.UnsafeEnabled { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[4] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -284,7 +331,7 @@ func (x *Server_HTTP) String() string { func (*Server_HTTP) ProtoMessage() {} func (x *Server_HTTP) ProtoReflect() protoreflect.Message { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[4] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -334,7 +381,7 @@ type Server_GRPC struct { func (x *Server_GRPC) Reset() { *x = Server_GRPC{} if protoimpl.UnsafeEnabled { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[5] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -347,7 +394,7 @@ func (x *Server_GRPC) String() string { func (*Server_GRPC) ProtoMessage() {} func (x *Server_GRPC) ProtoReflect() protoreflect.Message { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[5] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -396,7 +443,7 @@ type Data_Mysql struct { func (x *Data_Mysql) Reset() { *x = Data_Mysql{} if protoimpl.UnsafeEnabled { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[6] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -409,7 +456,7 @@ func (x *Data_Mysql) String() string { func (*Data_Mysql) ProtoMessage() {} func (x *Data_Mysql) ProtoReflect() protoreflect.Message { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[6] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -454,7 +501,7 @@ type Data_Redis struct { func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[7] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -467,7 +514,7 @@ func (x *Data_Redis) String() string { func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[7] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -533,7 +580,7 @@ type Data_Kafka struct { func (x *Data_Kafka) Reset() { *x = Data_Kafka{} if protoimpl.UnsafeEnabled { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[8] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -546,7 +593,7 @@ func (x *Data_Kafka) String() string { func (*Data_Kafka) ProtoMessage() {} func (x *Data_Kafka) ProtoReflect() protoreflect.Message { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[8] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -608,7 +655,7 @@ type JWT_HTTP struct { func (x *JWT_HTTP) Reset() { *x = JWT_HTTP{} if protoimpl.UnsafeEnabled { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[9] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -621,7 +668,7 @@ func (x *JWT_HTTP) String() string { func (*JWT_HTTP) ProtoMessage() {} func (x *JWT_HTTP) ProtoReflect() protoreflect.Message { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[9] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -655,7 +702,7 @@ type JWT_GRPC struct { func (x *JWT_GRPC) Reset() { *x = JWT_GRPC{} if protoimpl.UnsafeEnabled { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -668,7 +715,7 @@ func (x *JWT_GRPC) String() string { func (*JWT_GRPC) ProtoMessage() {} func (x *JWT_GRPC) ProtoReflect() protoreflect.Message { - mi := &file_message_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_message_service_internal_conf_conf_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -691,6 +738,61 @@ func (x *JWT_GRPC) GetTokenKey() string { return "" } +type Registry_Consul struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` +} + +func (x *Registry_Consul) Reset() { + *x = Registry_Consul{} + if protoimpl.UnsafeEnabled { + mi := &file_message_service_internal_conf_conf_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Consul) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Consul) ProtoMessage() {} + +func (x *Registry_Consul) ProtoReflect() protoreflect.Message { + mi := &file_message_service_internal_conf_conf_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 Registry_Consul.ProtoReflect.Descriptor instead. +func (*Registry_Consul) Descriptor() ([]byte, []int) { + return file_message_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *Registry_Consul) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Consul) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + var File_message_service_internal_conf_conf_proto protoreflect.FileDescriptor var file_message_service_internal_conf_conf_proto_rawDesc = []byte{ @@ -788,12 +890,21 @@ var file_message_service_internal_conf_conf_proto_rawDesc = []byte{ 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x1a, 0x23, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6f, 0x6d, 0x61, 0x6e, 0x79, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, 0x75, 0x73, 0x2f, 0x61, 0x70, 0x70, - 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, - 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x22, 0x8e, 0x01, 0x0a, 0x08, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x46, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, + 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, + 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6f, 0x6d, 0x61, 0x6e, 0x79, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, 0x75, 0x73, 0x2f, 0x61, 0x70, + 0x70, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, + 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -808,43 +919,46 @@ func file_message_service_internal_conf_conf_proto_rawDescGZIP() []byte { return file_message_service_internal_conf_conf_proto_rawDescData } -var file_message_service_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_message_service_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_message_service_internal_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: message.service.internal.conf.Bootstrap (*Server)(nil), // 1: message.service.internal.conf.Server (*Data)(nil), // 2: message.service.internal.conf.Data (*JWT)(nil), // 3: message.service.internal.conf.JWT - (*Server_HTTP)(nil), // 4: message.service.internal.conf.Server.HTTP - (*Server_GRPC)(nil), // 5: message.service.internal.conf.Server.GRPC - (*Data_Mysql)(nil), // 6: message.service.internal.conf.Data.Mysql - (*Data_Redis)(nil), // 7: message.service.internal.conf.Data.Redis - (*Data_Kafka)(nil), // 8: message.service.internal.conf.Data.Kafka - (*JWT_HTTP)(nil), // 9: message.service.internal.conf.JWT.HTTP - (*JWT_GRPC)(nil), // 10: message.service.internal.conf.JWT.GRPC - (*durationpb.Duration)(nil), // 11: google.protobuf.Duration + (*Registry)(nil), // 4: message.service.internal.conf.Registry + (*Server_HTTP)(nil), // 5: message.service.internal.conf.Server.HTTP + (*Server_GRPC)(nil), // 6: message.service.internal.conf.Server.GRPC + (*Data_Mysql)(nil), // 7: message.service.internal.conf.Data.Mysql + (*Data_Redis)(nil), // 8: message.service.internal.conf.Data.Redis + (*Data_Kafka)(nil), // 9: message.service.internal.conf.Data.Kafka + (*JWT_HTTP)(nil), // 10: message.service.internal.conf.JWT.HTTP + (*JWT_GRPC)(nil), // 11: message.service.internal.conf.JWT.GRPC + (*Registry_Consul)(nil), // 12: message.service.internal.conf.Registry.Consul + (*durationpb.Duration)(nil), // 13: google.protobuf.Duration } var file_message_service_internal_conf_conf_proto_depIdxs = []int32{ 1, // 0: message.service.internal.conf.Bootstrap.server:type_name -> message.service.internal.conf.Server 2, // 1: message.service.internal.conf.Bootstrap.data:type_name -> message.service.internal.conf.Data 3, // 2: message.service.internal.conf.Bootstrap.jwt:type_name -> message.service.internal.conf.JWT - 4, // 3: message.service.internal.conf.Server.http:type_name -> message.service.internal.conf.Server.HTTP - 5, // 4: message.service.internal.conf.Server.grpc:type_name -> message.service.internal.conf.Server.GRPC - 6, // 5: message.service.internal.conf.Data.mysql:type_name -> message.service.internal.conf.Data.Mysql - 7, // 6: message.service.internal.conf.Data.redis:type_name -> message.service.internal.conf.Data.Redis - 8, // 7: message.service.internal.conf.Data.kafka:type_name -> message.service.internal.conf.Data.Kafka - 9, // 8: message.service.internal.conf.JWT.http:type_name -> message.service.internal.conf.JWT.HTTP - 10, // 9: message.service.internal.conf.JWT.grpc:type_name -> message.service.internal.conf.JWT.GRPC - 11, // 10: message.service.internal.conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration - 11, // 11: message.service.internal.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration - 11, // 12: message.service.internal.conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration - 11, // 13: message.service.internal.conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration - 11, // 14: message.service.internal.conf.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration - 11, // 15: message.service.internal.conf.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration - 16, // [16:16] is the sub-list for method output_type - 16, // [16:16] is the sub-list for method input_type - 16, // [16:16] is the sub-list for extension type_name - 16, // [16:16] is the sub-list for extension extendee - 0, // [0:16] is the sub-list for field type_name + 5, // 3: message.service.internal.conf.Server.http:type_name -> message.service.internal.conf.Server.HTTP + 6, // 4: message.service.internal.conf.Server.grpc:type_name -> message.service.internal.conf.Server.GRPC + 7, // 5: message.service.internal.conf.Data.mysql:type_name -> message.service.internal.conf.Data.Mysql + 8, // 6: message.service.internal.conf.Data.redis:type_name -> message.service.internal.conf.Data.Redis + 9, // 7: message.service.internal.conf.Data.kafka:type_name -> message.service.internal.conf.Data.Kafka + 10, // 8: message.service.internal.conf.JWT.http:type_name -> message.service.internal.conf.JWT.HTTP + 11, // 9: message.service.internal.conf.JWT.grpc:type_name -> message.service.internal.conf.JWT.GRPC + 12, // 10: message.service.internal.conf.Registry.consul:type_name -> message.service.internal.conf.Registry.Consul + 13, // 11: message.service.internal.conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration + 13, // 12: message.service.internal.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration + 13, // 13: message.service.internal.conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration + 13, // 14: message.service.internal.conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration + 13, // 15: message.service.internal.conf.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration + 13, // 16: message.service.internal.conf.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_message_service_internal_conf_conf_proto_init() } @@ -902,7 +1016,7 @@ func file_message_service_internal_conf_conf_proto_init() { } } file_message_service_internal_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Server_HTTP); i { + switch v := v.(*Registry); i { case 0: return &v.state case 1: @@ -914,7 +1028,7 @@ func file_message_service_internal_conf_conf_proto_init() { } } file_message_service_internal_conf_conf_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Server_GRPC); i { + switch v := v.(*Server_HTTP); i { case 0: return &v.state case 1: @@ -926,7 +1040,7 @@ func file_message_service_internal_conf_conf_proto_init() { } } file_message_service_internal_conf_conf_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Mysql); i { + switch v := v.(*Server_GRPC); i { case 0: return &v.state case 1: @@ -938,7 +1052,7 @@ func file_message_service_internal_conf_conf_proto_init() { } } file_message_service_internal_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Redis); i { + switch v := v.(*Data_Mysql); i { case 0: return &v.state case 1: @@ -950,7 +1064,7 @@ func file_message_service_internal_conf_conf_proto_init() { } } file_message_service_internal_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Kafka); i { + switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: @@ -962,7 +1076,7 @@ func file_message_service_internal_conf_conf_proto_init() { } } file_message_service_internal_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT_HTTP); i { + switch v := v.(*Data_Kafka); i { case 0: return &v.state case 1: @@ -974,6 +1088,18 @@ func file_message_service_internal_conf_conf_proto_init() { } } file_message_service_internal_conf_conf_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*JWT_HTTP); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_message_service_internal_conf_conf_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*JWT_GRPC); i { case 0: return &v.state @@ -985,6 +1111,18 @@ func file_message_service_internal_conf_conf_proto_init() { return nil } } + file_message_service_internal_conf_conf_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Registry_Consul); 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{ @@ -992,7 +1130,7 @@ func file_message_service_internal_conf_conf_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_message_service_internal_conf_conf_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/app/message/service/internal/conf/conf.proto b/app/message/service/internal/conf/conf.proto index 950550c..3ed5957 100644 --- a/app/message/service/internal/conf/conf.proto +++ b/app/message/service/internal/conf/conf.proto @@ -16,7 +16,6 @@ message Server { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; - } message GRPC { string network = 1; @@ -61,3 +60,11 @@ message JWT { HTTP http = 1; GRPC grpc = 2; } + +message Registry { + message Consul { + string address = 1; + string scheme = 2; + } + Consul consul = 1; +} diff --git a/app/message/service/internal/server/server.go b/app/message/service/internal/server/server.go index f389425..1a9aac2 100644 --- a/app/message/service/internal/server/server.go +++ b/app/message/service/internal/server/server.go @@ -2,7 +2,25 @@ package server import ( "github.com/google/wire" + + "github.com/toomanysource/atreus/app/message/service/internal/conf" + + "github.com/go-kratos/kratos/contrib/registry/consul/v2" + "github.com/go-kratos/kratos/v2/registry" + "github.com/hashicorp/consul/api" ) // ProviderSet is server providers. -var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer) +var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewRegistrar) + +func NewRegistrar(conf *conf.Registry) registry.Registrar { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) + } + r := consul.New(cli, consul.WithHealthCheck(false)) + return r +} diff --git a/app/publish/service/cmd/main.go b/app/publish/service/cmd/main.go index 6363ec3..6c90224 100644 --- a/app/publish/service/cmd/main.go +++ b/app/publish/service/cmd/main.go @@ -12,6 +12,7 @@ import ( "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/go-kratos/kratos/v2/transport/http" @@ -28,7 +29,7 @@ func init() { flag.StringVar(&flagConf, "conf", "../configs", "config path, eg: -conf config.yaml") } -func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { +func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.Name(Name), kratos.Logger(logger), @@ -36,6 +37,7 @@ func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { gs, hs, ), + kratos.Registrar(rr), ) } @@ -63,8 +65,12 @@ func main() { if err := c.Scan(&bc); err != nil { panic(err) } + var rc conf.Registry + if err := c.Scan(&rc); err != nil { + panic(err) + } - app, cleanup, err := wireApp(bc.Server, bc.Client, bc.Minio, bc.Jwt, bc.Data, logger) + app, cleanup, err := wireApp(bc.Server, &rc, bc.Minio, bc.Jwt, bc.Data, logger) if err != nil { panic(err) } diff --git a/app/publish/service/cmd/wire.go b/app/publish/service/cmd/wire.go index 2b4a038..71e0395 100644 --- a/app/publish/service/cmd/wire.go +++ b/app/publish/service/cmd/wire.go @@ -18,6 +18,6 @@ import ( ) // wireApp init kratos application. -func wireApp(*conf.Server, *conf.Client, *conf.Minio, *conf.JWT, *conf.Data, log.Logger) (*kratos.App, func(), error) { +func wireApp(*conf.Server, *conf.Registry, *conf.Minio, *conf.JWT, *conf.Data, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } diff --git a/app/publish/service/cmd/wire_gen.go b/app/publish/service/cmd/wire_gen.go index de643bd..bcd19ff 100644 --- a/app/publish/service/cmd/wire_gen.go +++ b/app/publish/service/cmd/wire_gen.go @@ -22,25 +22,27 @@ import ( // Injectors from wire.go: // wireApp init kratos application. -func wireApp(confServer *conf.Server, client *conf.Client, minio *conf.Minio, jwt *conf.JWT, confData *conf.Data, logger log.Logger) (*kratos.App, func(), error) { +func wireApp(confServer *conf.Server, registry *conf.Registry, minio *conf.Minio, jwt *conf.JWT, confData *conf.Data, logger log.Logger) (*kratos.App, func(), error) { db := data.NewMysqlConn(confData, logger) extraConn := data.NewMinioExtraConn(minio, logger) intraConn := data.NewMinioIntraConn(minio, logger) - minioXClient := data.NewMinioConn(minio, extraConn, intraConn, logger) + client := data.NewMinioConn(minio, extraConn, intraConn, logger) writer := data.NewKafkaWriter(confData, logger) kfkReader := data.NewKafkaReader(confData, logger) - dataData, cleanup, err := data.NewData(db, minioXClient, writer, kfkReader, logger) + dataData, cleanup, err := data.NewData(db, client, writer, kfkReader, logger) if err != nil { return nil, nil, err } - userConn := server.NewUserClient(client, logger) - favoriteConn := server.NewFavoriteClient(client, logger) - publishRepo := data.NewPublishRepo(dataData, userConn, favoriteConn, logger) + discovery := server.NewDiscovery(registry) + userServiceClient := server.NewUserClient(discovery, logger) + favoriteServiceClient := server.NewFavoriteClient(discovery, logger) + publishRepo := data.NewPublishRepo(dataData, userServiceClient, favoriteServiceClient, logger) publishUseCase := biz.NewPublishUseCase(publishRepo, logger) publishService := service.NewPublishService(publishUseCase, logger) grpcServer := server.NewGRPCServer(confServer, publishService, logger) httpServer := server.NewHTTPServer(confServer, jwt, publishService, logger) - app := newApp(logger, grpcServer, httpServer) + registrar := server.NewRegistrar(registry) + app := newApp(logger, grpcServer, httpServer, registrar) return app, func() { cleanup() }, nil diff --git a/app/publish/service/internal/conf/conf.pb.go b/app/publish/service/internal/conf/conf.pb.go index 31419a6..341e7a1 100644 --- a/app/publish/service/internal/conf/conf.pb.go +++ b/app/publish/service/internal/conf/conf.pb.go @@ -28,10 +28,9 @@ type Bootstrap struct { unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` - Client *Client `protobuf:"bytes,2,opt,name=client,proto3" json:"client,omitempty"` - Data *Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - Jwt *JWT `protobuf:"bytes,4,opt,name=jwt,proto3" json:"jwt,omitempty"` - Minio *Minio `protobuf:"bytes,5,opt,name=minio,proto3" json:"minio,omitempty"` + Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Jwt *JWT `protobuf:"bytes,3,opt,name=jwt,proto3" json:"jwt,omitempty"` + Minio *Minio `protobuf:"bytes,4,opt,name=minio,proto3" json:"minio,omitempty"` } func (x *Bootstrap) Reset() { @@ -73,13 +72,6 @@ func (x *Bootstrap) GetServer() *Server { return nil } -func (x *Bootstrap) GetClient() *Client { - if x != nil { - return x.Client - } - return nil -} - func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data @@ -156,61 +148,6 @@ func (x *Server) GetGrpc() *Server_GRPC { return nil } -type Client struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *Client_User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` - Favorite *Client_Favorite `protobuf:"bytes,2,opt,name=favorite,proto3" json:"favorite,omitempty"` -} - -func (x *Client) Reset() { - *x = Client{} - if protoimpl.UnsafeEnabled { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Client) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Client) ProtoMessage() {} - -func (x *Client) ProtoReflect() protoreflect.Message { - mi := &file_publish_service_internal_conf_conf_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 Client.ProtoReflect.Descriptor instead. -func (*Client) Descriptor() ([]byte, []int) { - return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{2} -} - -func (x *Client) GetUser() *Client_User { - if x != nil { - return x.User - } - return nil -} - -func (x *Client) GetFavorite() *Client_Favorite { - if x != nil { - return x.Favorite - } - return nil -} - // Data type Data struct { state protoimpl.MessageState @@ -224,7 +161,7 @@ type Data struct { func (x *Data) Reset() { *x = Data{} if protoimpl.UnsafeEnabled { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[3] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -237,7 +174,7 @@ func (x *Data) String() string { func (*Data) ProtoMessage() {} func (x *Data) ProtoReflect() protoreflect.Message { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[3] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -250,7 +187,7 @@ func (x *Data) ProtoReflect() protoreflect.Message { // Deprecated: Use Data.ProtoReflect.Descriptor instead. func (*Data) Descriptor() ([]byte, []int) { - return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{3} + return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{2} } func (x *Data) GetMysql() *Data_Mysql { @@ -279,7 +216,7 @@ type JWT struct { func (x *JWT) Reset() { *x = JWT{} if protoimpl.UnsafeEnabled { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[4] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -292,7 +229,7 @@ func (x *JWT) String() string { func (*JWT) ProtoMessage() {} func (x *JWT) ProtoReflect() protoreflect.Message { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[4] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -305,7 +242,7 @@ func (x *JWT) ProtoReflect() protoreflect.Message { // Deprecated: Use JWT.ProtoReflect.Descriptor instead. func (*JWT) Descriptor() ([]byte, []int) { - return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{4} + return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{3} } func (x *JWT) GetHttp() *JWT_HTTP { @@ -338,7 +275,7 @@ type Minio struct { func (x *Minio) Reset() { *x = Minio{} if protoimpl.UnsafeEnabled { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[5] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -351,7 +288,7 @@ func (x *Minio) String() string { func (*Minio) ProtoMessage() {} func (x *Minio) ProtoReflect() protoreflect.Message { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[5] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -364,7 +301,7 @@ func (x *Minio) ProtoReflect() protoreflect.Message { // Deprecated: Use Minio.ProtoReflect.Descriptor instead. func (*Minio) Descriptor() ([]byte, []int) { - return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{5} + return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{4} } func (x *Minio) GetEndpointExtra() string { @@ -409,6 +346,53 @@ func (x *Minio) GetBucketName() string { return "" } +type Registry struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` +} + +func (x *Registry) Reset() { + *x = Registry{} + if protoimpl.UnsafeEnabled { + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry) ProtoMessage() {} + +func (x *Registry) ProtoReflect() protoreflect.Message { + mi := &file_publish_service_internal_conf_conf_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 Registry.ProtoReflect.Descriptor instead. +func (*Registry) Descriptor() ([]byte, []int) { + return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{5} +} + +func (x *Registry) GetConsul() *Registry_Consul { + if x != nil { + return x.Consul + } + return nil +} + type Server_HTTP struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -535,100 +519,6 @@ func (x *Server_GRPC) GetTimeout() *durationpb.Duration { return nil } -type Client_User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *Client_User) Reset() { - *x = Client_User{} - if protoimpl.UnsafeEnabled { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Client_User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Client_User) ProtoMessage() {} - -func (x *Client_User) ProtoReflect() protoreflect.Message { - mi := &file_publish_service_internal_conf_conf_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 Client_User.ProtoReflect.Descriptor instead. -func (*Client_User) Descriptor() ([]byte, []int) { - return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *Client_User) GetTo() string { - if x != nil { - return x.To - } - return "" -} - -type Client_Favorite struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *Client_Favorite) Reset() { - *x = Client_Favorite{} - if protoimpl.UnsafeEnabled { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Client_Favorite) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Client_Favorite) ProtoMessage() {} - -func (x *Client_Favorite) ProtoReflect() protoreflect.Message { - mi := &file_publish_service_internal_conf_conf_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 Client_Favorite.ProtoReflect.Descriptor instead. -func (*Client_Favorite) Descriptor() ([]byte, []int) { - return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *Client_Favorite) GetTo() string { - if x != nil { - return x.To - } - return "" -} - type Data_Mysql struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -641,7 +531,7 @@ type Data_Mysql struct { func (x *Data_Mysql) Reset() { *x = Data_Mysql{} if protoimpl.UnsafeEnabled { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -654,7 +544,7 @@ func (x *Data_Mysql) String() string { func (*Data_Mysql) ProtoMessage() {} func (x *Data_Mysql) ProtoReflect() protoreflect.Message { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -667,7 +557,7 @@ func (x *Data_Mysql) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Mysql.ProtoReflect.Descriptor instead. func (*Data_Mysql) Descriptor() ([]byte, []int) { - return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} + return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} } func (x *Data_Mysql) GetDriver() string { @@ -701,7 +591,7 @@ type Data_Kafka struct { func (x *Data_Kafka) Reset() { *x = Data_Kafka{} if protoimpl.UnsafeEnabled { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[11] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -714,7 +604,7 @@ func (x *Data_Kafka) String() string { func (*Data_Kafka) ProtoMessage() {} func (x *Data_Kafka) ProtoReflect() protoreflect.Message { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[11] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -727,7 +617,7 @@ func (x *Data_Kafka) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Kafka.ProtoReflect.Descriptor instead. func (*Data_Kafka) Descriptor() ([]byte, []int) { - return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 1} + return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 1} } func (x *Data_Kafka) GetAddr() string { @@ -790,7 +680,7 @@ type JWT_HTTP struct { func (x *JWT_HTTP) Reset() { *x = JWT_HTTP{} if protoimpl.UnsafeEnabled { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[12] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -803,7 +693,7 @@ func (x *JWT_HTTP) String() string { func (*JWT_HTTP) ProtoMessage() {} func (x *JWT_HTTP) ProtoReflect() protoreflect.Message { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[12] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -816,7 +706,7 @@ func (x *JWT_HTTP) ProtoReflect() protoreflect.Message { // Deprecated: Use JWT_HTTP.ProtoReflect.Descriptor instead. func (*JWT_HTTP) Descriptor() ([]byte, []int) { - return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 0} + return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} } func (x *JWT_HTTP) GetTokenKey() string { @@ -837,7 +727,7 @@ type JWT_GRPC struct { func (x *JWT_GRPC) Reset() { *x = JWT_GRPC{} if protoimpl.UnsafeEnabled { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[13] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -850,7 +740,7 @@ func (x *JWT_GRPC) String() string { func (*JWT_GRPC) ProtoMessage() {} func (x *JWT_GRPC) ProtoReflect() protoreflect.Message { - mi := &file_publish_service_internal_conf_conf_proto_msgTypes[13] + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -863,7 +753,7 @@ func (x *JWT_GRPC) ProtoReflect() protoreflect.Message { // Deprecated: Use JWT_GRPC.ProtoReflect.Descriptor instead. func (*JWT_GRPC) Descriptor() ([]byte, []int) { - return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 1} + return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 1} } func (x *JWT_GRPC) GetTokenKey() string { @@ -873,6 +763,61 @@ func (x *JWT_GRPC) GetTokenKey() string { return "" } +type Registry_Consul struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` +} + +func (x *Registry_Consul) Reset() { + *x = Registry_Consul{} + if protoimpl.UnsafeEnabled { + mi := &file_publish_service_internal_conf_conf_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Consul) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Consul) ProtoMessage() {} + +func (x *Registry_Consul) ProtoReflect() protoreflect.Message { + mi := &file_publish_service_internal_conf_conf_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 Registry_Consul.ProtoReflect.Descriptor instead. +func (*Registry_Consul) Descriptor() ([]byte, []int) { + return file_publish_service_internal_conf_conf_proto_rawDescGZIP(), []int{5, 0} +} + +func (x *Registry_Consul) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Consul) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + var File_publish_service_internal_conf_conf_proto protoreflect.FileDescriptor var file_publish_service_internal_conf_conf_proto_rawDesc = []byte{ @@ -882,123 +827,116 @@ var file_publish_service_internal_conf_conf_proto_rawDesc = []byte{ 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb4, 0x02, 0x0a, 0x09, 0x42, 0x6f, + 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf5, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x3d, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x37, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x34, - 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, 0x75, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x34, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, + 0x52, 0x03, 0x6a, 0x77, 0x74, 0x12, 0x3a, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x6e, 0x69, 0x6f, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x69, + 0x6f, 0x22, 0xde, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x04, + 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x3e, 0x0a, 0x04, + 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x69, 0x0a, 0x04, + 0x48, 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, + 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, + 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, + 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, + 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, + 0x75, 0x74, 0x22, 0xe6, 0x03, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x6d, + 0x79, 0x73, 0x71, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x75, 0x62, + 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, + 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x3f, 0x0a, 0x05, + 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x52, - 0x03, 0x6a, 0x77, 0x74, 0x12, 0x3a, 0x0a, 0x05, 0x6d, 0x69, 0x6e, 0x69, 0x6f, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x2e, 0x4d, 0x69, 0x6e, 0x69, 0x6f, 0x52, 0x05, 0x6d, 0x69, 0x6e, 0x69, 0x6f, - 0x22, 0xde, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x04, 0x68, - 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x3e, 0x0a, 0x04, 0x67, - 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, - 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x69, 0x0a, 0x04, 0x48, - 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, - 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, - 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x2e, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x1a, 0x31, 0x0a, + 0x05, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x10, + 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, + 0x1a, 0xa8, 0x02, 0x0a, 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, + 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x23, + 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x6f, + 0x70, 0x69, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x5f, + 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x61, 0x76, + 0x6f, 0x72, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, + 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, + 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, + 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, - 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x22, 0xc8, 0x01, 0x0a, 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x4a, 0x0a, 0x08, - 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2e, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x03, + 0x4a, 0x57, 0x54, 0x12, 0x3b, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, + 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, + 0x12, 0x3b, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x52, 0x08, - 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x1a, 0x16, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, - 0x1a, 0x1a, 0x0a, 0x08, 0x46, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x12, 0x0e, 0x0a, 0x02, - 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x22, 0xe6, 0x03, 0x0a, - 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3f, 0x0a, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, - 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x52, - 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x3f, 0x0a, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x61, 0x66, 0x6b, 0x61, - 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x1a, 0x31, 0x0a, 0x05, 0x4d, 0x79, 0x73, 0x71, 0x6c, - 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x1a, 0xa8, 0x02, 0x0a, 0x05, 0x4b, - 0x61, 0x66, 0x6b, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x25, 0x0a, - 0x0e, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x54, - 0x6f, 0x70, 0x69, 0x63, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, - 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x73, 0x68, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, - 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, - 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, - 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x03, 0x4a, 0x57, 0x54, 0x12, 0x3b, 0x0a, - 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, - 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x3b, 0x0a, 0x04, 0x67, 0x72, - 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x47, 0x52, 0x50, - 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x23, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, - 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x1a, 0x23, 0x0a, 0x04, - 0x47, 0x52, 0x50, 0x43, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, - 0x79, 0x22, 0xd8, 0x01, 0x0a, 0x05, 0x4d, 0x69, 0x6e, 0x69, 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x65, - 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x45, 0x78, 0x74, - 0x72, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x69, - 0x6e, 0x74, 0x72, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x64, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x72, 0x61, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x49, 0x64, 0x12, 0x23, 0x0a, - 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, 0x73, 0x73, 0x6c, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x65, 0x53, 0x73, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x62, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x42, 0x48, 0x5a, 0x46, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6f, 0x6d, 0x61, - 0x6e, 0x79, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, 0x75, 0x73, 0x2f, - 0x61, 0x70, 0x70, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2f, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, - 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, + 0x57, 0x54, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x23, 0x0a, + 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, + 0x65, 0x79, 0x1a, 0x23, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x22, 0xd8, 0x01, 0x0a, 0x05, 0x4d, 0x69, 0x6e, 0x69, + 0x6f, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x65, 0x78, + 0x74, 0x72, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x65, 0x6e, 0x64, 0x70, 0x6f, + 0x69, 0x6e, 0x74, 0x45, 0x78, 0x74, 0x72, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x65, 0x6e, 0x64, 0x70, + 0x6f, 0x69, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x74, 0x72, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x72, 0x61, 0x12, + 0x22, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x69, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, + 0x79, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x73, 0x65, + 0x63, 0x72, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x5f, + 0x73, 0x73, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x75, 0x73, 0x65, 0x53, 0x73, + 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x22, 0x8e, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, + 0x46, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x2e, 0x2e, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, + 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, + 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, + 0x65, 0x6d, 0x65, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x74, 0x6f, 0x6f, 0x6d, 0x61, 0x6e, 0x79, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, + 0x61, 0x74, 0x72, 0x65, 0x75, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x70, 0x75, 0x62, 0x6c, 0x69, + 0x73, 0x68, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1013,47 +951,44 @@ func file_publish_service_internal_conf_conf_proto_rawDescGZIP() []byte { return file_publish_service_internal_conf_conf_proto_rawDescData } -var file_publish_service_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_publish_service_internal_conf_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_publish_service_internal_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: publish.service.internal.conf.Bootstrap (*Server)(nil), // 1: publish.service.internal.conf.Server - (*Client)(nil), // 2: publish.service.internal.conf.Client - (*Data)(nil), // 3: publish.service.internal.conf.Data - (*JWT)(nil), // 4: publish.service.internal.conf.JWT - (*Minio)(nil), // 5: publish.service.internal.conf.Minio + (*Data)(nil), // 2: publish.service.internal.conf.Data + (*JWT)(nil), // 3: publish.service.internal.conf.JWT + (*Minio)(nil), // 4: publish.service.internal.conf.Minio + (*Registry)(nil), // 5: publish.service.internal.conf.Registry (*Server_HTTP)(nil), // 6: publish.service.internal.conf.Server.HTTP (*Server_GRPC)(nil), // 7: publish.service.internal.conf.Server.GRPC - (*Client_User)(nil), // 8: publish.service.internal.conf.Client.User - (*Client_Favorite)(nil), // 9: publish.service.internal.conf.Client.Favorite - (*Data_Mysql)(nil), // 10: publish.service.internal.conf.Data.Mysql - (*Data_Kafka)(nil), // 11: publish.service.internal.conf.Data.Kafka - (*JWT_HTTP)(nil), // 12: publish.service.internal.conf.JWT.HTTP - (*JWT_GRPC)(nil), // 13: publish.service.internal.conf.JWT.GRPC - (*durationpb.Duration)(nil), // 14: google.protobuf.Duration + (*Data_Mysql)(nil), // 8: publish.service.internal.conf.Data.Mysql + (*Data_Kafka)(nil), // 9: publish.service.internal.conf.Data.Kafka + (*JWT_HTTP)(nil), // 10: publish.service.internal.conf.JWT.HTTP + (*JWT_GRPC)(nil), // 11: publish.service.internal.conf.JWT.GRPC + (*Registry_Consul)(nil), // 12: publish.service.internal.conf.Registry.Consul + (*durationpb.Duration)(nil), // 13: google.protobuf.Duration } var file_publish_service_internal_conf_conf_proto_depIdxs = []int32{ 1, // 0: publish.service.internal.conf.Bootstrap.server:type_name -> publish.service.internal.conf.Server - 2, // 1: publish.service.internal.conf.Bootstrap.client:type_name -> publish.service.internal.conf.Client - 3, // 2: publish.service.internal.conf.Bootstrap.data:type_name -> publish.service.internal.conf.Data - 4, // 3: publish.service.internal.conf.Bootstrap.jwt:type_name -> publish.service.internal.conf.JWT - 5, // 4: publish.service.internal.conf.Bootstrap.minio:type_name -> publish.service.internal.conf.Minio - 6, // 5: publish.service.internal.conf.Server.http:type_name -> publish.service.internal.conf.Server.HTTP - 7, // 6: publish.service.internal.conf.Server.grpc:type_name -> publish.service.internal.conf.Server.GRPC - 8, // 7: publish.service.internal.conf.Client.user:type_name -> publish.service.internal.conf.Client.User - 9, // 8: publish.service.internal.conf.Client.favorite:type_name -> publish.service.internal.conf.Client.Favorite - 10, // 9: publish.service.internal.conf.Data.mysql:type_name -> publish.service.internal.conf.Data.Mysql - 11, // 10: publish.service.internal.conf.Data.kafka:type_name -> publish.service.internal.conf.Data.Kafka - 12, // 11: publish.service.internal.conf.JWT.http:type_name -> publish.service.internal.conf.JWT.HTTP - 13, // 12: publish.service.internal.conf.JWT.grpc:type_name -> publish.service.internal.conf.JWT.GRPC - 14, // 13: publish.service.internal.conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration - 14, // 14: publish.service.internal.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration - 14, // 15: publish.service.internal.conf.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration - 14, // 16: publish.service.internal.conf.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration - 17, // [17:17] is the sub-list for method output_type - 17, // [17:17] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 2, // 1: publish.service.internal.conf.Bootstrap.data:type_name -> publish.service.internal.conf.Data + 3, // 2: publish.service.internal.conf.Bootstrap.jwt:type_name -> publish.service.internal.conf.JWT + 4, // 3: publish.service.internal.conf.Bootstrap.minio:type_name -> publish.service.internal.conf.Minio + 6, // 4: publish.service.internal.conf.Server.http:type_name -> publish.service.internal.conf.Server.HTTP + 7, // 5: publish.service.internal.conf.Server.grpc:type_name -> publish.service.internal.conf.Server.GRPC + 8, // 6: publish.service.internal.conf.Data.mysql:type_name -> publish.service.internal.conf.Data.Mysql + 9, // 7: publish.service.internal.conf.Data.kafka:type_name -> publish.service.internal.conf.Data.Kafka + 10, // 8: publish.service.internal.conf.JWT.http:type_name -> publish.service.internal.conf.JWT.HTTP + 11, // 9: publish.service.internal.conf.JWT.grpc:type_name -> publish.service.internal.conf.JWT.GRPC + 12, // 10: publish.service.internal.conf.Registry.consul:type_name -> publish.service.internal.conf.Registry.Consul + 13, // 11: publish.service.internal.conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration + 13, // 12: publish.service.internal.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration + 13, // 13: publish.service.internal.conf.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration + 13, // 14: publish.service.internal.conf.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration + 15, // [15:15] is the sub-list for method output_type + 15, // [15:15] 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_publish_service_internal_conf_conf_proto_init() } @@ -1087,7 +1022,7 @@ func file_publish_service_internal_conf_conf_proto_init() { } } file_publish_service_internal_conf_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client); i { + switch v := v.(*Data); i { case 0: return &v.state case 1: @@ -1099,7 +1034,7 @@ func file_publish_service_internal_conf_conf_proto_init() { } } file_publish_service_internal_conf_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data); i { + switch v := v.(*JWT); i { case 0: return &v.state case 1: @@ -1111,7 +1046,7 @@ func file_publish_service_internal_conf_conf_proto_init() { } } file_publish_service_internal_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT); i { + switch v := v.(*Minio); i { case 0: return &v.state case 1: @@ -1123,7 +1058,7 @@ func file_publish_service_internal_conf_conf_proto_init() { } } file_publish_service_internal_conf_conf_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Minio); i { + switch v := v.(*Registry); i { case 0: return &v.state case 1: @@ -1159,7 +1094,7 @@ func file_publish_service_internal_conf_conf_proto_init() { } } file_publish_service_internal_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client_User); i { + switch v := v.(*Data_Mysql); i { case 0: return &v.state case 1: @@ -1171,7 +1106,7 @@ func file_publish_service_internal_conf_conf_proto_init() { } } file_publish_service_internal_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client_Favorite); i { + switch v := v.(*Data_Kafka); i { case 0: return &v.state case 1: @@ -1183,7 +1118,7 @@ func file_publish_service_internal_conf_conf_proto_init() { } } file_publish_service_internal_conf_conf_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Mysql); i { + switch v := v.(*JWT_HTTP); i { case 0: return &v.state case 1: @@ -1195,7 +1130,7 @@ func file_publish_service_internal_conf_conf_proto_init() { } } file_publish_service_internal_conf_conf_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Kafka); i { + switch v := v.(*JWT_GRPC); i { case 0: return &v.state case 1: @@ -1207,19 +1142,7 @@ func file_publish_service_internal_conf_conf_proto_init() { } } file_publish_service_internal_conf_conf_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT_HTTP); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_publish_service_internal_conf_conf_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT_GRPC); i { + switch v := v.(*Registry_Consul); i { case 0: return &v.state case 1: @@ -1237,7 +1160,7 @@ func file_publish_service_internal_conf_conf_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_publish_service_internal_conf_conf_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 13, NumExtensions: 0, NumServices: 0, }, diff --git a/app/publish/service/internal/conf/conf.proto b/app/publish/service/internal/conf/conf.proto index 3f6b07b..9814e63 100755 --- a/app/publish/service/internal/conf/conf.proto +++ b/app/publish/service/internal/conf/conf.proto @@ -8,10 +8,9 @@ option go_package = "github.com/toomanysource/atreus/app/publish/service/interna message Bootstrap { Server server = 1; - Client client = 2; - Data data = 3; - JWT jwt = 4; - Minio minio = 5; + Data data = 2; + JWT jwt = 3; + Minio minio = 4; } message Server { @@ -28,16 +27,6 @@ message Server { HTTP http = 1; GRPC grpc = 2; } -message Client { - message User { - string to = 1; - } - message Favorite { - string to = 1; - } - User user = 1; - Favorite favorite = 2; -} // Data message Data { @@ -77,3 +66,11 @@ message Minio { bool use_ssl = 5; string bucket_name = 6; } + +message Registry { + message Consul { + string address = 1; + string scheme = 2; + } + Consul consul = 1; +} diff --git a/app/publish/service/internal/data/favorite.go b/app/publish/service/internal/data/favorite.go index d635471..7abf8ae 100644 --- a/app/publish/service/internal/data/favorite.go +++ b/app/publish/service/internal/data/favorite.go @@ -5,16 +5,15 @@ import ( "errors" pb "github.com/toomanysource/atreus/api/favorite/service/v1" - "github.com/toomanysource/atreus/app/publish/service/internal/server" ) type favoriteRepo struct { client pb.FavoriteServiceClient } -func NewFavoriteRepo(conn server.FavoriteConn) FavoriteRepo { +func NewFavoriteRepo(conn pb.FavoriteServiceClient) FavoriteRepo { return &favoriteRepo{ - client: pb.NewFavoriteServiceClient(conn), + client: conn, } } diff --git a/app/publish/service/internal/data/publish.go b/app/publish/service/internal/data/publish.go index a8cb3b9..7fbe589 100755 --- a/app/publish/service/internal/data/publish.go +++ b/app/publish/service/internal/data/publish.go @@ -12,6 +12,9 @@ import ( "sync" "time" + favoritev1 "github.com/toomanysource/atreus/api/favorite/service/v1" + userv1 "github.com/toomanysource/atreus/api/user/service/v1" + "github.com/toomanysource/atreus/middleware" "github.com/segmentio/kafka-go" @@ -19,7 +22,6 @@ import ( "github.com/toomanysource/atreus/pkg/kafkaX" "github.com/toomanysource/atreus/app/publish/service/internal/biz" - "github.com/toomanysource/atreus/app/publish/service/internal/server" "github.com/toomanysource/atreus/pkg/ffmpegX" "github.com/go-kratos/kratos/v2/log" @@ -61,7 +63,7 @@ type publishRepo struct { } func NewPublishRepo( - data *Data, userConn server.UserConn, favoriteConn server.FavoriteConn, logger log.Logger, + data *Data, userConn userv1.UserServiceClient, favoriteConn favoritev1.FavoriteServiceClient, logger log.Logger, ) biz.PublishRepo { return &publishRepo{ data: data, diff --git a/app/publish/service/internal/data/user.go b/app/publish/service/internal/data/user.go index 285a454..ef83255 100644 --- a/app/publish/service/internal/data/user.go +++ b/app/publish/service/internal/data/user.go @@ -8,16 +8,15 @@ import ( pb "github.com/toomanysource/atreus/api/user/service/v1" "github.com/toomanysource/atreus/app/publish/service/internal/biz" - "github.com/toomanysource/atreus/app/publish/service/internal/server" ) type userRepo struct { client pb.UserServiceClient } -func NewUserRepo(conn server.UserConn) UserRepo { +func NewUserRepo(conn pb.UserServiceClient) UserRepo { return &userRepo{ - client: pb.NewUserServiceClient(conn), + client: conn, } } diff --git a/app/publish/service/internal/server/server.go b/app/publish/service/internal/server/server.go index 54dd372..7d1a0c8 100644 --- a/app/publish/service/internal/server/server.go +++ b/app/publish/service/internal/server/server.go @@ -8,25 +8,27 @@ import ( "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/logging" "github.com/go-kratos/kratos/v2/middleware/recovery" + "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/google/wire" - stdgrpc "google.golang.org/grpc" -) -// ProviderSet is server providers. -var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewUserClient, NewFavoriteClient) + "github.com/go-kratos/kratos/contrib/registry/consul/v2" + "github.com/hashicorp/consul/api" -type ( - UserConn stdgrpc.ClientConnInterface - FavoriteConn stdgrpc.ClientConnInterface + favoritev1 "github.com/toomanysource/atreus/api/favorite/service/v1" + userv1 "github.com/toomanysource/atreus/api/user/service/v1" ) +// ProviderSet is server providers. +var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewUserClient, NewFavoriteClient, NewDiscovery, NewRegistrar) + // NewUserClient 创建一个User服务客户端,接收User服务数据 -func NewUserClient(c *conf.Client, logger log.Logger) UserConn { +func NewUserClient(r registry.Discovery, logger log.Logger) userv1.UserServiceClient { logs := log.NewHelper(log.With(logger, "module", "server/user")) conn, err := grpc.DialInsecure( context.Background(), - grpc.WithEndpoint(c.User.To), + grpc.WithEndpoint("discovery:///user"), + grpc.WithDiscovery(r), grpc.WithMiddleware( recovery.Recovery(), logging.Client(logger), @@ -36,15 +38,16 @@ func NewUserClient(c *conf.Client, logger log.Logger) UserConn { logs.Fatalf("user service connect error, %v", err) } logs.Info("user service connect successfully") - return conn + return userv1.NewUserServiceClient(conn) } // NewFavoriteClient 创建一个Favorite服务客户端,接收Favorite服务数据 -func NewFavoriteClient(c *conf.Client, logger log.Logger) FavoriteConn { +func NewFavoriteClient(r registry.Discovery, logger log.Logger) favoritev1.FavoriteServiceClient { logs := log.NewHelper(log.With(logger, "module", "server/favorite")) conn, err := grpc.DialInsecure( context.Background(), - grpc.WithEndpoint(c.Favorite.To), + grpc.WithEndpoint("discovery:///atreus.favorite.service"), + grpc.WithDiscovery(r), grpc.WithMiddleware( recovery.Recovery(), logging.Client(logger), @@ -54,5 +57,29 @@ func NewFavoriteClient(c *conf.Client, logger log.Logger) FavoriteConn { logs.Fatalf("favorite service connect error, %v", err) } logs.Info("favorite service connect successfully") - return conn + return favoritev1.NewFavoriteServiceClient(conn) +} + +func NewDiscovery(conf *conf.Registry) registry.Discovery { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) + } + r := consul.New(cli, consul.WithHealthCheck(false)) + return r +} + +func NewRegistrar(conf *conf.Registry) registry.Registrar { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) + } + r := consul.New(cli, consul.WithHealthCheck(false)) + return r } diff --git a/app/relation/service/cmd/main.go b/app/relation/service/cmd/main.go index 0c3c587..de575b6 100644 --- a/app/relation/service/cmd/main.go +++ b/app/relation/service/cmd/main.go @@ -11,6 +11,7 @@ import ( "github.com/go-kratos/kratos/v2/config" "github.com/go-kratos/kratos/v2/config/file" "github.com/go-kratos/kratos/v2/log" + "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/go-kratos/kratos/v2/transport/http" ) @@ -25,7 +26,7 @@ func init() { flag.StringVar(&flagConf, "conf", "../configs", "config path, eg: -conf config.yaml") } -func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { +func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.Name(Name), kratos.Logger(logger), @@ -33,6 +34,7 @@ func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { gs, hs, ), + kratos.Registrar(rr), ) } @@ -61,7 +63,12 @@ func main() { panic(err) } - app, cleanup, err := wireApp(bc.Server, bc.Client, bc.Jwt, bc.Data, logger) + var rc conf.Registry + if err := c.Scan(&rc); err != nil { + panic(err) + } + + app, cleanup, err := wireApp(bc.Server, &rc, bc.Jwt, bc.Data, logger) if err != nil { panic(err) } diff --git a/app/relation/service/cmd/wire.go b/app/relation/service/cmd/wire.go index 1eb22d1..42031f5 100644 --- a/app/relation/service/cmd/wire.go +++ b/app/relation/service/cmd/wire.go @@ -18,6 +18,6 @@ import ( ) // wireApp init kratos application. -func wireApp(*conf.Server, *conf.Client, *conf.JWT, *conf.Data, log.Logger) (*kratos.App, func(), error) { +func wireApp(*conf.Server, *conf.Registry, *conf.JWT, *conf.Data, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } diff --git a/app/relation/service/cmd/wire_gen.go b/app/relation/service/cmd/wire_gen.go index 635b81b..e919af8 100644 --- a/app/relation/service/cmd/wire_gen.go +++ b/app/relation/service/cmd/wire_gen.go @@ -20,7 +20,7 @@ import ( // Injectors from wire.go: // wireApp init kratos application. -func wireApp(confServer *conf.Server, client *conf.Client, jwt *conf.JWT, confData *conf.Data, logger log.Logger) (*kratos.App, func(), error) { +func wireApp(confServer *conf.Server, registry *conf.Registry, jwt *conf.JWT, confData *conf.Data, logger log.Logger) (*kratos.App, func(), error) { db := data.NewMysqlConn(confData, logger) cacheClient := data.NewRedisConn(confData, logger) kfkWriter := data.NewKafkaWriter(confData, logger) @@ -28,13 +28,15 @@ func wireApp(confServer *conf.Server, client *conf.Client, jwt *conf.JWT, confDa if err != nil { return nil, nil, err } - clientConn := server.NewUserClient(client, logger) - relationRepo := data.NewRelationRepo(dataData, clientConn, logger) + discovery := server.NewDiscovery(registry) + userServiceClient := server.NewUserClient(discovery, logger) + relationRepo := data.NewRelationRepo(dataData, userServiceClient, logger) relationUseCase := biz.NewRelationUseCase(relationRepo, logger) relationService := service.NewRelationService(relationUseCase, logger) grpcServer := server.NewGRPCServer(confServer, relationService, logger) httpServer := server.NewHTTPServer(confServer, jwt, relationService, logger) - app := newApp(logger, grpcServer, httpServer) + registrar := server.NewRegistrar(registry) + app := newApp(logger, grpcServer, httpServer, registrar) return app, func() { cleanup() }, nil diff --git a/app/relation/service/internal/conf/conf.pb.go b/app/relation/service/internal/conf/conf.pb.go index 21a0272..267c52a 100644 --- a/app/relation/service/internal/conf/conf.pb.go +++ b/app/relation/service/internal/conf/conf.pb.go @@ -28,9 +28,8 @@ type Bootstrap struct { unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` - Client *Client `protobuf:"bytes,2,opt,name=client,proto3" json:"client,omitempty"` - Data *Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - Jwt *JWT `protobuf:"bytes,4,opt,name=jwt,proto3" json:"jwt,omitempty"` + Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Jwt *JWT `protobuf:"bytes,3,opt,name=jwt,proto3" json:"jwt,omitempty"` } func (x *Bootstrap) Reset() { @@ -72,13 +71,6 @@ func (x *Bootstrap) GetServer() *Server { return nil } -func (x *Bootstrap) GetClient() *Client { - if x != nil { - return x.Client - } - return nil -} - func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data @@ -148,16 +140,18 @@ func (x *Server) GetGrpc() *Server_GRPC { return nil } -type Client struct { +type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - User *Client_User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` + Mysql *Data_Mysql `protobuf:"bytes,1,opt,name=mysql,proto3" json:"mysql,omitempty"` + Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` + Kafka *Data_Kafka `protobuf:"bytes,3,opt,name=kafka,proto3" json:"kafka,omitempty"` } -func (x *Client) Reset() { - *x = Client{} +func (x *Data) Reset() { + *x = Data{} if protoimpl.UnsafeEnabled { mi := &file_relation_service_internal_conf_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -165,13 +159,13 @@ func (x *Client) Reset() { } } -func (x *Client) String() string { +func (x *Data) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Client) ProtoMessage() {} +func (*Data) ProtoMessage() {} -func (x *Client) ProtoReflect() protoreflect.Message { +func (x *Data) ProtoReflect() protoreflect.Message { mi := &file_relation_service_internal_conf_conf_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -183,30 +177,43 @@ func (x *Client) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Client.ProtoReflect.Descriptor instead. -func (*Client) Descriptor() ([]byte, []int) { +// Deprecated: Use Data.ProtoReflect.Descriptor instead. +func (*Data) Descriptor() ([]byte, []int) { return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{2} } -func (x *Client) GetUser() *Client_User { +func (x *Data) GetMysql() *Data_Mysql { if x != nil { - return x.User + return x.Mysql } return nil } -type Data struct { +func (x *Data) GetRedis() *Data_Redis { + if x != nil { + return x.Redis + } + return nil +} + +func (x *Data) GetKafka() *Data_Kafka { + if x != nil { + return x.Kafka + } + return nil +} + +type JWT struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Mysql *Data_Mysql `protobuf:"bytes,1,opt,name=mysql,proto3" json:"mysql,omitempty"` - Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` - Kafka *Data_Kafka `protobuf:"bytes,3,opt,name=kafka,proto3" json:"kafka,omitempty"` + Http *JWT_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` + Grpc *JWT_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` } -func (x *Data) Reset() { - *x = Data{} +func (x *JWT) Reset() { + *x = JWT{} if protoimpl.UnsafeEnabled { mi := &file_relation_service_internal_conf_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -214,13 +221,13 @@ func (x *Data) Reset() { } } -func (x *Data) String() string { +func (x *JWT) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Data) ProtoMessage() {} +func (*JWT) ProtoMessage() {} -func (x *Data) ProtoReflect() protoreflect.Message { +func (x *JWT) ProtoReflect() protoreflect.Message { mi := &file_relation_service_internal_conf_conf_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -232,43 +239,35 @@ func (x *Data) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Data.ProtoReflect.Descriptor instead. -func (*Data) Descriptor() ([]byte, []int) { +// Deprecated: Use JWT.ProtoReflect.Descriptor instead. +func (*JWT) Descriptor() ([]byte, []int) { return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{3} } -func (x *Data) GetMysql() *Data_Mysql { - if x != nil { - return x.Mysql - } - return nil -} - -func (x *Data) GetRedis() *Data_Redis { +func (x *JWT) GetHttp() *JWT_HTTP { if x != nil { - return x.Redis + return x.Http } return nil } -func (x *Data) GetKafka() *Data_Kafka { +func (x *JWT) GetGrpc() *JWT_GRPC { if x != nil { - return x.Kafka + return x.Grpc } return nil } -type JWT struct { +type Registry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Http *JWT_HTTP `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` - Grpc *JWT_GRPC `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` + Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` } -func (x *JWT) Reset() { - *x = JWT{} +func (x *Registry) Reset() { + *x = Registry{} if protoimpl.UnsafeEnabled { mi := &file_relation_service_internal_conf_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -276,13 +275,13 @@ func (x *JWT) Reset() { } } -func (x *JWT) String() string { +func (x *Registry) String() string { return protoimpl.X.MessageStringOf(x) } -func (*JWT) ProtoMessage() {} +func (*Registry) ProtoMessage() {} -func (x *JWT) ProtoReflect() protoreflect.Message { +func (x *Registry) ProtoReflect() protoreflect.Message { mi := &file_relation_service_internal_conf_conf_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -294,21 +293,14 @@ func (x *JWT) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use JWT.ProtoReflect.Descriptor instead. -func (*JWT) Descriptor() ([]byte, []int) { +// Deprecated: Use Registry.ProtoReflect.Descriptor instead. +func (*Registry) Descriptor() ([]byte, []int) { return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{4} } -func (x *JWT) GetHttp() *JWT_HTTP { +func (x *Registry) GetConsul() *Registry_Consul { if x != nil { - return x.Http - } - return nil -} - -func (x *JWT) GetGrpc() *JWT_GRPC { - if x != nil { - return x.Grpc + return x.Consul } return nil } @@ -439,53 +431,6 @@ func (x *Server_GRPC) GetTimeout() *durationpb.Duration { return nil } -type Client_User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *Client_User) Reset() { - *x = Client_User{} - if protoimpl.UnsafeEnabled { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Client_User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Client_User) ProtoMessage() {} - -func (x *Client_User) ProtoReflect() protoreflect.Message { - mi := &file_relation_service_internal_conf_conf_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 Client_User.ProtoReflect.Descriptor instead. -func (*Client_User) Descriptor() ([]byte, []int) { - return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *Client_User) GetTo() string { - if x != nil { - return x.To - } - return "" -} - type Data_Mysql struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -498,7 +443,7 @@ type Data_Mysql struct { func (x *Data_Mysql) Reset() { *x = Data_Mysql{} if protoimpl.UnsafeEnabled { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[8] + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -511,7 +456,7 @@ func (x *Data_Mysql) String() string { func (*Data_Mysql) ProtoMessage() {} func (x *Data_Mysql) ProtoReflect() protoreflect.Message { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[8] + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -524,7 +469,7 @@ func (x *Data_Mysql) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Mysql.ProtoReflect.Descriptor instead. func (*Data_Mysql) Descriptor() ([]byte, []int) { - return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} + return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} } func (x *Data_Mysql) GetDriver() string { @@ -557,7 +502,7 @@ type Data_Redis struct { func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[9] + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -570,7 +515,7 @@ func (x *Data_Redis) String() string { func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[9] + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -583,7 +528,7 @@ func (x *Data_Redis) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Redis.ProtoReflect.Descriptor instead. func (*Data_Redis) Descriptor() ([]byte, []int) { - return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 1} + return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 1} } func (x *Data_Redis) GetFollowDb() int32 { @@ -644,7 +589,7 @@ type Data_Kafka struct { func (x *Data_Kafka) Reset() { *x = Data_Kafka{} if protoimpl.UnsafeEnabled { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -657,7 +602,7 @@ func (x *Data_Kafka) String() string { func (*Data_Kafka) ProtoMessage() {} func (x *Data_Kafka) ProtoReflect() protoreflect.Message { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -670,7 +615,7 @@ func (x *Data_Kafka) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Kafka.ProtoReflect.Descriptor instead. func (*Data_Kafka) Descriptor() ([]byte, []int) { - return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 2} + return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 2} } func (x *Data_Kafka) GetAddr() string { @@ -726,7 +671,7 @@ type JWT_HTTP struct { func (x *JWT_HTTP) Reset() { *x = JWT_HTTP{} if protoimpl.UnsafeEnabled { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[11] + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -739,7 +684,7 @@ func (x *JWT_HTTP) String() string { func (*JWT_HTTP) ProtoMessage() {} func (x *JWT_HTTP) ProtoReflect() protoreflect.Message { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[11] + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -752,7 +697,7 @@ func (x *JWT_HTTP) ProtoReflect() protoreflect.Message { // Deprecated: Use JWT_HTTP.ProtoReflect.Descriptor instead. func (*JWT_HTTP) Descriptor() ([]byte, []int) { - return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 0} + return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} } func (x *JWT_HTTP) GetTokenKey() string { @@ -773,7 +718,7 @@ type JWT_GRPC struct { func (x *JWT_GRPC) Reset() { *x = JWT_GRPC{} if protoimpl.UnsafeEnabled { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[12] + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -786,7 +731,7 @@ func (x *JWT_GRPC) String() string { func (*JWT_GRPC) ProtoMessage() {} func (x *JWT_GRPC) ProtoReflect() protoreflect.Message { - mi := &file_relation_service_internal_conf_conf_proto_msgTypes[12] + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -799,7 +744,7 @@ func (x *JWT_GRPC) ProtoReflect() protoreflect.Message { // Deprecated: Use JWT_GRPC.ProtoReflect.Descriptor instead. func (*JWT_GRPC) Descriptor() ([]byte, []int) { - return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 1} + return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 1} } func (x *JWT_GRPC) GetTokenKey() string { @@ -809,6 +754,61 @@ func (x *JWT_GRPC) GetTokenKey() string { return "" } +type Registry_Consul struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` +} + +func (x *Registry_Consul) Reset() { + *x = Registry_Consul{} + if protoimpl.UnsafeEnabled { + mi := &file_relation_service_internal_conf_conf_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Consul) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Consul) ProtoMessage() {} + +func (x *Registry_Consul) ProtoReflect() protoreflect.Message { + mi := &file_relation_service_internal_conf_conf_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 Registry_Consul.ProtoReflect.Descriptor instead. +func (*Registry_Consul) Descriptor() ([]byte, []int) { + return file_relation_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *Registry_Consul) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Consul) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + var File_relation_service_internal_conf_conf_proto protoreflect.FileDescriptor var file_relation_service_internal_conf_conf_proto_rawDesc = []byte{ @@ -818,20 +818,16 @@ var file_relation_service_internal_conf_conf_proto_rawDesc = []byte{ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfc, 0x01, 0x0a, 0x09, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbc, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x3e, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x3e, 0x0a, 0x06, 0x63, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x72, 0x65, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x38, 0x0a, 0x04, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x12, 0x35, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x61, 0x74, 0x61, 0x12, 0x35, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x52, 0x03, 0x6a, 0x77, 0x74, 0x22, 0xe0, 0x02, 0x0a, 0x06, 0x53, @@ -856,79 +852,82 @@ var file_relation_service_internal_conf_conf_proto_rawDesc = []byte{ 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x61, 0x0a, - 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x3f, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xf9, 0x05, + 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x1a, 0x16, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, - 0x12, 0x0e, 0x0a, 0x02, 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, - 0x22, 0xf9, 0x05, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x40, 0x0a, 0x05, 0x6d, 0x79, 0x73, - 0x71, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4d, - 0x79, 0x73, 0x71, 0x6c, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x40, 0x0a, 0x05, 0x72, - 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x72, 0x65, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, - 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, 0x40, 0x0a, - 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x72, - 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, - 0x74, 0x61, 0x2e, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x1a, - 0x31, 0x0a, 0x05, 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, - 0x12, 0x10, 0x0a, 0x03, 0x64, 0x73, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, - 0x73, 0x6e, 0x1a, 0xf3, 0x01, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x1b, 0x0a, 0x09, - 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x64, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x08, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x44, 0x62, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x6f, 0x6c, - 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x64, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, - 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, - 0x64, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 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, 0x3c, 0x0a, 0x0c, 0x72, 0x65, - 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4d, 0x79, 0x73, 0x71, + 0x6c, 0x52, 0x05, 0x6d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x40, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, + 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, 0x40, 0x0a, 0x05, 0x6b, 0x61, + 0x66, 0x6b, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, + 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x1a, 0x31, 0x0a, 0x05, + 0x4d, 0x79, 0x73, 0x71, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x10, 0x0a, + 0x03, 0x64, 0x73, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x6e, 0x1a, + 0xf3, 0x01, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x6f, 0x6c, + 0x6c, 0x6f, 0x77, 0x5f, 0x64, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x6f, + 0x6c, 0x6c, 0x6f, 0x77, 0x44, 0x62, 0x12, 0x1f, 0x0a, 0x0b, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x65, 0x64, 0x5f, 0x64, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x66, 0x6f, 0x6c, + 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x44, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 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, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, + 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x81, 0x02, 0x0a, 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x12, + 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, + 0x64, 0x64, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x6f, + 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, + 0x77, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, + 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, + 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x1c, 0x0a, + 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x0c, 0x72, + 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, + 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, - 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x81, 0x02, 0x0a, 0x05, 0x4b, 0x61, 0x66, - 0x6b, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, - 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x6f, - 0x6c, 0x6c, 0x6f, 0x77, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6f, 0x6c, - 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x54, 0x6f, 0x70, 0x69, 0x63, - 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, - 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xcb, 0x01, 0x0a, - 0x03, 0x4a, 0x57, 0x54, 0x12, 0x3c, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, - 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, - 0x74, 0x70, 0x12, 0x3c, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x28, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, - 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, - 0x1a, 0x23, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x1a, 0x23, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x1b, 0x0a, - 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6f, 0x6d, 0x61, 0x6e, 0x79, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, 0x75, 0x73, 0x2f, 0x61, 0x70, - 0x70, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xcb, 0x01, 0x0a, 0x03, 0x4a, 0x57, + 0x54, 0x12, 0x3c, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, + 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, + 0x3c, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, + 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, + 0x57, 0x54, 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x23, 0x0a, + 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, + 0x65, 0x79, 0x1a, 0x23, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x22, 0x8f, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x72, 0x79, 0x12, 0x47, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, 0x43, + 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, 0x0a, + 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6f, 0x6d, 0x61, 0x6e, 0x79, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, 0x75, 0x73, 0x2f, 0x61, 0x70, 0x70, + 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, + 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -947,43 +946,42 @@ var file_relation_service_internal_conf_conf_proto_msgTypes = make([]protoimpl.M var file_relation_service_internal_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: relation.service.internal.conf.Bootstrap (*Server)(nil), // 1: relation.service.internal.conf.Server - (*Client)(nil), // 2: relation.service.internal.conf.Client - (*Data)(nil), // 3: relation.service.internal.conf.Data - (*JWT)(nil), // 4: relation.service.internal.conf.JWT + (*Data)(nil), // 2: relation.service.internal.conf.Data + (*JWT)(nil), // 3: relation.service.internal.conf.JWT + (*Registry)(nil), // 4: relation.service.internal.conf.Registry (*Server_HTTP)(nil), // 5: relation.service.internal.conf.Server.HTTP (*Server_GRPC)(nil), // 6: relation.service.internal.conf.Server.GRPC - (*Client_User)(nil), // 7: relation.service.internal.conf.Client.User - (*Data_Mysql)(nil), // 8: relation.service.internal.conf.Data.Mysql - (*Data_Redis)(nil), // 9: relation.service.internal.conf.Data.Redis - (*Data_Kafka)(nil), // 10: relation.service.internal.conf.Data.Kafka - (*JWT_HTTP)(nil), // 11: relation.service.internal.conf.JWT.HTTP - (*JWT_GRPC)(nil), // 12: relation.service.internal.conf.JWT.GRPC + (*Data_Mysql)(nil), // 7: relation.service.internal.conf.Data.Mysql + (*Data_Redis)(nil), // 8: relation.service.internal.conf.Data.Redis + (*Data_Kafka)(nil), // 9: relation.service.internal.conf.Data.Kafka + (*JWT_HTTP)(nil), // 10: relation.service.internal.conf.JWT.HTTP + (*JWT_GRPC)(nil), // 11: relation.service.internal.conf.JWT.GRPC + (*Registry_Consul)(nil), // 12: relation.service.internal.conf.Registry.Consul (*durationpb.Duration)(nil), // 13: google.protobuf.Duration } var file_relation_service_internal_conf_conf_proto_depIdxs = []int32{ 1, // 0: relation.service.internal.conf.Bootstrap.server:type_name -> relation.service.internal.conf.Server - 2, // 1: relation.service.internal.conf.Bootstrap.client:type_name -> relation.service.internal.conf.Client - 3, // 2: relation.service.internal.conf.Bootstrap.data:type_name -> relation.service.internal.conf.Data - 4, // 3: relation.service.internal.conf.Bootstrap.jwt:type_name -> relation.service.internal.conf.JWT - 5, // 4: relation.service.internal.conf.Server.http:type_name -> relation.service.internal.conf.Server.HTTP - 6, // 5: relation.service.internal.conf.Server.grpc:type_name -> relation.service.internal.conf.Server.GRPC - 7, // 6: relation.service.internal.conf.Client.user:type_name -> relation.service.internal.conf.Client.User - 8, // 7: relation.service.internal.conf.Data.mysql:type_name -> relation.service.internal.conf.Data.Mysql - 9, // 8: relation.service.internal.conf.Data.redis:type_name -> relation.service.internal.conf.Data.Redis - 10, // 9: relation.service.internal.conf.Data.kafka:type_name -> relation.service.internal.conf.Data.Kafka - 11, // 10: relation.service.internal.conf.JWT.http:type_name -> relation.service.internal.conf.JWT.HTTP - 12, // 11: relation.service.internal.conf.JWT.grpc:type_name -> relation.service.internal.conf.JWT.GRPC - 13, // 12: relation.service.internal.conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration - 13, // 13: relation.service.internal.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration - 13, // 14: relation.service.internal.conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration - 13, // 15: relation.service.internal.conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration - 13, // 16: relation.service.internal.conf.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration - 13, // 17: relation.service.internal.conf.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] 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 + 2, // 1: relation.service.internal.conf.Bootstrap.data:type_name -> relation.service.internal.conf.Data + 3, // 2: relation.service.internal.conf.Bootstrap.jwt:type_name -> relation.service.internal.conf.JWT + 5, // 3: relation.service.internal.conf.Server.http:type_name -> relation.service.internal.conf.Server.HTTP + 6, // 4: relation.service.internal.conf.Server.grpc:type_name -> relation.service.internal.conf.Server.GRPC + 7, // 5: relation.service.internal.conf.Data.mysql:type_name -> relation.service.internal.conf.Data.Mysql + 8, // 6: relation.service.internal.conf.Data.redis:type_name -> relation.service.internal.conf.Data.Redis + 9, // 7: relation.service.internal.conf.Data.kafka:type_name -> relation.service.internal.conf.Data.Kafka + 10, // 8: relation.service.internal.conf.JWT.http:type_name -> relation.service.internal.conf.JWT.HTTP + 11, // 9: relation.service.internal.conf.JWT.grpc:type_name -> relation.service.internal.conf.JWT.GRPC + 12, // 10: relation.service.internal.conf.Registry.consul:type_name -> relation.service.internal.conf.Registry.Consul + 13, // 11: relation.service.internal.conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration + 13, // 12: relation.service.internal.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration + 13, // 13: relation.service.internal.conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration + 13, // 14: relation.service.internal.conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration + 13, // 15: relation.service.internal.conf.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration + 13, // 16: relation.service.internal.conf.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_relation_service_internal_conf_conf_proto_init() } @@ -1017,7 +1015,7 @@ func file_relation_service_internal_conf_conf_proto_init() { } } file_relation_service_internal_conf_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client); i { + switch v := v.(*Data); i { case 0: return &v.state case 1: @@ -1029,7 +1027,7 @@ func file_relation_service_internal_conf_conf_proto_init() { } } file_relation_service_internal_conf_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data); i { + switch v := v.(*JWT); i { case 0: return &v.state case 1: @@ -1041,7 +1039,7 @@ func file_relation_service_internal_conf_conf_proto_init() { } } file_relation_service_internal_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT); i { + switch v := v.(*Registry); i { case 0: return &v.state case 1: @@ -1077,7 +1075,7 @@ func file_relation_service_internal_conf_conf_proto_init() { } } file_relation_service_internal_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client_User); i { + switch v := v.(*Data_Mysql); i { case 0: return &v.state case 1: @@ -1089,7 +1087,7 @@ func file_relation_service_internal_conf_conf_proto_init() { } } file_relation_service_internal_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Mysql); i { + switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: @@ -1101,7 +1099,7 @@ func file_relation_service_internal_conf_conf_proto_init() { } } file_relation_service_internal_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Redis); i { + switch v := v.(*Data_Kafka); i { case 0: return &v.state case 1: @@ -1113,7 +1111,7 @@ func file_relation_service_internal_conf_conf_proto_init() { } } file_relation_service_internal_conf_conf_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Kafka); i { + switch v := v.(*JWT_HTTP); i { case 0: return &v.state case 1: @@ -1125,7 +1123,7 @@ func file_relation_service_internal_conf_conf_proto_init() { } } file_relation_service_internal_conf_conf_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT_HTTP); i { + switch v := v.(*JWT_GRPC); i { case 0: return &v.state case 1: @@ -1137,7 +1135,7 @@ func file_relation_service_internal_conf_conf_proto_init() { } } file_relation_service_internal_conf_conf_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT_GRPC); i { + switch v := v.(*Registry_Consul); i { case 0: return &v.state case 1: diff --git a/app/relation/service/internal/conf/conf.proto b/app/relation/service/internal/conf/conf.proto index 8be16ef..90b78bd 100644 --- a/app/relation/service/internal/conf/conf.proto +++ b/app/relation/service/internal/conf/conf.proto @@ -1,15 +1,14 @@ syntax = "proto3"; package relation.service.internal.conf; -option go_package = "github.com/toomanysource/atreus/app/relation/service/internal/conf;conf"; - import "google/protobuf/duration.proto"; +option go_package = "github.com/toomanysource/atreus/app/relation/service/internal/conf;conf"; + message Bootstrap { Server server = 1; - Client client = 2; - Data data = 3; - JWT jwt = 4; + Data data = 2; + JWT jwt = 3; } message Server { @@ -17,7 +16,6 @@ message Server { string network = 1; string addr = 2; google.protobuf.Duration timeout = 3; - } message GRPC { string network = 1; @@ -28,13 +26,6 @@ message Server { GRPC grpc = 2; } -message Client { - message User { - string to = 1; - } - User user = 1; -} - message Data { message Mysql { string driver = 1; @@ -70,4 +61,12 @@ message JWT { } HTTP http = 1; GRPC grpc = 2; -} \ No newline at end of file +} + +message Registry { + message Consul { + string address = 1; + string scheme = 2; + } + Consul consul = 1; +} diff --git a/app/relation/service/internal/data/relation.go b/app/relation/service/internal/data/relation.go index 6148798..57bf221 100644 --- a/app/relation/service/internal/data/relation.go +++ b/app/relation/service/internal/data/relation.go @@ -7,6 +7,8 @@ import ( "strconv" "time" + userv1 "github.com/toomanysource/atreus/api/user/service/v1" + "gorm.io/gorm" "github.com/toomanysource/atreus/middleware" @@ -17,7 +19,6 @@ import ( "github.com/go-kratos/kratos/v2/log" "github.com/go-redis/redis/v8" - "google.golang.org/grpc" ) const ( @@ -52,11 +53,11 @@ type relationRepo struct { log *log.Helper } -func NewRelationRepo(data *Data, conn *grpc.ClientConn, logger log.Logger) biz.RelationRepo { +func NewRelationRepo(data *Data, userConn userv1.UserServiceClient, logger log.Logger) biz.RelationRepo { return &relationRepo{ data: data, kfk: data.kfk, - userRepo: NewUserRepo(conn), + userRepo: NewUserRepo(userConn), log: log.NewHelper(logger), } } diff --git a/app/relation/service/internal/data/user.go b/app/relation/service/internal/data/user.go index 3610265..1fcfa99 100644 --- a/app/relation/service/internal/data/user.go +++ b/app/relation/service/internal/data/user.go @@ -8,17 +8,15 @@ import ( pb "github.com/toomanysource/atreus/api/user/service/v1" "github.com/toomanysource/atreus/app/relation/service/internal/biz" - - "google.golang.org/grpc" ) type userRepo struct { client pb.UserServiceClient } -func NewUserRepo(conn *grpc.ClientConn) UserRepo { +func NewUserRepo(conn pb.UserServiceClient) UserRepo { return &userRepo{ - client: pb.NewUserServiceClient(conn), + client: conn, } } diff --git a/app/relation/service/internal/server/server.go b/app/relation/service/internal/server/server.go index 9410fd8..788c99f 100644 --- a/app/relation/service/internal/server/server.go +++ b/app/relation/service/internal/server/server.go @@ -8,20 +8,26 @@ import ( "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/logging" "github.com/go-kratos/kratos/v2/middleware/recovery" + "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/google/wire" - stdgrpc "google.golang.org/grpc" + + "github.com/go-kratos/kratos/contrib/registry/consul/v2" + "github.com/hashicorp/consul/api" + + userv1 "github.com/toomanysource/atreus/api/user/service/v1" ) // ProviderSet is server providers. -var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewUserClient) +var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewUserClient, NewDiscovery, NewRegistrar) // NewUserClient 创建一个User服务客户端,接收User服务数据 -func NewUserClient(c *conf.Client, logger log.Logger) *stdgrpc.ClientConn { +func NewUserClient(r registry.Discovery, logger log.Logger) userv1.UserServiceClient { logs := log.NewHelper(log.With(logger, "module", "server/user")) conn, err := grpc.DialInsecure( context.Background(), - grpc.WithEndpoint(c.User.To), + grpc.WithEndpoint("discovery:///atreus.user.service"), + grpc.WithDiscovery(r), grpc.WithMiddleware( recovery.Recovery(), logging.Server(logger), @@ -31,5 +37,29 @@ func NewUserClient(c *conf.Client, logger log.Logger) *stdgrpc.ClientConn { logs.Fatalf("user service connect error, %v", err) } logs.Info("user service connect successfully") - return conn + return userv1.NewUserServiceClient(conn) +} + +func NewDiscovery(conf *conf.Registry) registry.Discovery { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) + } + r := consul.New(cli, consul.WithHealthCheck(false)) + return r +} + +func NewRegistrar(conf *conf.Registry) registry.Registrar { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) + } + r := consul.New(cli, consul.WithHealthCheck(false)) + return r } diff --git a/app/user/service/cmd/main.go b/app/user/service/cmd/main.go index fd85e0a..886f773 100644 --- a/app/user/service/cmd/main.go +++ b/app/user/service/cmd/main.go @@ -11,6 +11,8 @@ import ( "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/go-kratos/kratos/v2/transport/http" + "github.com/go-kratos/kratos/v2/registry" + "github.com/toomanysource/atreus/app/user/service/internal/conf" "github.com/toomanysource/atreus/pkg/logX" @@ -28,7 +30,7 @@ func init() { flag.StringVar(&flagConf, "conf", "../../configs", "config path, eg: -conf config.yaml") } -func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { +func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server, rr registry.Registrar) *kratos.App { return kratos.New( kratos.Name(Name), kratos.Logger(logger), @@ -36,6 +38,7 @@ func newApp(logger log.Logger, gs *grpc.Server, hs *http.Server) *kratos.App { gs, hs, ), + kratos.Registrar(rr), ) } @@ -63,8 +66,12 @@ func main() { if err := c.Scan(&bc); err != nil { panic(err) } + var rc conf.Registry + if err := c.Scan(&rc); err != nil { + panic(err) + } - app, cleanup, err := wireApp(bc.Server, bc.Client, bc.Data, bc.Jwt, logger) + app, cleanup, err := wireApp(bc.Server, &rc, bc.Data, bc.Jwt, logger) if err != nil { panic(err) } diff --git a/app/user/service/cmd/wire.go b/app/user/service/cmd/wire.go index 8cea8ff..78ca8a7 100644 --- a/app/user/service/cmd/wire.go +++ b/app/user/service/cmd/wire.go @@ -18,6 +18,6 @@ import ( ) // wireApp init kratos application. -func wireApp(*conf.Server, *conf.Client, *conf.Data, *conf.JWT, log.Logger) (*kratos.App, func(), error) { +func wireApp(*conf.Server, *conf.Registry, *conf.Data, *conf.JWT, log.Logger) (*kratos.App, func(), error) { panic(wire.Build(server.ProviderSet, data.ProviderSet, biz.ProviderSet, service.ProviderSet, newApp)) } diff --git a/app/user/service/cmd/wire_gen.go b/app/user/service/cmd/wire_gen.go index dc572e9..558dfb0 100644 --- a/app/user/service/cmd/wire_gen.go +++ b/app/user/service/cmd/wire_gen.go @@ -22,22 +22,24 @@ import ( // Injectors from wire.go: // wireApp init kratos application. -func wireApp(confServer *conf.Server, client *conf.Client, confData *conf.Data, jwt *conf.JWT, logger log.Logger) (*kratos.App, func(), error) { +func wireApp(confServer *conf.Server, registry *conf.Registry, confData *conf.Data, jwt *conf.JWT, logger log.Logger) (*kratos.App, func(), error) { db := data.NewGormDb(confData, logger) - redisClient := data.NewRedisConn(confData, logger) + client := data.NewRedisConn(confData, logger) kfkReader := data.NewKafkaReader(confData) - dataData, cleanup, err := data.NewData(db, redisClient, kfkReader, logger) + dataData, cleanup, err := data.NewData(db, client, kfkReader, logger) if err != nil { return nil, nil, err } userRepo := data.NewUserRepo(dataData, logger) - relationConn := server.NewRelationClient(client, logger) - relationRepo := data.NewRelationRepo(relationConn) + discovery := server.NewDiscovery(registry) + relationServiceClient := server.NewRelationClient(discovery, logger) + relationRepo := data.NewRelationRepo(relationServiceClient) userUsecase := biz.NewUserUsecase(userRepo, relationRepo, jwt, logger) userService := service.NewUserService(userUsecase, logger) grpcServer := server.NewGRPCServer(confServer, userService, logger) httpServer := server.NewHTTPServer(confServer, jwt, userService, logger) - app := newApp(logger, grpcServer, httpServer) + registrar := server.NewRegistrar(registry) + app := newApp(logger, grpcServer, httpServer, registrar) return app, func() { cleanup() }, nil diff --git a/app/user/service/internal/conf/conf.pb.go b/app/user/service/internal/conf/conf.pb.go index 79e5520..dfded51 100644 --- a/app/user/service/internal/conf/conf.pb.go +++ b/app/user/service/internal/conf/conf.pb.go @@ -28,9 +28,8 @@ type Bootstrap struct { unknownFields protoimpl.UnknownFields Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` - Client *Client `protobuf:"bytes,2,opt,name=client,proto3" json:"client,omitempty"` - Data *Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - Jwt *JWT `protobuf:"bytes,4,opt,name=jwt,proto3" json:"jwt,omitempty"` + Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + Jwt *JWT `protobuf:"bytes,3,opt,name=jwt,proto3" json:"jwt,omitempty"` } func (x *Bootstrap) Reset() { @@ -72,13 +71,6 @@ func (x *Bootstrap) GetServer() *Server { return nil } -func (x *Bootstrap) GetClient() *Client { - if x != nil { - return x.Client - } - return nil -} - func (x *Bootstrap) GetData() *Data { if x != nil { return x.Data @@ -148,16 +140,18 @@ func (x *Server) GetGrpc() *Server_GRPC { return nil } -type Client struct { +type Data struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Relation *Client_Relation `protobuf:"bytes,1,opt,name=relation,proto3" json:"relation,omitempty"` + Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` + Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` + Kafka *Data_Kafka `protobuf:"bytes,3,opt,name=kafka,proto3" json:"kafka,omitempty"` } -func (x *Client) Reset() { - *x = Client{} +func (x *Data) Reset() { + *x = Data{} if protoimpl.UnsafeEnabled { mi := &file_user_service_internal_conf_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -165,13 +159,13 @@ func (x *Client) Reset() { } } -func (x *Client) String() string { +func (x *Data) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Client) ProtoMessage() {} +func (*Data) ProtoMessage() {} -func (x *Client) ProtoReflect() protoreflect.Message { +func (x *Data) ProtoReflect() protoreflect.Message { mi := &file_user_service_internal_conf_conf_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -183,30 +177,43 @@ func (x *Client) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Client.ProtoReflect.Descriptor instead. -func (*Client) Descriptor() ([]byte, []int) { +// Deprecated: Use Data.ProtoReflect.Descriptor instead. +func (*Data) Descriptor() ([]byte, []int) { return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{2} } -func (x *Client) GetRelation() *Client_Relation { +func (x *Data) GetDatabase() *Data_Database { if x != nil { - return x.Relation + return x.Database } return nil } -type Data struct { +func (x *Data) GetRedis() *Data_Redis { + if x != nil { + return x.Redis + } + return nil +} + +func (x *Data) GetKafka() *Data_Kafka { + if x != nil { + return x.Kafka + } + return nil +} + +type JWT struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` - Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` - Kafka *Data_Kafka `protobuf:"bytes,3,opt,name=kafka,proto3" json:"kafka,omitempty"` + Http *JWT_Http `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` + Grpc *JWT_Grpc `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` } -func (x *Data) Reset() { - *x = Data{} +func (x *JWT) Reset() { + *x = JWT{} if protoimpl.UnsafeEnabled { mi := &file_user_service_internal_conf_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -214,13 +221,13 @@ func (x *Data) Reset() { } } -func (x *Data) String() string { +func (x *JWT) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Data) ProtoMessage() {} +func (*JWT) ProtoMessage() {} -func (x *Data) ProtoReflect() protoreflect.Message { +func (x *JWT) ProtoReflect() protoreflect.Message { mi := &file_user_service_internal_conf_conf_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -232,43 +239,35 @@ func (x *Data) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Data.ProtoReflect.Descriptor instead. -func (*Data) Descriptor() ([]byte, []int) { +// Deprecated: Use JWT.ProtoReflect.Descriptor instead. +func (*JWT) Descriptor() ([]byte, []int) { return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{3} } -func (x *Data) GetDatabase() *Data_Database { - if x != nil { - return x.Database - } - return nil -} - -func (x *Data) GetRedis() *Data_Redis { +func (x *JWT) GetHttp() *JWT_Http { if x != nil { - return x.Redis + return x.Http } return nil } -func (x *Data) GetKafka() *Data_Kafka { +func (x *JWT) GetGrpc() *JWT_Grpc { if x != nil { - return x.Kafka + return x.Grpc } return nil } -type JWT struct { +type Registry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Http *JWT_Http `protobuf:"bytes,1,opt,name=http,proto3" json:"http,omitempty"` - Grpc *JWT_Grpc `protobuf:"bytes,2,opt,name=grpc,proto3" json:"grpc,omitempty"` + Consul *Registry_Consul `protobuf:"bytes,1,opt,name=consul,proto3" json:"consul,omitempty"` } -func (x *JWT) Reset() { - *x = JWT{} +func (x *Registry) Reset() { + *x = Registry{} if protoimpl.UnsafeEnabled { mi := &file_user_service_internal_conf_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -276,13 +275,13 @@ func (x *JWT) Reset() { } } -func (x *JWT) String() string { +func (x *Registry) String() string { return protoimpl.X.MessageStringOf(x) } -func (*JWT) ProtoMessage() {} +func (*Registry) ProtoMessage() {} -func (x *JWT) ProtoReflect() protoreflect.Message { +func (x *Registry) ProtoReflect() protoreflect.Message { mi := &file_user_service_internal_conf_conf_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -294,21 +293,14 @@ func (x *JWT) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use JWT.ProtoReflect.Descriptor instead. -func (*JWT) Descriptor() ([]byte, []int) { +// Deprecated: Use Registry.ProtoReflect.Descriptor instead. +func (*Registry) Descriptor() ([]byte, []int) { return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{4} } -func (x *JWT) GetHttp() *JWT_Http { - if x != nil { - return x.Http - } - return nil -} - -func (x *JWT) GetGrpc() *JWT_Grpc { +func (x *Registry) GetConsul() *Registry_Consul { if x != nil { - return x.Grpc + return x.Consul } return nil } @@ -439,53 +431,6 @@ func (x *Server_GRPC) GetTimeout() *durationpb.Duration { return nil } -type Client_Relation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` -} - -func (x *Client_Relation) Reset() { - *x = Client_Relation{} - if protoimpl.UnsafeEnabled { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Client_Relation) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Client_Relation) ProtoMessage() {} - -func (x *Client_Relation) ProtoReflect() protoreflect.Message { - mi := &file_user_service_internal_conf_conf_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 Client_Relation.ProtoReflect.Descriptor instead. -func (*Client_Relation) Descriptor() ([]byte, []int) { - return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *Client_Relation) GetTo() string { - if x != nil { - return x.To - } - return "" -} - type Data_Database struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -498,7 +443,7 @@ type Data_Database struct { func (x *Data_Database) Reset() { *x = Data_Database{} if protoimpl.UnsafeEnabled { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[8] + mi := &file_user_service_internal_conf_conf_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -511,7 +456,7 @@ func (x *Data_Database) String() string { func (*Data_Database) ProtoMessage() {} func (x *Data_Database) ProtoReflect() protoreflect.Message { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[8] + mi := &file_user_service_internal_conf_conf_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -524,7 +469,7 @@ func (x *Data_Database) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Database.ProtoReflect.Descriptor instead. func (*Data_Database) Descriptor() ([]byte, []int) { - return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} + return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 0} } func (x *Data_Database) GetDriver() string { @@ -556,7 +501,7 @@ type Data_Redis struct { func (x *Data_Redis) Reset() { *x = Data_Redis{} if protoimpl.UnsafeEnabled { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[9] + mi := &file_user_service_internal_conf_conf_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -569,7 +514,7 @@ func (x *Data_Redis) String() string { func (*Data_Redis) ProtoMessage() {} func (x *Data_Redis) ProtoReflect() protoreflect.Message { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[9] + mi := &file_user_service_internal_conf_conf_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -582,7 +527,7 @@ func (x *Data_Redis) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Redis.ProtoReflect.Descriptor instead. func (*Data_Redis) Descriptor() ([]byte, []int) { - return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 1} + return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 1} } func (x *Data_Redis) GetDb() int32 { @@ -639,7 +584,7 @@ type Data_Kafka struct { func (x *Data_Kafka) Reset() { *x = Data_Kafka{} if protoimpl.UnsafeEnabled { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_user_service_internal_conf_conf_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -652,7 +597,7 @@ func (x *Data_Kafka) String() string { func (*Data_Kafka) ProtoMessage() {} func (x *Data_Kafka) ProtoReflect() protoreflect.Message { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[10] + mi := &file_user_service_internal_conf_conf_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -665,7 +610,7 @@ func (x *Data_Kafka) ProtoReflect() protoreflect.Message { // Deprecated: Use Data_Kafka.ProtoReflect.Descriptor instead. func (*Data_Kafka) Descriptor() ([]byte, []int) { - return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 2} + return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{2, 2} } func (x *Data_Kafka) GetAddr() string { @@ -742,7 +687,7 @@ type JWT_Http struct { func (x *JWT_Http) Reset() { *x = JWT_Http{} if protoimpl.UnsafeEnabled { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[11] + mi := &file_user_service_internal_conf_conf_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -755,7 +700,7 @@ func (x *JWT_Http) String() string { func (*JWT_Http) ProtoMessage() {} func (x *JWT_Http) ProtoReflect() protoreflect.Message { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[11] + mi := &file_user_service_internal_conf_conf_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -768,7 +713,7 @@ func (x *JWT_Http) ProtoReflect() protoreflect.Message { // Deprecated: Use JWT_Http.ProtoReflect.Descriptor instead. func (*JWT_Http) Descriptor() ([]byte, []int) { - return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 0} + return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 0} } func (x *JWT_Http) GetTokenKey() string { @@ -789,7 +734,7 @@ type JWT_Grpc struct { func (x *JWT_Grpc) Reset() { *x = JWT_Grpc{} if protoimpl.UnsafeEnabled { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[12] + mi := &file_user_service_internal_conf_conf_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -802,7 +747,7 @@ func (x *JWT_Grpc) String() string { func (*JWT_Grpc) ProtoMessage() {} func (x *JWT_Grpc) ProtoReflect() protoreflect.Message { - mi := &file_user_service_internal_conf_conf_proto_msgTypes[12] + mi := &file_user_service_internal_conf_conf_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -815,7 +760,7 @@ func (x *JWT_Grpc) ProtoReflect() protoreflect.Message { // Deprecated: Use JWT_Grpc.ProtoReflect.Descriptor instead. func (*JWT_Grpc) Descriptor() ([]byte, []int) { - return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 1} + return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{3, 1} } func (x *JWT_Grpc) GetTokenKey() string { @@ -825,6 +770,61 @@ func (x *JWT_Grpc) GetTokenKey() string { return "" } +type Registry_Consul struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Scheme string `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` +} + +func (x *Registry_Consul) Reset() { + *x = Registry_Consul{} + if protoimpl.UnsafeEnabled { + mi := &file_user_service_internal_conf_conf_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Registry_Consul) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Registry_Consul) ProtoMessage() {} + +func (x *Registry_Consul) ProtoReflect() protoreflect.Message { + mi := &file_user_service_internal_conf_conf_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 Registry_Consul.ProtoReflect.Descriptor instead. +func (*Registry_Consul) Descriptor() ([]byte, []int) { + return file_user_service_internal_conf_conf_proto_rawDescGZIP(), []int{4, 0} +} + +func (x *Registry_Consul) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +func (x *Registry_Consul) GetScheme() string { + if x != nil { + return x.Scheme + } + return "" +} + var File_user_service_internal_conf_conf_proto protoreflect.FileDescriptor var file_user_service_internal_conf_conf_proto_rawDesc = []byte{ @@ -834,120 +834,118 @@ var file_user_service_internal_conf_conf_proto_rawDesc = []byte{ 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x22, 0xec, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, + 0x6f, 0x74, 0x6f, 0x22, 0xb0, 0x01, 0x0a, 0x09, 0x42, 0x6f, 0x6f, 0x74, 0x73, 0x74, 0x72, 0x61, 0x70, 0x12, 0x3a, 0x0a, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x3a, 0x0a, - 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x52, 0x06, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, - 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, - 0x31, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x52, 0x03, 0x6a, - 0x77, 0x74, 0x22, 0xd8, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x3b, 0x0a, - 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x75, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x34, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, - 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x3b, 0x0a, 0x04, 0x67, 0x72, - 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2e, 0x47, 0x52, 0x50, - 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x69, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, - 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, - 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, - 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, - 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x6d, 0x0a, - 0x06, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x1a, 0x1a, 0x0a, 0x08, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, - 0x74, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x74, 0x6f, 0x22, 0xc2, 0x06, 0x0a, - 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x45, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, - 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, - 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x05, - 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x75, 0x73, - 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, - 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, 0x3c, 0x0a, 0x05, 0x6b, 0x61, - 0x66, 0x6b, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x75, 0x73, 0x65, 0x72, - 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, - 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x4b, 0x61, 0x66, 0x6b, - 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x1a, 0x3a, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, - 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x1a, 0xc5, 0x01, 0x0a, 0x05, 0x52, 0x65, 0x64, 0x69, 0x73, 0x12, 0x0e, - 0x0a, 0x02, 0x64, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x64, 0x62, 0x12, 0x12, - 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, - 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x3c, - 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0xf2, 0x02, 0x0a, - 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x61, - 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0d, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x70, 0x69, - 0x63, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x65, 0x64, 0x5f, 0x74, 0x6f, 0x70, - 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x65, - 0x64, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, - 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x66, 0x6f, - 0x6c, 0x6c, 0x6f, 0x77, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x25, 0x0a, 0x0e, 0x66, 0x6f, 0x6c, - 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x54, 0x6f, 0x70, 0x69, 0x63, - 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x70, 0x69, - 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, - 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x6f, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x31, 0x0a, 0x03, 0x6a, 0x77, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, + 0x54, 0x52, 0x03, 0x6a, 0x77, 0x74, 0x22, 0xd8, 0x02, 0x0a, 0x06, 0x53, 0x65, 0x72, 0x76, 0x65, + 0x72, 0x12, 0x3b, 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, + 0x76, 0x65, 0x72, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x3b, + 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, + 0x2e, 0x47, 0x52, 0x50, 0x43, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x69, 0x0a, 0x04, 0x48, + 0x54, 0x54, 0x50, 0x12, 0x18, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, + 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, + 0x72, 0x12, 0x33, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x1a, 0x69, 0x0a, 0x04, 0x47, 0x52, 0x50, 0x43, 0x12, 0x18, + 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x33, 0x0a, 0x07, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, + 0x74, 0x22, 0xc2, 0x06, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x12, 0x45, 0x0a, 0x08, 0x64, 0x61, + 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x44, + 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0x12, 0x3c, 0x0a, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x52, 0x65, 0x64, 0x69, 0x73, 0x52, 0x05, 0x72, 0x65, 0x64, 0x69, 0x73, 0x12, + 0x3c, 0x0a, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, + 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x44, 0x61, 0x74, 0x61, + 0x2e, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x52, 0x05, 0x6b, 0x61, 0x66, 0x6b, 0x61, 0x1a, 0x3a, 0x0a, + 0x08, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x72, 0x69, + 0x76, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, + 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x1a, 0xc5, 0x01, 0x0a, 0x05, 0x52, 0x65, + 0x64, 0x69, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x64, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x64, 0x62, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, - 0x75, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x75, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, - 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x03, 0x4a, 0x57, 0x54, 0x12, 0x38, 0x0a, 0x04, 0x68, 0x74, 0x74, - 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, - 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x48, 0x74, 0x74, 0x70, 0x52, 0x04, 0x68, - 0x74, 0x74, 0x70, 0x12, 0x38, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, - 0x57, 0x54, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x52, 0x04, 0x67, 0x72, 0x70, 0x63, 0x1a, 0x23, 0x0a, - 0x04, 0x48, 0x74, 0x74, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, - 0x65, 0x79, 0x1a, 0x23, 0x0a, 0x04, 0x47, 0x72, 0x70, 0x63, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, + 0x74, 0x1a, 0xf2, 0x02, 0x0a, 0x05, 0x4b, 0x61, 0x66, 0x6b, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x61, + 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x64, 0x64, 0x72, 0x12, + 0x25, 0x0a, 0x0e, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x70, 0x69, + 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x69, 0x74, + 0x65, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x65, + 0x64, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, + 0x61, 0x76, 0x6f, 0x72, 0x65, 0x64, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x21, 0x0a, 0x0c, 0x66, + 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x25, + 0x0a, 0x0e, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x72, + 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x5f, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x73, 0x68, 0x54, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x0c, 0x72, 0x65, 0x61, 0x64, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x3e, 0x0a, 0x0d, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0xc3, 0x01, 0x0a, 0x03, 0x4a, 0x57, 0x54, 0x12, 0x38, + 0x0a, 0x04, 0x68, 0x74, 0x74, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x75, + 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x48, 0x74, + 0x74, 0x70, 0x52, 0x04, 0x68, 0x74, 0x74, 0x70, 0x12, 0x38, 0x0a, 0x04, 0x67, 0x72, 0x70, 0x63, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x2e, 0x4a, 0x57, 0x54, 0x2e, 0x47, 0x72, 0x70, 0x63, 0x52, 0x04, 0x67, 0x72, + 0x70, 0x63, 0x1a, 0x23, 0x0a, 0x04, 0x48, 0x74, 0x74, 0x70, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6f, 0x6d, 0x61, 0x6e, 0x79, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, 0x75, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x75, - 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, 0x66, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x1a, 0x23, 0x0a, 0x04, 0x47, 0x72, 0x70, 0x63, 0x12, + 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x4b, 0x65, 0x79, 0x22, 0x8b, 0x01, 0x0a, + 0x08, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x12, 0x43, 0x0a, 0x06, 0x63, 0x6f, 0x6e, + 0x73, 0x75, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x75, 0x73, 0x65, 0x72, + 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x79, 0x2e, + 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x1a, 0x3a, + 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x74, 0x6f, 0x6f, 0x6d, 0x61, 0x6e, 0x79, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x61, 0x74, 0x72, 0x65, 0x75, 0x73, 0x2f, 0x61, 0x70, + 0x70, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x3b, 0x63, 0x6f, 0x6e, + 0x66, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -966,43 +964,42 @@ var file_user_service_internal_conf_conf_proto_msgTypes = make([]protoimpl.Messa var file_user_service_internal_conf_conf_proto_goTypes = []interface{}{ (*Bootstrap)(nil), // 0: user.service.internal.conf.Bootstrap (*Server)(nil), // 1: user.service.internal.conf.Server - (*Client)(nil), // 2: user.service.internal.conf.Client - (*Data)(nil), // 3: user.service.internal.conf.Data - (*JWT)(nil), // 4: user.service.internal.conf.JWT + (*Data)(nil), // 2: user.service.internal.conf.Data + (*JWT)(nil), // 3: user.service.internal.conf.JWT + (*Registry)(nil), // 4: user.service.internal.conf.Registry (*Server_HTTP)(nil), // 5: user.service.internal.conf.Server.HTTP (*Server_GRPC)(nil), // 6: user.service.internal.conf.Server.GRPC - (*Client_Relation)(nil), // 7: user.service.internal.conf.Client.Relation - (*Data_Database)(nil), // 8: user.service.internal.conf.Data.Database - (*Data_Redis)(nil), // 9: user.service.internal.conf.Data.Redis - (*Data_Kafka)(nil), // 10: user.service.internal.conf.Data.Kafka - (*JWT_Http)(nil), // 11: user.service.internal.conf.JWT.Http - (*JWT_Grpc)(nil), // 12: user.service.internal.conf.JWT.Grpc + (*Data_Database)(nil), // 7: user.service.internal.conf.Data.Database + (*Data_Redis)(nil), // 8: user.service.internal.conf.Data.Redis + (*Data_Kafka)(nil), // 9: user.service.internal.conf.Data.Kafka + (*JWT_Http)(nil), // 10: user.service.internal.conf.JWT.Http + (*JWT_Grpc)(nil), // 11: user.service.internal.conf.JWT.Grpc + (*Registry_Consul)(nil), // 12: user.service.internal.conf.Registry.Consul (*durationpb.Duration)(nil), // 13: google.protobuf.Duration } var file_user_service_internal_conf_conf_proto_depIdxs = []int32{ 1, // 0: user.service.internal.conf.Bootstrap.server:type_name -> user.service.internal.conf.Server - 2, // 1: user.service.internal.conf.Bootstrap.client:type_name -> user.service.internal.conf.Client - 3, // 2: user.service.internal.conf.Bootstrap.data:type_name -> user.service.internal.conf.Data - 4, // 3: user.service.internal.conf.Bootstrap.jwt:type_name -> user.service.internal.conf.JWT - 5, // 4: user.service.internal.conf.Server.http:type_name -> user.service.internal.conf.Server.HTTP - 6, // 5: user.service.internal.conf.Server.grpc:type_name -> user.service.internal.conf.Server.GRPC - 7, // 6: user.service.internal.conf.Client.relation:type_name -> user.service.internal.conf.Client.Relation - 8, // 7: user.service.internal.conf.Data.database:type_name -> user.service.internal.conf.Data.Database - 9, // 8: user.service.internal.conf.Data.redis:type_name -> user.service.internal.conf.Data.Redis - 10, // 9: user.service.internal.conf.Data.kafka:type_name -> user.service.internal.conf.Data.Kafka - 11, // 10: user.service.internal.conf.JWT.http:type_name -> user.service.internal.conf.JWT.Http - 12, // 11: user.service.internal.conf.JWT.grpc:type_name -> user.service.internal.conf.JWT.Grpc - 13, // 12: user.service.internal.conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration - 13, // 13: user.service.internal.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration - 13, // 14: user.service.internal.conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration - 13, // 15: user.service.internal.conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration - 13, // 16: user.service.internal.conf.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration - 13, // 17: user.service.internal.conf.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration - 18, // [18:18] is the sub-list for method output_type - 18, // [18:18] 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 + 2, // 1: user.service.internal.conf.Bootstrap.data:type_name -> user.service.internal.conf.Data + 3, // 2: user.service.internal.conf.Bootstrap.jwt:type_name -> user.service.internal.conf.JWT + 5, // 3: user.service.internal.conf.Server.http:type_name -> user.service.internal.conf.Server.HTTP + 6, // 4: user.service.internal.conf.Server.grpc:type_name -> user.service.internal.conf.Server.GRPC + 7, // 5: user.service.internal.conf.Data.database:type_name -> user.service.internal.conf.Data.Database + 8, // 6: user.service.internal.conf.Data.redis:type_name -> user.service.internal.conf.Data.Redis + 9, // 7: user.service.internal.conf.Data.kafka:type_name -> user.service.internal.conf.Data.Kafka + 10, // 8: user.service.internal.conf.JWT.http:type_name -> user.service.internal.conf.JWT.Http + 11, // 9: user.service.internal.conf.JWT.grpc:type_name -> user.service.internal.conf.JWT.Grpc + 12, // 10: user.service.internal.conf.Registry.consul:type_name -> user.service.internal.conf.Registry.Consul + 13, // 11: user.service.internal.conf.Server.HTTP.timeout:type_name -> google.protobuf.Duration + 13, // 12: user.service.internal.conf.Server.GRPC.timeout:type_name -> google.protobuf.Duration + 13, // 13: user.service.internal.conf.Data.Redis.read_timeout:type_name -> google.protobuf.Duration + 13, // 14: user.service.internal.conf.Data.Redis.write_timeout:type_name -> google.protobuf.Duration + 13, // 15: user.service.internal.conf.Data.Kafka.read_timeout:type_name -> google.protobuf.Duration + 13, // 16: user.service.internal.conf.Data.Kafka.write_timeout:type_name -> google.protobuf.Duration + 17, // [17:17] is the sub-list for method output_type + 17, // [17:17] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_user_service_internal_conf_conf_proto_init() } @@ -1036,7 +1033,7 @@ func file_user_service_internal_conf_conf_proto_init() { } } file_user_service_internal_conf_conf_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client); i { + switch v := v.(*Data); i { case 0: return &v.state case 1: @@ -1048,7 +1045,7 @@ func file_user_service_internal_conf_conf_proto_init() { } } file_user_service_internal_conf_conf_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data); i { + switch v := v.(*JWT); i { case 0: return &v.state case 1: @@ -1060,7 +1057,7 @@ func file_user_service_internal_conf_conf_proto_init() { } } file_user_service_internal_conf_conf_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT); i { + switch v := v.(*Registry); i { case 0: return &v.state case 1: @@ -1096,7 +1093,7 @@ func file_user_service_internal_conf_conf_proto_init() { } } file_user_service_internal_conf_conf_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Client_Relation); i { + switch v := v.(*Data_Database); i { case 0: return &v.state case 1: @@ -1108,7 +1105,7 @@ func file_user_service_internal_conf_conf_proto_init() { } } file_user_service_internal_conf_conf_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Database); i { + switch v := v.(*Data_Redis); i { case 0: return &v.state case 1: @@ -1120,7 +1117,7 @@ func file_user_service_internal_conf_conf_proto_init() { } } file_user_service_internal_conf_conf_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Redis); i { + switch v := v.(*Data_Kafka); i { case 0: return &v.state case 1: @@ -1132,7 +1129,7 @@ func file_user_service_internal_conf_conf_proto_init() { } } file_user_service_internal_conf_conf_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Data_Kafka); i { + switch v := v.(*JWT_Http); i { case 0: return &v.state case 1: @@ -1144,7 +1141,7 @@ func file_user_service_internal_conf_conf_proto_init() { } } file_user_service_internal_conf_conf_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT_Http); i { + switch v := v.(*JWT_Grpc); i { case 0: return &v.state case 1: @@ -1156,7 +1153,7 @@ func file_user_service_internal_conf_conf_proto_init() { } } file_user_service_internal_conf_conf_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*JWT_Grpc); i { + switch v := v.(*Registry_Consul); i { case 0: return &v.state case 1: diff --git a/app/user/service/internal/conf/conf.proto b/app/user/service/internal/conf/conf.proto index 9cdf710..e6e4010 100644 --- a/app/user/service/internal/conf/conf.proto +++ b/app/user/service/internal/conf/conf.proto @@ -2,15 +2,14 @@ syntax = "proto3"; package user.service.internal.conf; -option go_package = "github.com/toomanysource/atreus/app/user/service/internal/conf;conf"; - import "google/protobuf/duration.proto"; +option go_package = "github.com/toomanysource/atreus/app/user/service/internal/conf;conf"; + message Bootstrap { Server server = 1; - Client client = 2; - Data data = 3; - JWT jwt = 4; + Data data = 2; + JWT jwt = 3; } message Server { @@ -28,13 +27,6 @@ message Server { GRPC grpc = 2; } -message Client { - message Relation { - string to = 1; - } - Relation relation = 1; -} - message Data { message Database { string driver = 1; @@ -72,4 +64,12 @@ message JWT { } Http http = 1; Grpc grpc = 2; -} \ No newline at end of file +} + +message Registry { + message Consul { + string address = 1; + string scheme = 2; + } + Consul consul = 1; +} diff --git a/app/user/service/internal/data/relation.go b/app/user/service/internal/data/relation.go index 7ebbbe5..19c0f0d 100644 --- a/app/user/service/internal/data/relation.go +++ b/app/user/service/internal/data/relation.go @@ -6,7 +6,6 @@ import ( "github.com/toomanysource/atreus/app/user/service/internal/biz" pb "github.com/toomanysource/atreus/api/relation/service/v1" - "github.com/toomanysource/atreus/app/user/service/internal/server" ) type relationRepo struct { @@ -15,9 +14,9 @@ type relationRepo struct { var _ biz.RelationRepo = (*relationRepo)(nil) -func NewRelationRepo(conn server.RelationConn) biz.RelationRepo { +func NewRelationRepo(conn pb.RelationServiceClient) biz.RelationRepo { return &relationRepo{ - client: pb.NewRelationServiceClient(conn), + client: conn, } } diff --git a/app/user/service/internal/server/server.go b/app/user/service/internal/server/server.go index ffddd24..d8527e6 100644 --- a/app/user/service/internal/server/server.go +++ b/app/user/service/internal/server/server.go @@ -6,31 +6,59 @@ import ( "github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/middleware/logging" "github.com/go-kratos/kratos/v2/middleware/recovery" + "github.com/go-kratos/kratos/v2/registry" "github.com/go-kratos/kratos/v2/transport/grpc" "github.com/google/wire" - stdgrpc "google.golang.org/grpc" + "github.com/go-kratos/kratos/contrib/registry/consul/v2" + "github.com/hashicorp/consul/api" + + relationv1 "github.com/toomanysource/atreus/api/relation/service/v1" "github.com/toomanysource/atreus/app/user/service/internal/conf" ) // ProviderSet is server providers. -var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewRelationClient) - -type RelationConn stdgrpc.ClientConnInterface +var ProviderSet = wire.NewSet(NewGRPCServer, NewHTTPServer, NewRelationClient, NewDiscovery, NewRegistrar) // NewRelationClient 创建一个Relation服务客户端,接收Relation服务数据 -func NewRelationClient(c *conf.Client, logger log.Logger) RelationConn { +func NewRelationClient(r registry.Discovery, logger log.Logger) relationv1.RelationServiceClient { + logs := log.NewHelper(log.With(logger, "module", "server/relation")) conn, err := grpc.DialInsecure( context.Background(), - grpc.WithEndpoint(c.Relation.To), + grpc.WithEndpoint("discovery:///atreus.relation.service"), + grpc.WithDiscovery(r), grpc.WithMiddleware( recovery.Recovery(), logging.Client(logger), ), ) if err != nil { - log.Fatalf("Error connecting to Relation Services, err : %v", err) + logs.Fatalf("Relation service connect error, %v", err) + } + logs.Info("user service connect successfully") + return relationv1.NewRelationServiceClient(conn) +} + +func NewDiscovery(conf *conf.Registry) registry.Discovery { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) + } + r := consul.New(cli, consul.WithHealthCheck(false)) + return r +} + +func NewRegistrar(conf *conf.Registry) registry.Registrar { + c := api.DefaultConfig() + c.Address = conf.Consul.Address + c.Scheme = conf.Consul.Scheme + cli, err := api.NewClient(c) + if err != nil { + panic(err) } - log.Info("Relation Services connected.") - return conn + r := consul.New(cli, consul.WithHealthCheck(false)) + return r } diff --git a/configs/service/comment/config.yaml b/configs/service/comment/config.yaml index de72d62..f4ae4fa 100644 --- a/configs/service/comment/config.yaml +++ b/configs/service/comment/config.yaml @@ -5,11 +5,6 @@ server: grpc: addr: 0.0.0.0:9003 timeout: 1s -client: - user: - to: user-service:9001 - publish: - to: publish-service:9002 data: mysql: driver: mysql @@ -31,4 +26,4 @@ jwt: http: token_key: "AtReUs" grpc: - token_key: "ToOMaNySoUrCe" \ No newline at end of file + token_key: "ToOMaNySoUrCe" diff --git a/configs/service/comment/registry.yaml b/configs/service/comment/registry.yaml new file mode 100644 index 0000000..2f394c1 --- /dev/null +++ b/configs/service/comment/registry.yaml @@ -0,0 +1,3 @@ +consul: + address: consul:8500 + scheme: http diff --git a/configs/service/favorite/config.yaml b/configs/service/favorite/config.yaml index 748a697..5bb55d0 100644 --- a/configs/service/favorite/config.yaml +++ b/configs/service/favorite/config.yaml @@ -5,11 +5,6 @@ server: grpc: addr: 0.0.0.0:9004 timeout: 1s -client: - user: - to: user-service:9001 - publish: - to: publish-service:9002 data: mysql: driver: mysql diff --git a/configs/service/favorite/registry.yaml b/configs/service/favorite/registry.yaml new file mode 100644 index 0000000..2f394c1 --- /dev/null +++ b/configs/service/favorite/registry.yaml @@ -0,0 +1,3 @@ +consul: + address: consul:8500 + scheme: http diff --git a/configs/service/message/registry.yaml b/configs/service/message/registry.yaml new file mode 100644 index 0000000..2f394c1 --- /dev/null +++ b/configs/service/message/registry.yaml @@ -0,0 +1,3 @@ +consul: + address: consul:8500 + scheme: http diff --git a/configs/service/publish/config.yaml b/configs/service/publish/config.yaml index 5204d6f..085cebc 100644 --- a/configs/service/publish/config.yaml +++ b/configs/service/publish/config.yaml @@ -5,11 +5,6 @@ server: grpc: addr: 0.0.0.0:9002 timeout: 1s -client: - user: - to: user-service:9001 - favorite: - to: favorite-service:9004 data: mysql: driver: mysql @@ -41,4 +36,4 @@ minio: accessKeyId: "toomanysource" accessSecret: "toomanysource" useSSL: false - bucketName: "oss" \ No newline at end of file + bucketName: "oss" diff --git a/configs/service/publish/registry.yaml b/configs/service/publish/registry.yaml new file mode 100644 index 0000000..2f394c1 --- /dev/null +++ b/configs/service/publish/registry.yaml @@ -0,0 +1,3 @@ +consul: + address: consul:8500 + scheme: http diff --git a/configs/service/relation/config.yaml b/configs/service/relation/config.yaml index 17347f9..9583939 100644 --- a/configs/service/relation/config.yaml +++ b/configs/service/relation/config.yaml @@ -5,9 +5,6 @@ server: grpc: addr: 0.0.0.0:9005 timeout: 1s -client: - user: - to: user-service:9001 data: mysql: driver: mysql @@ -31,4 +28,4 @@ jwt: http: token_key: "AtReUs" grpc: - token_key: "ToOMaNySoUrCe" \ No newline at end of file + token_key: "ToOMaNySoUrCe" diff --git a/configs/service/relation/registry.yaml b/configs/service/relation/registry.yaml new file mode 100644 index 0000000..2f394c1 --- /dev/null +++ b/configs/service/relation/registry.yaml @@ -0,0 +1,3 @@ +consul: + address: consul:8500 + scheme: http diff --git a/configs/service/user/config.yaml b/configs/service/user/config.yaml index 31e687b..425f36a 100644 --- a/configs/service/user/config.yaml +++ b/configs/service/user/config.yaml @@ -5,9 +5,6 @@ server: grpc: addr: 0.0.0.0:9001 timeout: 1s -client: - relation: - to: relation-service:9005 data: database: driver: mysql diff --git a/configs/service/user/registry.yaml b/configs/service/user/registry.yaml new file mode 100644 index 0000000..2f394c1 --- /dev/null +++ b/configs/service/user/registry.yaml @@ -0,0 +1,3 @@ +consul: + address: consul:8500 + scheme: http diff --git a/docker/service/docker-compose.yaml b/docker/service/docker-compose.yaml index d6d2f50..5838021 100644 --- a/docker/service/docker-compose.yaml +++ b/docker/service/docker-compose.yaml @@ -1,5 +1,30 @@ version: "3" services: + consul: + image: consul:1.12.2 + container_name: consul + restart: always + ports: + - "18500:8500" + volumes: + - ../../_data/consul/data:/consul/data:rw + command: "agent -server -ui -bootstrap-expect=1 -client=0.0.0.0" + networks: + - atreus_net + depends_on: + user-service: + condition: service_started + publish-service: + condition: service_started + comment-service: + condition: service_started + favorite-service: + condition: service_started + relation-service: + condition: service_started + message-service: + condition: service_started + nginx: image: nginx:1.24.0 container_name: nginx @@ -12,18 +37,21 @@ services: networks: - atreus_net depends_on: - user-service: - condition: service_started - publish-service: - condition: service_started - comment-service: - condition: service_started - favorite-service: - condition: service_started - relation-service: - condition: service_started - message-service: - condition: service_started + user-service: + condition: service_started + publish-service: + condition: service_started + comment-service: + condition: service_started + favorite-service: + condition: service_started + relation-service: + condition: service_started + message-service: + condition: service_started + consul: + condition: service_started + mysql: image: mysql/mysql-server:8.0.32 container_name: mysql @@ -88,6 +116,7 @@ services: retries: 3 networks: - atreus_net + kafka: image: docker.io/bitnami/kafka:3.5.1 restart: always @@ -110,11 +139,18 @@ services: # broker.id,必须唯一 - KAFKA_BROKER_ID=1 healthcheck: - test: ["CMD", "/opt/bitnami/kafka/bin/kafka-topics.sh", "--list", "--bootstrap-server=localhost:9092"] + test: + [ + "CMD", + "/opt/bitnami/kafka/bin/kafka-topics.sh", + "--list", + "--bootstrap-server=localhost:9092", + ] interval: 5s retries: 3 networks: - atreus_net + user-service: build: context: ../../ diff --git a/go.mod b/go.mod index eb84775..b495191 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/minio/minio-go/v7 v7.0.62 github.com/segmentio/kafka-go v0.4.42 github.com/sirupsen/logrus v1.9.3 - github.com/stretchr/testify v1.8.2 + github.com/stretchr/testify v1.8.3 github.com/u2takey/ffmpeg-go v0.5.0 go.uber.org/automaxprocs v1.5.3 google.golang.org/genproto/googleapis/api v0.0.0-20230815205213-6bfd019c3878 @@ -24,19 +24,37 @@ require ( gorm.io/gorm v1.25.4 ) +require ( + github.com/armon/go-metrics v0.4.1 // indirect + github.com/fatih/color v1.14.1 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-hclog v1.5.0 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect + github.com/hashicorp/go-rootcerts v1.0.2 // indirect + github.com/hashicorp/golang-lru v0.5.4 // indirect + github.com/hashicorp/serf v0.10.1 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect +) + require ( github.com/aws/aws-sdk-go v1.38.20 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-kratos/aegis v0.2.0 // indirect + github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230830131453-6c026bce56a9 github.com/go-playground/form/v4 v4.2.0 // indirect github.com/go-sql-driver/mysql v1.7.0 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/mux v1.8.0 // indirect + github.com/hashicorp/consul/api v1.24.0 github.com/imdario/mergo v0.3.16 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect @@ -44,13 +62,12 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/klauspost/compress v1.16.7 // indirect github.com/klauspost/cpuid/v2 v2.2.5 // indirect - github.com/kr/text v0.2.0 // indirect github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pierrec/lz4/v4 v4.1.15 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rs/xid v1.5.0 // indirect github.com/u2takey/go-utils v0.3.1 // indirect golang.org/x/crypto v0.12.0 // indirect diff --git a/go.sum b/go.sum index 55a8a3f..df0d5ba 100644 --- a/go.sum +++ b/go.sum @@ -1,15 +1,33 @@ +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/antonfisher/nested-logrus-formatter v1.3.1 h1:NFJIr+pzwv5QLHTPyKz9UMEoHck02Q9L0FP13b/xSbQ= github.com/antonfisher/nested-logrus-formatter v1.3.1/go.mod h1:6WTfyWFkBc9+zyBaKIqRrg/KwMqBbodBjgbHjDz7zjA= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aws/aws-sdk-go v1.38.20 h1:QbzNx/tdfATbdKfubBpkt84OM6oBkxQZRw6+bW2GyeA= github.com/aws/aws-sdk-go v1.38.20/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/census-instrumentation/opencensus-proto v0.4.1 h1:iKLQ0xPNFxR/2hzXZMrBo8f1j86j5WHzznCCQxV/b8g= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -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/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c= @@ -19,13 +37,24 @@ github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+m github.com/envoyproxy/go-control-plane v0.11.2-0.20230627204322-7d0032219fcb h1:kxNVXsNro/lpR5WD+P1FI/yUHn2G03Glber3k8cQL2Y= github.com/envoyproxy/protoc-gen-validate v0.10.1 h1:c0g45+xCJhdgFGw7a5QAfdS4byAbud7miNWJ1WwEVf8= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= +github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kratos/aegis v0.2.0 h1:dObzCDWn3XVjUkgxyBp6ZeWtx/do0DPZ7LY3yNSJLUQ= github.com/go-kratos/aegis v0.2.0/go.mod h1:v0R2m73WgEEYB3XYu6aE2WcMwsZkJ/Rzuf5eVccm7bI= +github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230830131453-6c026bce56a9 h1:8+wWo5DjZEafu7LQ9jN/NnequktgNG7ayeJAP09GDNs= +github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230830131453-6c026bce56a9/go.mod h1:+jEH/ufXiyPAsw0Pj+E0cITkXJW27anLV6oZJBNCrYM= github.com/go-kratos/kratos/v2 v2.7.0 h1:9DaVgU9YoHPb/BxDVqeVlVCMduRhiSewG3xE+e9ZAZ8= github.com/go-kratos/kratos/v2 v2.7.0/go.mod h1:CPn82O93OLHjtnbuyOKhAG5TkSvw+mFnL32c4lZFDwU= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -35,13 +64,22 @@ github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +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.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -53,7 +91,43 @@ github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/hashicorp/consul/api v1.24.0 h1:u2XyStA2j0jnCiVUU7Qyrt8idjRn4ORhK6DlvZ3bWhA= +github.com/hashicorp/consul/api v1.24.0/go.mod h1:NZJGRFYruc/80wYowkPFCp1LbGmJC9L8izrwfyVx/Wg= +github.com/hashicorp/consul/sdk v0.14.1 h1:ZiwE2bKb+zro68sWzZ1SgHF3kRMBZ94TwOCFRF4ylPs= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= +github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.5.0 h1:EtYPN8DpAURiapus508I4n9CzHs2W+8NZGbmmR/prTM= +github.com/hashicorp/memberlist v0.5.0/go.mod h1:yvyXLpo0QaGE59Y7hDTsTzDD25JYBZ4mHgHUZ8lrOI0= +github.com/hashicorp/serf v0.10.1 h1:Z1H2J60yRKvfDYAOZLd2MU0ND4AH/WDz7xYHDWQsIPY= +github.com/hashicorp/serf v0.10.1/go.mod h1:yL2t6BqATOLGc5HF7qbFkTfXoPIY0WZdWHfEvMqbG+4= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jinzhu/copier v0.4.0 h1:w3ciUoD19shMCRargcpm0cm91ytaBhDvuRpz1ODO/U8= @@ -66,9 +140,12 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= @@ -77,15 +154,44 @@ github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQs github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +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/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= github.com/minio/minio-go/v7 v7.0.62 h1:qNYsFZHEzl+NfH8UxW4jpmlKav1qUAgfY30YNRneVhc= github.com/minio/minio-go/v7 v7.0.62/go.mod h1:Q6X7Qjb7WMhvG65qKf4gUgA5XaiSox74kR1uAEjxRS4= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -93,36 +199,65 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/panjf2000/ants/v2 v2.4.2/go.mod h1:f6F0NZVFsGCp5A7QW/Zj/m92atWwOkY0OIhFxRNFr4A= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -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/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/segmentio/kafka-go v0.4.42 h1:qffhBZCz4WcWyNuHEclHjIMLs2slp6mZO8px+5W5tfU= github.com/segmentio/kafka-go v0.4.42/go.mod h1:d0g15xPMqoUookug0OU75DhGZxXwCFxSLeJ4uphwJzg= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= 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/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 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.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/u2takey/ffmpeg-go v0.5.0 h1:r7d86XuL7uLWJ5mzSeQ03uvjfIhiJYvsRAJFCW4uklU= github.com/u2takey/ffmpeg-go v0.5.0/go.mod h1:ruZWkvC1FEiUNjmROowOAps3ZcWxEiOpFoHCvk97kGc= github.com/u2takey/go-utils v0.3.1 h1:TaQTgmEZZeDHQFYfd+AdUT1cT4QJgJn/XVPELhHw4ys= @@ -137,36 +272,66 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= gocv.io/x/gocv v0.25.0/go.mod h1:Rar2PS6DV+T4FL+PM535EImD/h13hGVaHhnCu1xarBs= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 h1:hVwzHzIUGRjiF7EcUjqNxk3NCfkPxbDKRdnNE1Rpg0U= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/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-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +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-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/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-20190222072716-a9d3bda3a223/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-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/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-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= @@ -177,6 +342,7 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 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/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= @@ -186,6 +352,7 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -202,12 +369,17 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=