perm_grpc.pb.go 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.6.1
  4. // - protoc v7.34.1
  5. // source: pb/perm.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.64.0 or later.
  16. const _ = grpc.SupportPackageIsVersion9
  17. const (
  18. PermService_SyncPermissions_FullMethodName = "/pb.PermService/SyncPermissions"
  19. PermService_Login_FullMethodName = "/pb.PermService/Login"
  20. PermService_RefreshToken_FullMethodName = "/pb.PermService/RefreshToken"
  21. PermService_VerifyToken_FullMethodName = "/pb.PermService/VerifyToken"
  22. PermService_GetUserPerms_FullMethodName = "/pb.PermService/GetUserPerms"
  23. PermService_Logout_FullMethodName = "/pb.PermService/Logout"
  24. )
  25. // PermServiceClient is the client API for PermService service.
  26. //
  27. // 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.
  28. type PermServiceClient interface {
  29. SyncPermissions(ctx context.Context, in *SyncPermissionsReq, opts ...grpc.CallOption) (*SyncPermissionsResp, error)
  30. Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error)
  31. RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc.CallOption) (*RefreshTokenResp, error)
  32. VerifyToken(ctx context.Context, in *VerifyTokenReq, opts ...grpc.CallOption) (*VerifyTokenResp, error)
  33. GetUserPerms(ctx context.Context, in *GetUserPermsReq, opts ...grpc.CallOption) (*GetUserPermsResp, error)
  34. Logout(ctx context.Context, in *LogoutReq, opts ...grpc.CallOption) (*LogoutResp, error)
  35. }
  36. type permServiceClient struct {
  37. cc grpc.ClientConnInterface
  38. }
  39. func NewPermServiceClient(cc grpc.ClientConnInterface) PermServiceClient {
  40. return &permServiceClient{cc}
  41. }
  42. func (c *permServiceClient) SyncPermissions(ctx context.Context, in *SyncPermissionsReq, opts ...grpc.CallOption) (*SyncPermissionsResp, error) {
  43. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  44. out := new(SyncPermissionsResp)
  45. err := c.cc.Invoke(ctx, PermService_SyncPermissions_FullMethodName, in, out, cOpts...)
  46. if err != nil {
  47. return nil, err
  48. }
  49. return out, nil
  50. }
  51. func (c *permServiceClient) Login(ctx context.Context, in *LoginReq, opts ...grpc.CallOption) (*LoginResp, error) {
  52. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  53. out := new(LoginResp)
  54. err := c.cc.Invoke(ctx, PermService_Login_FullMethodName, in, out, cOpts...)
  55. if err != nil {
  56. return nil, err
  57. }
  58. return out, nil
  59. }
  60. func (c *permServiceClient) RefreshToken(ctx context.Context, in *RefreshTokenReq, opts ...grpc.CallOption) (*RefreshTokenResp, error) {
  61. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  62. out := new(RefreshTokenResp)
  63. err := c.cc.Invoke(ctx, PermService_RefreshToken_FullMethodName, in, out, cOpts...)
  64. if err != nil {
  65. return nil, err
  66. }
  67. return out, nil
  68. }
  69. func (c *permServiceClient) VerifyToken(ctx context.Context, in *VerifyTokenReq, opts ...grpc.CallOption) (*VerifyTokenResp, error) {
  70. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  71. out := new(VerifyTokenResp)
  72. err := c.cc.Invoke(ctx, PermService_VerifyToken_FullMethodName, in, out, cOpts...)
  73. if err != nil {
  74. return nil, err
  75. }
  76. return out, nil
  77. }
  78. func (c *permServiceClient) GetUserPerms(ctx context.Context, in *GetUserPermsReq, opts ...grpc.CallOption) (*GetUserPermsResp, error) {
  79. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  80. out := new(GetUserPermsResp)
  81. err := c.cc.Invoke(ctx, PermService_GetUserPerms_FullMethodName, in, out, cOpts...)
  82. if err != nil {
  83. return nil, err
  84. }
  85. return out, nil
  86. }
  87. func (c *permServiceClient) Logout(ctx context.Context, in *LogoutReq, opts ...grpc.CallOption) (*LogoutResp, error) {
  88. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  89. out := new(LogoutResp)
  90. err := c.cc.Invoke(ctx, PermService_Logout_FullMethodName, in, out, cOpts...)
  91. if err != nil {
  92. return nil, err
  93. }
  94. return out, nil
  95. }
  96. // PermServiceServer is the server API for PermService service.
  97. // All implementations must embed UnimplementedPermServiceServer
  98. // for forward compatibility.
  99. type PermServiceServer interface {
  100. SyncPermissions(context.Context, *SyncPermissionsReq) (*SyncPermissionsResp, error)
  101. Login(context.Context, *LoginReq) (*LoginResp, error)
  102. RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error)
  103. VerifyToken(context.Context, *VerifyTokenReq) (*VerifyTokenResp, error)
  104. GetUserPerms(context.Context, *GetUserPermsReq) (*GetUserPermsResp, error)
  105. Logout(context.Context, *LogoutReq) (*LogoutResp, error)
  106. mustEmbedUnimplementedPermServiceServer()
  107. }
  108. // UnimplementedPermServiceServer must be embedded to have
  109. // forward compatible implementations.
  110. //
  111. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  112. // pointer dereference when methods are called.
  113. type UnimplementedPermServiceServer struct{}
  114. func (UnimplementedPermServiceServer) SyncPermissions(context.Context, *SyncPermissionsReq) (*SyncPermissionsResp, error) {
  115. return nil, status.Error(codes.Unimplemented, "method SyncPermissions not implemented")
  116. }
  117. func (UnimplementedPermServiceServer) Login(context.Context, *LoginReq) (*LoginResp, error) {
  118. return nil, status.Error(codes.Unimplemented, "method Login not implemented")
  119. }
  120. func (UnimplementedPermServiceServer) RefreshToken(context.Context, *RefreshTokenReq) (*RefreshTokenResp, error) {
  121. return nil, status.Error(codes.Unimplemented, "method RefreshToken not implemented")
  122. }
  123. func (UnimplementedPermServiceServer) VerifyToken(context.Context, *VerifyTokenReq) (*VerifyTokenResp, error) {
  124. return nil, status.Error(codes.Unimplemented, "method VerifyToken not implemented")
  125. }
  126. func (UnimplementedPermServiceServer) GetUserPerms(context.Context, *GetUserPermsReq) (*GetUserPermsResp, error) {
  127. return nil, status.Error(codes.Unimplemented, "method GetUserPerms not implemented")
  128. }
  129. func (UnimplementedPermServiceServer) Logout(context.Context, *LogoutReq) (*LogoutResp, error) {
  130. return nil, status.Error(codes.Unimplemented, "method Logout not implemented")
  131. }
  132. func (UnimplementedPermServiceServer) mustEmbedUnimplementedPermServiceServer() {}
  133. func (UnimplementedPermServiceServer) testEmbeddedByValue() {}
  134. // UnsafePermServiceServer may be embedded to opt out of forward compatibility for this service.
  135. // Use of this interface is not recommended, as added methods to PermServiceServer will
  136. // result in compilation errors.
  137. type UnsafePermServiceServer interface {
  138. mustEmbedUnimplementedPermServiceServer()
  139. }
  140. func RegisterPermServiceServer(s grpc.ServiceRegistrar, srv PermServiceServer) {
  141. // If the following call panics, it indicates UnimplementedPermServiceServer was
  142. // embedded by pointer and is nil. This will cause panics if an
  143. // unimplemented method is ever invoked, so we test this at initialization
  144. // time to prevent it from happening at runtime later due to I/O.
  145. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  146. t.testEmbeddedByValue()
  147. }
  148. s.RegisterService(&PermService_ServiceDesc, srv)
  149. }
  150. func _PermService_SyncPermissions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  151. in := new(SyncPermissionsReq)
  152. if err := dec(in); err != nil {
  153. return nil, err
  154. }
  155. if interceptor == nil {
  156. return srv.(PermServiceServer).SyncPermissions(ctx, in)
  157. }
  158. info := &grpc.UnaryServerInfo{
  159. Server: srv,
  160. FullMethod: PermService_SyncPermissions_FullMethodName,
  161. }
  162. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  163. return srv.(PermServiceServer).SyncPermissions(ctx, req.(*SyncPermissionsReq))
  164. }
  165. return interceptor(ctx, in, info, handler)
  166. }
  167. func _PermService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  168. in := new(LoginReq)
  169. if err := dec(in); err != nil {
  170. return nil, err
  171. }
  172. if interceptor == nil {
  173. return srv.(PermServiceServer).Login(ctx, in)
  174. }
  175. info := &grpc.UnaryServerInfo{
  176. Server: srv,
  177. FullMethod: PermService_Login_FullMethodName,
  178. }
  179. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  180. return srv.(PermServiceServer).Login(ctx, req.(*LoginReq))
  181. }
  182. return interceptor(ctx, in, info, handler)
  183. }
  184. func _PermService_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  185. in := new(RefreshTokenReq)
  186. if err := dec(in); err != nil {
  187. return nil, err
  188. }
  189. if interceptor == nil {
  190. return srv.(PermServiceServer).RefreshToken(ctx, in)
  191. }
  192. info := &grpc.UnaryServerInfo{
  193. Server: srv,
  194. FullMethod: PermService_RefreshToken_FullMethodName,
  195. }
  196. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  197. return srv.(PermServiceServer).RefreshToken(ctx, req.(*RefreshTokenReq))
  198. }
  199. return interceptor(ctx, in, info, handler)
  200. }
  201. func _PermService_VerifyToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  202. in := new(VerifyTokenReq)
  203. if err := dec(in); err != nil {
  204. return nil, err
  205. }
  206. if interceptor == nil {
  207. return srv.(PermServiceServer).VerifyToken(ctx, in)
  208. }
  209. info := &grpc.UnaryServerInfo{
  210. Server: srv,
  211. FullMethod: PermService_VerifyToken_FullMethodName,
  212. }
  213. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  214. return srv.(PermServiceServer).VerifyToken(ctx, req.(*VerifyTokenReq))
  215. }
  216. return interceptor(ctx, in, info, handler)
  217. }
  218. func _PermService_GetUserPerms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  219. in := new(GetUserPermsReq)
  220. if err := dec(in); err != nil {
  221. return nil, err
  222. }
  223. if interceptor == nil {
  224. return srv.(PermServiceServer).GetUserPerms(ctx, in)
  225. }
  226. info := &grpc.UnaryServerInfo{
  227. Server: srv,
  228. FullMethod: PermService_GetUserPerms_FullMethodName,
  229. }
  230. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  231. return srv.(PermServiceServer).GetUserPerms(ctx, req.(*GetUserPermsReq))
  232. }
  233. return interceptor(ctx, in, info, handler)
  234. }
  235. func _PermService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  236. in := new(LogoutReq)
  237. if err := dec(in); err != nil {
  238. return nil, err
  239. }
  240. if interceptor == nil {
  241. return srv.(PermServiceServer).Logout(ctx, in)
  242. }
  243. info := &grpc.UnaryServerInfo{
  244. Server: srv,
  245. FullMethod: PermService_Logout_FullMethodName,
  246. }
  247. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  248. return srv.(PermServiceServer).Logout(ctx, req.(*LogoutReq))
  249. }
  250. return interceptor(ctx, in, info, handler)
  251. }
  252. // PermService_ServiceDesc is the grpc.ServiceDesc for PermService service.
  253. // It's only intended for direct use with grpc.RegisterService,
  254. // and not to be introspected or modified (even as a copy)
  255. var PermService_ServiceDesc = grpc.ServiceDesc{
  256. ServiceName: "pb.PermService",
  257. HandlerType: (*PermServiceServer)(nil),
  258. Methods: []grpc.MethodDesc{
  259. {
  260. MethodName: "SyncPermissions",
  261. Handler: _PermService_SyncPermissions_Handler,
  262. },
  263. {
  264. MethodName: "Login",
  265. Handler: _PermService_Login_Handler,
  266. },
  267. {
  268. MethodName: "RefreshToken",
  269. Handler: _PermService_RefreshToken_Handler,
  270. },
  271. {
  272. MethodName: "VerifyToken",
  273. Handler: _PermService_VerifyToken_Handler,
  274. },
  275. {
  276. MethodName: "GetUserPerms",
  277. Handler: _PermService_GetUserPerms_Handler,
  278. },
  279. {
  280. MethodName: "Logout",
  281. Handler: _PermService_Logout_Handler,
  282. },
  283. },
  284. Streams: []grpc.StreamDesc{},
  285. Metadata: "pb/perm.proto",
  286. }