webhook_service_grpc.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
  2. // versions:
  3. // - protoc-gen-go-grpc v1.5.1
  4. // - protoc (unknown)
  5. // source: api/v1/webhook_service.proto
  6. package apiv1
  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. emptypb "google.golang.org/protobuf/types/known/emptypb"
  13. )
  14. // This is a compile-time assertion to ensure that this generated file
  15. // is compatible with the grpc package it is being compiled against.
  16. // Requires gRPC-Go v1.64.0 or later.
  17. const _ = grpc.SupportPackageIsVersion9
  18. const (
  19. WebhookService_CreateWebhook_FullMethodName = "/memos.api.v1.WebhookService/CreateWebhook"
  20. WebhookService_GetWebhook_FullMethodName = "/memos.api.v1.WebhookService/GetWebhook"
  21. WebhookService_ListWebhooks_FullMethodName = "/memos.api.v1.WebhookService/ListWebhooks"
  22. WebhookService_UpdateWebhook_FullMethodName = "/memos.api.v1.WebhookService/UpdateWebhook"
  23. WebhookService_DeleteWebhook_FullMethodName = "/memos.api.v1.WebhookService/DeleteWebhook"
  24. )
  25. // WebhookServiceClient is the client API for WebhookService 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 WebhookServiceClient interface {
  29. // CreateWebhook creates a new webhook.
  30. CreateWebhook(ctx context.Context, in *CreateWebhookRequest, opts ...grpc.CallOption) (*Webhook, error)
  31. // GetWebhook returns a webhook by id.
  32. GetWebhook(ctx context.Context, in *GetWebhookRequest, opts ...grpc.CallOption) (*Webhook, error)
  33. // ListWebhooks returns a list of webhooks.
  34. ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error)
  35. // UpdateWebhook updates a webhook.
  36. UpdateWebhook(ctx context.Context, in *UpdateWebhookRequest, opts ...grpc.CallOption) (*Webhook, error)
  37. // DeleteWebhook deletes a webhook by id.
  38. DeleteWebhook(ctx context.Context, in *DeleteWebhookRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
  39. }
  40. type webhookServiceClient struct {
  41. cc grpc.ClientConnInterface
  42. }
  43. func NewWebhookServiceClient(cc grpc.ClientConnInterface) WebhookServiceClient {
  44. return &webhookServiceClient{cc}
  45. }
  46. func (c *webhookServiceClient) CreateWebhook(ctx context.Context, in *CreateWebhookRequest, opts ...grpc.CallOption) (*Webhook, error) {
  47. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  48. out := new(Webhook)
  49. err := c.cc.Invoke(ctx, WebhookService_CreateWebhook_FullMethodName, in, out, cOpts...)
  50. if err != nil {
  51. return nil, err
  52. }
  53. return out, nil
  54. }
  55. func (c *webhookServiceClient) GetWebhook(ctx context.Context, in *GetWebhookRequest, opts ...grpc.CallOption) (*Webhook, error) {
  56. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  57. out := new(Webhook)
  58. err := c.cc.Invoke(ctx, WebhookService_GetWebhook_FullMethodName, in, out, cOpts...)
  59. if err != nil {
  60. return nil, err
  61. }
  62. return out, nil
  63. }
  64. func (c *webhookServiceClient) ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error) {
  65. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  66. out := new(ListWebhooksResponse)
  67. err := c.cc.Invoke(ctx, WebhookService_ListWebhooks_FullMethodName, in, out, cOpts...)
  68. if err != nil {
  69. return nil, err
  70. }
  71. return out, nil
  72. }
  73. func (c *webhookServiceClient) UpdateWebhook(ctx context.Context, in *UpdateWebhookRequest, opts ...grpc.CallOption) (*Webhook, error) {
  74. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  75. out := new(Webhook)
  76. err := c.cc.Invoke(ctx, WebhookService_UpdateWebhook_FullMethodName, in, out, cOpts...)
  77. if err != nil {
  78. return nil, err
  79. }
  80. return out, nil
  81. }
  82. func (c *webhookServiceClient) DeleteWebhook(ctx context.Context, in *DeleteWebhookRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
  83. cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
  84. out := new(emptypb.Empty)
  85. err := c.cc.Invoke(ctx, WebhookService_DeleteWebhook_FullMethodName, in, out, cOpts...)
  86. if err != nil {
  87. return nil, err
  88. }
  89. return out, nil
  90. }
  91. // WebhookServiceServer is the server API for WebhookService service.
  92. // All implementations must embed UnimplementedWebhookServiceServer
  93. // for forward compatibility.
  94. type WebhookServiceServer interface {
  95. // CreateWebhook creates a new webhook.
  96. CreateWebhook(context.Context, *CreateWebhookRequest) (*Webhook, error)
  97. // GetWebhook returns a webhook by id.
  98. GetWebhook(context.Context, *GetWebhookRequest) (*Webhook, error)
  99. // ListWebhooks returns a list of webhooks.
  100. ListWebhooks(context.Context, *ListWebhooksRequest) (*ListWebhooksResponse, error)
  101. // UpdateWebhook updates a webhook.
  102. UpdateWebhook(context.Context, *UpdateWebhookRequest) (*Webhook, error)
  103. // DeleteWebhook deletes a webhook by id.
  104. DeleteWebhook(context.Context, *DeleteWebhookRequest) (*emptypb.Empty, error)
  105. mustEmbedUnimplementedWebhookServiceServer()
  106. }
  107. // UnimplementedWebhookServiceServer must be embedded to have
  108. // forward compatible implementations.
  109. //
  110. // NOTE: this should be embedded by value instead of pointer to avoid a nil
  111. // pointer dereference when methods are called.
  112. type UnimplementedWebhookServiceServer struct{}
  113. func (UnimplementedWebhookServiceServer) CreateWebhook(context.Context, *CreateWebhookRequest) (*Webhook, error) {
  114. return nil, status.Errorf(codes.Unimplemented, "method CreateWebhook not implemented")
  115. }
  116. func (UnimplementedWebhookServiceServer) GetWebhook(context.Context, *GetWebhookRequest) (*Webhook, error) {
  117. return nil, status.Errorf(codes.Unimplemented, "method GetWebhook not implemented")
  118. }
  119. func (UnimplementedWebhookServiceServer) ListWebhooks(context.Context, *ListWebhooksRequest) (*ListWebhooksResponse, error) {
  120. return nil, status.Errorf(codes.Unimplemented, "method ListWebhooks not implemented")
  121. }
  122. func (UnimplementedWebhookServiceServer) UpdateWebhook(context.Context, *UpdateWebhookRequest) (*Webhook, error) {
  123. return nil, status.Errorf(codes.Unimplemented, "method UpdateWebhook not implemented")
  124. }
  125. func (UnimplementedWebhookServiceServer) DeleteWebhook(context.Context, *DeleteWebhookRequest) (*emptypb.Empty, error) {
  126. return nil, status.Errorf(codes.Unimplemented, "method DeleteWebhook not implemented")
  127. }
  128. func (UnimplementedWebhookServiceServer) mustEmbedUnimplementedWebhookServiceServer() {}
  129. func (UnimplementedWebhookServiceServer) testEmbeddedByValue() {}
  130. // UnsafeWebhookServiceServer may be embedded to opt out of forward compatibility for this service.
  131. // Use of this interface is not recommended, as added methods to WebhookServiceServer will
  132. // result in compilation errors.
  133. type UnsafeWebhookServiceServer interface {
  134. mustEmbedUnimplementedWebhookServiceServer()
  135. }
  136. func RegisterWebhookServiceServer(s grpc.ServiceRegistrar, srv WebhookServiceServer) {
  137. // If the following call pancis, it indicates UnimplementedWebhookServiceServer was
  138. // embedded by pointer and is nil. This will cause panics if an
  139. // unimplemented method is ever invoked, so we test this at initialization
  140. // time to prevent it from happening at runtime later due to I/O.
  141. if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
  142. t.testEmbeddedByValue()
  143. }
  144. s.RegisterService(&WebhookService_ServiceDesc, srv)
  145. }
  146. func _WebhookService_CreateWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  147. in := new(CreateWebhookRequest)
  148. if err := dec(in); err != nil {
  149. return nil, err
  150. }
  151. if interceptor == nil {
  152. return srv.(WebhookServiceServer).CreateWebhook(ctx, in)
  153. }
  154. info := &grpc.UnaryServerInfo{
  155. Server: srv,
  156. FullMethod: WebhookService_CreateWebhook_FullMethodName,
  157. }
  158. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  159. return srv.(WebhookServiceServer).CreateWebhook(ctx, req.(*CreateWebhookRequest))
  160. }
  161. return interceptor(ctx, in, info, handler)
  162. }
  163. func _WebhookService_GetWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  164. in := new(GetWebhookRequest)
  165. if err := dec(in); err != nil {
  166. return nil, err
  167. }
  168. if interceptor == nil {
  169. return srv.(WebhookServiceServer).GetWebhook(ctx, in)
  170. }
  171. info := &grpc.UnaryServerInfo{
  172. Server: srv,
  173. FullMethod: WebhookService_GetWebhook_FullMethodName,
  174. }
  175. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  176. return srv.(WebhookServiceServer).GetWebhook(ctx, req.(*GetWebhookRequest))
  177. }
  178. return interceptor(ctx, in, info, handler)
  179. }
  180. func _WebhookService_ListWebhooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  181. in := new(ListWebhooksRequest)
  182. if err := dec(in); err != nil {
  183. return nil, err
  184. }
  185. if interceptor == nil {
  186. return srv.(WebhookServiceServer).ListWebhooks(ctx, in)
  187. }
  188. info := &grpc.UnaryServerInfo{
  189. Server: srv,
  190. FullMethod: WebhookService_ListWebhooks_FullMethodName,
  191. }
  192. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  193. return srv.(WebhookServiceServer).ListWebhooks(ctx, req.(*ListWebhooksRequest))
  194. }
  195. return interceptor(ctx, in, info, handler)
  196. }
  197. func _WebhookService_UpdateWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  198. in := new(UpdateWebhookRequest)
  199. if err := dec(in); err != nil {
  200. return nil, err
  201. }
  202. if interceptor == nil {
  203. return srv.(WebhookServiceServer).UpdateWebhook(ctx, in)
  204. }
  205. info := &grpc.UnaryServerInfo{
  206. Server: srv,
  207. FullMethod: WebhookService_UpdateWebhook_FullMethodName,
  208. }
  209. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  210. return srv.(WebhookServiceServer).UpdateWebhook(ctx, req.(*UpdateWebhookRequest))
  211. }
  212. return interceptor(ctx, in, info, handler)
  213. }
  214. func _WebhookService_DeleteWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  215. in := new(DeleteWebhookRequest)
  216. if err := dec(in); err != nil {
  217. return nil, err
  218. }
  219. if interceptor == nil {
  220. return srv.(WebhookServiceServer).DeleteWebhook(ctx, in)
  221. }
  222. info := &grpc.UnaryServerInfo{
  223. Server: srv,
  224. FullMethod: WebhookService_DeleteWebhook_FullMethodName,
  225. }
  226. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  227. return srv.(WebhookServiceServer).DeleteWebhook(ctx, req.(*DeleteWebhookRequest))
  228. }
  229. return interceptor(ctx, in, info, handler)
  230. }
  231. // WebhookService_ServiceDesc is the grpc.ServiceDesc for WebhookService service.
  232. // It's only intended for direct use with grpc.RegisterService,
  233. // and not to be introspected or modified (even as a copy)
  234. var WebhookService_ServiceDesc = grpc.ServiceDesc{
  235. ServiceName: "memos.api.v1.WebhookService",
  236. HandlerType: (*WebhookServiceServer)(nil),
  237. Methods: []grpc.MethodDesc{
  238. {
  239. MethodName: "CreateWebhook",
  240. Handler: _WebhookService_CreateWebhook_Handler,
  241. },
  242. {
  243. MethodName: "GetWebhook",
  244. Handler: _WebhookService_GetWebhook_Handler,
  245. },
  246. {
  247. MethodName: "ListWebhooks",
  248. Handler: _WebhookService_ListWebhooks_Handler,
  249. },
  250. {
  251. MethodName: "UpdateWebhook",
  252. Handler: _WebhookService_UpdateWebhook_Handler,
  253. },
  254. {
  255. MethodName: "DeleteWebhook",
  256. Handler: _WebhookService_DeleteWebhook_Handler,
  257. },
  258. },
  259. Streams: []grpc.StreamDesc{},
  260. Metadata: "api/v1/webhook_service.proto",
  261. }