mirror of
https://github.com/usememos/memos.git
synced 2024-11-17 04:07:30 +08:00
57dd1fc49f
* chore: initial memo service definition * chore: update * chore: update * chore: update
146 lines
5.1 KiB
Go
146 lines
5.1 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc (unknown)
|
|
// source: api/v2/memo_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 (
|
|
MemoService_ListMemos_FullMethodName = "/memos.api.v2.MemoService/ListMemos"
|
|
MemoService_GetMemo_FullMethodName = "/memos.api.v2.MemoService/GetMemo"
|
|
)
|
|
|
|
// MemoServiceClient is the client API for MemoService 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 MemoServiceClient interface {
|
|
ListMemos(ctx context.Context, in *ListMemosRequest, opts ...grpc.CallOption) (*ListMemosResponse, error)
|
|
GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error)
|
|
}
|
|
|
|
type memoServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewMemoServiceClient(cc grpc.ClientConnInterface) MemoServiceClient {
|
|
return &memoServiceClient{cc}
|
|
}
|
|
|
|
func (c *memoServiceClient) ListMemos(ctx context.Context, in *ListMemosRequest, opts ...grpc.CallOption) (*ListMemosResponse, error) {
|
|
out := new(ListMemosResponse)
|
|
err := c.cc.Invoke(ctx, MemoService_ListMemos_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *memoServiceClient) GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error) {
|
|
out := new(GetMemoResponse)
|
|
err := c.cc.Invoke(ctx, MemoService_GetMemo_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// MemoServiceServer is the server API for MemoService service.
|
|
// All implementations must embed UnimplementedMemoServiceServer
|
|
// for forward compatibility
|
|
type MemoServiceServer interface {
|
|
ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error)
|
|
GetMemo(context.Context, *GetMemoRequest) (*GetMemoResponse, error)
|
|
mustEmbedUnimplementedMemoServiceServer()
|
|
}
|
|
|
|
// UnimplementedMemoServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedMemoServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedMemoServiceServer) ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListMemos not implemented")
|
|
}
|
|
func (UnimplementedMemoServiceServer) GetMemo(context.Context, *GetMemoRequest) (*GetMemoResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetMemo not implemented")
|
|
}
|
|
func (UnimplementedMemoServiceServer) mustEmbedUnimplementedMemoServiceServer() {}
|
|
|
|
// UnsafeMemoServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to MemoServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeMemoServiceServer interface {
|
|
mustEmbedUnimplementedMemoServiceServer()
|
|
}
|
|
|
|
func RegisterMemoServiceServer(s grpc.ServiceRegistrar, srv MemoServiceServer) {
|
|
s.RegisterService(&MemoService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _MemoService_ListMemos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListMemosRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(MemoServiceServer).ListMemos(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: MemoService_ListMemos_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(MemoServiceServer).ListMemos(ctx, req.(*ListMemosRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _MemoService_GetMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetMemoRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(MemoServiceServer).GetMemo(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: MemoService_GetMemo_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(MemoServiceServer).GetMemo(ctx, req.(*GetMemoRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// MemoService_ServiceDesc is the grpc.ServiceDesc for MemoService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var MemoService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "memos.api.v2.MemoService",
|
|
HandlerType: (*MemoServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ListMemos",
|
|
Handler: _MemoService_ListMemos_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetMemo",
|
|
Handler: _MemoService_GetMemo_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "api/v2/memo_service.proto",
|
|
}
|