contract update
This commit is contained in:
parent
ecdc68eda2
commit
7cef9cbe8d
3 changed files with 192 additions and 8 deletions
|
|
@ -19,7 +19,8 @@ import (
|
|||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
AuthService_VerifyToken_FullMethodName = "/verifyAuth.v1.AuthService/VerifyToken"
|
||||
AuthService_VerifyToken_FullMethodName = "/verifyAuth.v1.AuthService/VerifyToken"
|
||||
AuthService_GetPersonalInfo_FullMethodName = "/verifyAuth.v1.AuthService/GetPersonalInfo"
|
||||
)
|
||||
|
||||
// AuthServiceClient is the client API for AuthService service.
|
||||
|
|
@ -27,6 +28,7 @@ const (
|
|||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type AuthServiceClient interface {
|
||||
VerifyToken(ctx context.Context, in *VerifyTokenRequest, opts ...grpc.CallOption) (*VerifyTokenResponse, error)
|
||||
GetPersonalInfo(ctx context.Context, in *PersonalRequest, opts ...grpc.CallOption) (*PersonalResponse, error)
|
||||
}
|
||||
|
||||
type authServiceClient struct {
|
||||
|
|
@ -47,11 +49,22 @@ func (c *authServiceClient) VerifyToken(ctx context.Context, in *VerifyTokenRequ
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *authServiceClient) GetPersonalInfo(ctx context.Context, in *PersonalRequest, opts ...grpc.CallOption) (*PersonalResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PersonalResponse)
|
||||
err := c.cc.Invoke(ctx, AuthService_GetPersonalInfo_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AuthServiceServer is the server API for AuthService service.
|
||||
// All implementations must embed UnimplementedAuthServiceServer
|
||||
// for forward compatibility.
|
||||
type AuthServiceServer interface {
|
||||
VerifyToken(context.Context, *VerifyTokenRequest) (*VerifyTokenResponse, error)
|
||||
GetPersonalInfo(context.Context, *PersonalRequest) (*PersonalResponse, error)
|
||||
mustEmbedUnimplementedAuthServiceServer()
|
||||
}
|
||||
|
||||
|
|
@ -65,6 +78,9 @@ type UnimplementedAuthServiceServer struct{}
|
|||
func (UnimplementedAuthServiceServer) VerifyToken(context.Context, *VerifyTokenRequest) (*VerifyTokenResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method VerifyToken not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) GetPersonalInfo(context.Context, *PersonalRequest) (*PersonalResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPersonalInfo not implemented")
|
||||
}
|
||||
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
||||
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
|
|
@ -104,6 +120,24 @@ func _AuthService_VerifyToken_Handler(srv interface{}, ctx context.Context, dec
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _AuthService_GetPersonalInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PersonalRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuthServiceServer).GetPersonalInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuthService_GetPersonalInfo_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuthServiceServer).GetPersonalInfo(ctx, req.(*PersonalRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
|
|
@ -115,6 +149,10 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "VerifyToken",
|
||||
Handler: _AuthService_VerifyToken_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPersonalInfo",
|
||||
Handler: _AuthService_GetPersonalInfo_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "proto/verify.proto",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue