From aa1dc0d85a4ed774b3727d3dc80f926de07abea4 Mon Sep 17 00:00:00 2001 From: slaventius Date: Sat, 4 Feb 2023 12:30:39 +0300 Subject: [PATCH] * --- api/proto/auth.proto | 7 ++-- pkg/api/auth.pb.go | 90 ++++++++++++++++++++--------------------- pkg/api/auth_grpc.pb.go | 14 +++---- 3 files changed, 54 insertions(+), 57 deletions(-) diff --git a/api/proto/auth.proto b/api/proto/auth.proto index 4b245e9..a403d66 100644 --- a/api/proto/auth.proto +++ b/api/proto/auth.proto @@ -1,5 +1,4 @@ syntax="proto3"; -package auth; option go_package = "./"; // go install google.golang.org/protobuf/cmd/protoc-gen-go@latest @@ -40,7 +39,7 @@ message ConfirmationResponse { // ... service AuthDB { - rpc Login(LoginRequest) returns (LoginResponse){} - rpc Registration(RegistrationRequest) returns(RegistrationResponse){} - rpc Confirmation(ConfirmationRequest) returns(ConfirmationResponse){} + rpc Login(LoginRequest) returns (LoginResponse); + rpc Registration(RegistrationRequest) returns(RegistrationResponse); + rpc Confirmation(ConfirmationRequest) returns(ConfirmationResponse); } \ No newline at end of file diff --git a/pkg/api/auth.pb.go b/pkg/api/auth.pb.go index 466638f..cd337cb 100644 --- a/pkg/api/auth.pb.go +++ b/pkg/api/auth.pb.go @@ -332,41 +332,39 @@ func (x *ConfirmationResponse) GetID() int32 { var File_auth_proto protoreflect.FileDescriptor var file_auth_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x61, 0x75, - 0x74, 0x68, 0x22, 0x40, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x22, 0x1f, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x02, 0x49, 0x44, 0x22, 0x41, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x0a, 0x0a, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x40, 0x0a, 0x0c, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x40, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, - 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x29, 0x0a, 0x13, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x26, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x44, 0x32, 0xce, 0x01, - 0x0a, 0x06, 0x41, 0x75, 0x74, 0x68, 0x44, 0x42, 0x12, 0x32, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x12, 0x12, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0c, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x61, - 0x75, 0x74, 0x68, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x43, 0x6f, 0x6e, - 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1a, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x04, - 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x1f, + 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x44, 0x22, + 0x41, 0x0a, 0x13, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, 0x6d, 0x61, + 0x69, 0x6c, 0x22, 0x40, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x45, + 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x29, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x43, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x22, + 0x26, 0x0a, 0x14, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x44, 0x32, 0xaa, 0x01, 0x0a, 0x06, 0x41, 0x75, 0x74, 0x68, + 0x44, 0x42, 0x12, 0x26, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x0d, 0x2e, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x15, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, + 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x04, 0x5a, 0x02, 0x2e, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -383,20 +381,20 @@ func file_auth_proto_rawDescGZIP() []byte { var file_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_auth_proto_goTypes = []interface{}{ - (*LoginRequest)(nil), // 0: auth.LoginRequest - (*LoginResponse)(nil), // 1: auth.LoginResponse - (*RegistrationRequest)(nil), // 2: auth.RegistrationRequest - (*RegistrationResponse)(nil), // 3: auth.RegistrationResponse - (*ConfirmationRequest)(nil), // 4: auth.ConfirmationRequest - (*ConfirmationResponse)(nil), // 5: auth.ConfirmationResponse + (*LoginRequest)(nil), // 0: LoginRequest + (*LoginResponse)(nil), // 1: LoginResponse + (*RegistrationRequest)(nil), // 2: RegistrationRequest + (*RegistrationResponse)(nil), // 3: RegistrationResponse + (*ConfirmationRequest)(nil), // 4: ConfirmationRequest + (*ConfirmationResponse)(nil), // 5: ConfirmationResponse } var file_auth_proto_depIdxs = []int32{ - 0, // 0: auth.AuthDB.Login:input_type -> auth.LoginRequest - 2, // 1: auth.AuthDB.Registration:input_type -> auth.RegistrationRequest - 4, // 2: auth.AuthDB.Confirmation:input_type -> auth.ConfirmationRequest - 1, // 3: auth.AuthDB.Login:output_type -> auth.LoginResponse - 3, // 4: auth.AuthDB.Registration:output_type -> auth.RegistrationResponse - 5, // 5: auth.AuthDB.Confirmation:output_type -> auth.ConfirmationResponse + 0, // 0: AuthDB.Login:input_type -> LoginRequest + 2, // 1: AuthDB.Registration:input_type -> RegistrationRequest + 4, // 2: AuthDB.Confirmation:input_type -> ConfirmationRequest + 1, // 3: AuthDB.Login:output_type -> LoginResponse + 3, // 4: AuthDB.Registration:output_type -> RegistrationResponse + 5, // 5: AuthDB.Confirmation:output_type -> ConfirmationResponse 3, // [3:6] is the sub-list for method output_type 0, // [0:3] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name diff --git a/pkg/api/auth_grpc.pb.go b/pkg/api/auth_grpc.pb.go index 672adc5..9f1a8d0 100644 --- a/pkg/api/auth_grpc.pb.go +++ b/pkg/api/auth_grpc.pb.go @@ -37,7 +37,7 @@ func NewAuthDBClient(cc grpc.ClientConnInterface) AuthDBClient { func (c *authDBClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) { out := new(LoginResponse) - err := c.cc.Invoke(ctx, "/auth.AuthDB/Login", in, out, opts...) + err := c.cc.Invoke(ctx, "/AuthDB/Login", in, out, opts...) if err != nil { return nil, err } @@ -46,7 +46,7 @@ func (c *authDBClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc func (c *authDBClient) Registration(ctx context.Context, in *RegistrationRequest, opts ...grpc.CallOption) (*RegistrationResponse, error) { out := new(RegistrationResponse) - err := c.cc.Invoke(ctx, "/auth.AuthDB/Registration", in, out, opts...) + err := c.cc.Invoke(ctx, "/AuthDB/Registration", in, out, opts...) if err != nil { return nil, err } @@ -55,7 +55,7 @@ func (c *authDBClient) Registration(ctx context.Context, in *RegistrationRequest func (c *authDBClient) Confirmation(ctx context.Context, in *ConfirmationRequest, opts ...grpc.CallOption) (*ConfirmationResponse, error) { out := new(ConfirmationResponse) - err := c.cc.Invoke(ctx, "/auth.AuthDB/Confirmation", in, out, opts...) + err := c.cc.Invoke(ctx, "/AuthDB/Confirmation", in, out, opts...) if err != nil { return nil, err } @@ -108,7 +108,7 @@ func _AuthDB_Login_Handler(srv interface{}, ctx context.Context, dec func(interf } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/auth.AuthDB/Login", + FullMethod: "/AuthDB/Login", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthDBServer).Login(ctx, req.(*LoginRequest)) @@ -126,7 +126,7 @@ func _AuthDB_Registration_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/auth.AuthDB/Registration", + FullMethod: "/AuthDB/Registration", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthDBServer).Registration(ctx, req.(*RegistrationRequest)) @@ -144,7 +144,7 @@ func _AuthDB_Confirmation_Handler(srv interface{}, ctx context.Context, dec func } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/auth.AuthDB/Confirmation", + FullMethod: "/AuthDB/Confirmation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AuthDBServer).Confirmation(ctx, req.(*ConfirmationRequest)) @@ -156,7 +156,7 @@ func _AuthDB_Confirmation_Handler(srv interface{}, ctx context.Context, dec func // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var AuthDB_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "auth.AuthDB", + ServiceName: "AuthDB", HandlerType: (*AuthDBServer)(nil), Methods: []grpc.MethodDesc{ {