memos/proto/gen/api/v2/webhook_service_grpc.pb.go

268 lines
11 KiB
Go
Raw Normal View History

2023-11-24 23:04:36 +08:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: api/v2/webhook_service.proto
package apiv2
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
WebhookService_CreateWebhook_FullMethodName = "/memos.api.v2.WebhookService/CreateWebhook"
WebhookService_GetWebhook_FullMethodName = "/memos.api.v2.WebhookService/GetWebhook"
WebhookService_ListWebhooks_FullMethodName = "/memos.api.v2.WebhookService/ListWebhooks"
WebhookService_UpdateWebhook_FullMethodName = "/memos.api.v2.WebhookService/UpdateWebhook"
WebhookService_DeleteWebhook_FullMethodName = "/memos.api.v2.WebhookService/DeleteWebhook"
)
// WebhookServiceClient is the client API for WebhookService service.
//
// 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 WebhookServiceClient interface {
2024-02-01 21:26:09 +08:00
// CreateWebhook creates a new webhook.
2023-11-24 23:04:36 +08:00
CreateWebhook(ctx context.Context, in *CreateWebhookRequest, opts ...grpc.CallOption) (*CreateWebhookResponse, error)
2024-02-01 21:26:09 +08:00
// GetWebhook returns a webhook by id.
2023-11-24 23:04:36 +08:00
GetWebhook(ctx context.Context, in *GetWebhookRequest, opts ...grpc.CallOption) (*GetWebhookResponse, error)
2024-02-01 21:26:09 +08:00
// ListWebhooks returns a list of webhooks.
2023-11-24 23:04:36 +08:00
ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error)
2024-02-01 21:26:09 +08:00
// UpdateWebhook updates a webhook.
2023-11-24 23:04:36 +08:00
UpdateWebhook(ctx context.Context, in *UpdateWebhookRequest, opts ...grpc.CallOption) (*UpdateWebhookResponse, error)
2024-02-01 21:26:09 +08:00
// DeleteWebhook deletes a webhook by id.
2023-11-24 23:04:36 +08:00
DeleteWebhook(ctx context.Context, in *DeleteWebhookRequest, opts ...grpc.CallOption) (*DeleteWebhookResponse, error)
}
type webhookServiceClient struct {
cc grpc.ClientConnInterface
}
func NewWebhookServiceClient(cc grpc.ClientConnInterface) WebhookServiceClient {
return &webhookServiceClient{cc}
}
func (c *webhookServiceClient) CreateWebhook(ctx context.Context, in *CreateWebhookRequest, opts ...grpc.CallOption) (*CreateWebhookResponse, error) {
out := new(CreateWebhookResponse)
err := c.cc.Invoke(ctx, WebhookService_CreateWebhook_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *webhookServiceClient) GetWebhook(ctx context.Context, in *GetWebhookRequest, opts ...grpc.CallOption) (*GetWebhookResponse, error) {
out := new(GetWebhookResponse)
err := c.cc.Invoke(ctx, WebhookService_GetWebhook_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *webhookServiceClient) ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error) {
out := new(ListWebhooksResponse)
err := c.cc.Invoke(ctx, WebhookService_ListWebhooks_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *webhookServiceClient) UpdateWebhook(ctx context.Context, in *UpdateWebhookRequest, opts ...grpc.CallOption) (*UpdateWebhookResponse, error) {
out := new(UpdateWebhookResponse)
err := c.cc.Invoke(ctx, WebhookService_UpdateWebhook_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *webhookServiceClient) DeleteWebhook(ctx context.Context, in *DeleteWebhookRequest, opts ...grpc.CallOption) (*DeleteWebhookResponse, error) {
out := new(DeleteWebhookResponse)
err := c.cc.Invoke(ctx, WebhookService_DeleteWebhook_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// WebhookServiceServer is the server API for WebhookService service.
// All implementations must embed UnimplementedWebhookServiceServer
// for forward compatibility
type WebhookServiceServer interface {
2024-02-01 21:26:09 +08:00
// CreateWebhook creates a new webhook.
2023-11-24 23:04:36 +08:00
CreateWebhook(context.Context, *CreateWebhookRequest) (*CreateWebhookResponse, error)
2024-02-01 21:26:09 +08:00
// GetWebhook returns a webhook by id.
2023-11-24 23:04:36 +08:00
GetWebhook(context.Context, *GetWebhookRequest) (*GetWebhookResponse, error)
2024-02-01 21:26:09 +08:00
// ListWebhooks returns a list of webhooks.
2023-11-24 23:04:36 +08:00
ListWebhooks(context.Context, *ListWebhooksRequest) (*ListWebhooksResponse, error)
2024-02-01 21:26:09 +08:00
// UpdateWebhook updates a webhook.
2023-11-24 23:04:36 +08:00
UpdateWebhook(context.Context, *UpdateWebhookRequest) (*UpdateWebhookResponse, error)
2024-02-01 21:26:09 +08:00
// DeleteWebhook deletes a webhook by id.
2023-11-24 23:04:36 +08:00
DeleteWebhook(context.Context, *DeleteWebhookRequest) (*DeleteWebhookResponse, error)
mustEmbedUnimplementedWebhookServiceServer()
}
// UnimplementedWebhookServiceServer must be embedded to have forward compatible implementations.
type UnimplementedWebhookServiceServer struct {
}
func (UnimplementedWebhookServiceServer) CreateWebhook(context.Context, *CreateWebhookRequest) (*CreateWebhookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateWebhook not implemented")
}
func (UnimplementedWebhookServiceServer) GetWebhook(context.Context, *GetWebhookRequest) (*GetWebhookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetWebhook not implemented")
}
func (UnimplementedWebhookServiceServer) ListWebhooks(context.Context, *ListWebhooksRequest) (*ListWebhooksResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListWebhooks not implemented")
}
func (UnimplementedWebhookServiceServer) UpdateWebhook(context.Context, *UpdateWebhookRequest) (*UpdateWebhookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateWebhook not implemented")
}
func (UnimplementedWebhookServiceServer) DeleteWebhook(context.Context, *DeleteWebhookRequest) (*DeleteWebhookResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteWebhook not implemented")
}
func (UnimplementedWebhookServiceServer) mustEmbedUnimplementedWebhookServiceServer() {}
// UnsafeWebhookServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to WebhookServiceServer will
// result in compilation errors.
type UnsafeWebhookServiceServer interface {
mustEmbedUnimplementedWebhookServiceServer()
}
func RegisterWebhookServiceServer(s grpc.ServiceRegistrar, srv WebhookServiceServer) {
s.RegisterService(&WebhookService_ServiceDesc, srv)
}
func _WebhookService_CreateWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateWebhookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WebhookServiceServer).CreateWebhook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WebhookService_CreateWebhook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WebhookServiceServer).CreateWebhook(ctx, req.(*CreateWebhookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WebhookService_GetWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetWebhookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WebhookServiceServer).GetWebhook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WebhookService_GetWebhook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WebhookServiceServer).GetWebhook(ctx, req.(*GetWebhookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WebhookService_ListWebhooks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListWebhooksRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WebhookServiceServer).ListWebhooks(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WebhookService_ListWebhooks_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WebhookServiceServer).ListWebhooks(ctx, req.(*ListWebhooksRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WebhookService_UpdateWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateWebhookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WebhookServiceServer).UpdateWebhook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WebhookService_UpdateWebhook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WebhookServiceServer).UpdateWebhook(ctx, req.(*UpdateWebhookRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WebhookService_DeleteWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteWebhookRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WebhookServiceServer).DeleteWebhook(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: WebhookService_DeleteWebhook_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WebhookServiceServer).DeleteWebhook(ctx, req.(*DeleteWebhookRequest))
}
return interceptor(ctx, in, info, handler)
}
// WebhookService_ServiceDesc is the grpc.ServiceDesc for WebhookService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WebhookService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "memos.api.v2.WebhookService",
HandlerType: (*WebhookServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateWebhook",
Handler: _WebhookService_CreateWebhook_Handler,
},
{
MethodName: "GetWebhook",
Handler: _WebhookService_GetWebhook_Handler,
},
{
MethodName: "ListWebhooks",
Handler: _WebhookService_ListWebhooks_Handler,
},
{
MethodName: "UpdateWebhook",
Handler: _WebhookService_UpdateWebhook_Handler,
},
{
MethodName: "DeleteWebhook",
Handler: _WebhookService_DeleteWebhook_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "api/v2/webhook_service.proto",
}