auth_grpc.pb.go 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.2.0
  4. // - protoc v3.19.4
  5. // source: pb/auth.proto
  6. package pb
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. )
  13. // This is a compile-time assertion to ensure that this generated file
  14. // is compatible with the grpc package it is being compiled against.
  15. // Requires gRPC-Go v1.32.0 or later.
  16. const _ = grpc.SupportPackageIsVersion7
  17. // AuthClient is the client API for Auth service.
  18. //
  19. // 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.
  20. type AuthClient interface {
  21. PlayerAuth(ctx context.Context, in *PlayerAuthReq, opts ...grpc.CallOption) (*AuthResp, error)
  22. CsAuth(ctx context.Context, in *CsAuthReq, opts ...grpc.CallOption) (*AuthResp, error)
  23. CheckAuth(ctx context.Context, in *CheckAuthReq, opts ...grpc.CallOption) (*CheckAuthResp, error)
  24. }
  25. type authClient struct {
  26. cc grpc.ClientConnInterface
  27. }
  28. func NewAuthClient(cc grpc.ClientConnInterface) AuthClient {
  29. return &authClient{cc}
  30. }
  31. func (c *authClient) PlayerAuth(ctx context.Context, in *PlayerAuthReq, opts ...grpc.CallOption) (*AuthResp, error) {
  32. out := new(AuthResp)
  33. err := c.cc.Invoke(ctx, "/pb.Auth/playerAuth", in, out, opts...)
  34. if err != nil {
  35. return nil, err
  36. }
  37. return out, nil
  38. }
  39. func (c *authClient) CsAuth(ctx context.Context, in *CsAuthReq, opts ...grpc.CallOption) (*AuthResp, error) {
  40. out := new(AuthResp)
  41. err := c.cc.Invoke(ctx, "/pb.Auth/csAuth", in, out, opts...)
  42. if err != nil {
  43. return nil, err
  44. }
  45. return out, nil
  46. }
  47. func (c *authClient) CheckAuth(ctx context.Context, in *CheckAuthReq, opts ...grpc.CallOption) (*CheckAuthResp, error) {
  48. out := new(CheckAuthResp)
  49. err := c.cc.Invoke(ctx, "/pb.Auth/checkAuth", in, out, opts...)
  50. if err != nil {
  51. return nil, err
  52. }
  53. return out, nil
  54. }
  55. // AuthServer is the server API for Auth service.
  56. // All implementations must embed UnimplementedAuthServer
  57. // for forward compatibility
  58. type AuthServer interface {
  59. PlayerAuth(context.Context, *PlayerAuthReq) (*AuthResp, error)
  60. CsAuth(context.Context, *CsAuthReq) (*AuthResp, error)
  61. CheckAuth(context.Context, *CheckAuthReq) (*CheckAuthResp, error)
  62. mustEmbedUnimplementedAuthServer()
  63. }
  64. // UnimplementedAuthServer must be embedded to have forward compatible implementations.
  65. type UnimplementedAuthServer struct {
  66. }
  67. func (UnimplementedAuthServer) PlayerAuth(context.Context, *PlayerAuthReq) (*AuthResp, error) {
  68. return nil, status.Errorf(codes.Unimplemented, "method PlayerAuth not implemented")
  69. }
  70. func (UnimplementedAuthServer) CsAuth(context.Context, *CsAuthReq) (*AuthResp, error) {
  71. return nil, status.Errorf(codes.Unimplemented, "method CsAuth not implemented")
  72. }
  73. func (UnimplementedAuthServer) CheckAuth(context.Context, *CheckAuthReq) (*CheckAuthResp, error) {
  74. return nil, status.Errorf(codes.Unimplemented, "method CheckAuth not implemented")
  75. }
  76. func (UnimplementedAuthServer) mustEmbedUnimplementedAuthServer() {}
  77. // UnsafeAuthServer may be embedded to opt out of forward compatibility for this service.
  78. // Use of this interface is not recommended, as added methods to AuthServer will
  79. // result in compilation errors.
  80. type UnsafeAuthServer interface {
  81. mustEmbedUnimplementedAuthServer()
  82. }
  83. func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer) {
  84. s.RegisterService(&Auth_ServiceDesc, srv)
  85. }
  86. func _Auth_PlayerAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  87. in := new(PlayerAuthReq)
  88. if err := dec(in); err != nil {
  89. return nil, err
  90. }
  91. if interceptor == nil {
  92. return srv.(AuthServer).PlayerAuth(ctx, in)
  93. }
  94. info := &grpc.UnaryServerInfo{
  95. Server: srv,
  96. FullMethod: "/pb.Auth/playerAuth",
  97. }
  98. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  99. return srv.(AuthServer).PlayerAuth(ctx, req.(*PlayerAuthReq))
  100. }
  101. return interceptor(ctx, in, info, handler)
  102. }
  103. func _Auth_CsAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  104. in := new(CsAuthReq)
  105. if err := dec(in); err != nil {
  106. return nil, err
  107. }
  108. if interceptor == nil {
  109. return srv.(AuthServer).CsAuth(ctx, in)
  110. }
  111. info := &grpc.UnaryServerInfo{
  112. Server: srv,
  113. FullMethod: "/pb.Auth/csAuth",
  114. }
  115. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  116. return srv.(AuthServer).CsAuth(ctx, req.(*CsAuthReq))
  117. }
  118. return interceptor(ctx, in, info, handler)
  119. }
  120. func _Auth_CheckAuth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  121. in := new(CheckAuthReq)
  122. if err := dec(in); err != nil {
  123. return nil, err
  124. }
  125. if interceptor == nil {
  126. return srv.(AuthServer).CheckAuth(ctx, in)
  127. }
  128. info := &grpc.UnaryServerInfo{
  129. Server: srv,
  130. FullMethod: "/pb.Auth/checkAuth",
  131. }
  132. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  133. return srv.(AuthServer).CheckAuth(ctx, req.(*CheckAuthReq))
  134. }
  135. return interceptor(ctx, in, info, handler)
  136. }
  137. // Auth_ServiceDesc is the grpc.ServiceDesc for Auth service.
  138. // It's only intended for direct use with grpc.RegisterService,
  139. // and not to be introspected or modified (even as a copy)
  140. var Auth_ServiceDesc = grpc.ServiceDesc{
  141. ServiceName: "pb.Auth",
  142. HandlerType: (*AuthServer)(nil),
  143. Methods: []grpc.MethodDesc{
  144. {
  145. MethodName: "playerAuth",
  146. Handler: _Auth_PlayerAuth_Handler,
  147. },
  148. {
  149. MethodName: "csAuth",
  150. Handler: _Auth_CsAuth_Handler,
  151. },
  152. {
  153. MethodName: "checkAuth",
  154. Handler: _Auth_CheckAuth_Handler,
  155. },
  156. },
  157. Streams: []grpc.StreamDesc{},
  158. Metadata: "pb/auth.proto",
  159. }