first commit
Some checks failed
Backend Tests / Static Checks (push) Has been cancelled
Backend Tests / Tests (other) (push) Has been cancelled
Backend Tests / Tests (plugin) (push) Has been cancelled
Backend Tests / Tests (server) (push) Has been cancelled
Backend Tests / Tests (store) (push) Has been cancelled
Build Canary Image / build-frontend (push) Has been cancelled
Build Canary Image / build-push (linux/amd64) (push) Has been cancelled
Build Canary Image / build-push (linux/arm64) (push) Has been cancelled
Build Canary Image / merge (push) Has been cancelled
Frontend Tests / Lint (push) Has been cancelled
Frontend Tests / Build (push) Has been cancelled
Proto Linter / Lint Protos (push) Has been cancelled
Some checks failed
Backend Tests / Static Checks (push) Has been cancelled
Backend Tests / Tests (other) (push) Has been cancelled
Backend Tests / Tests (plugin) (push) Has been cancelled
Backend Tests / Tests (server) (push) Has been cancelled
Backend Tests / Tests (store) (push) Has been cancelled
Build Canary Image / build-frontend (push) Has been cancelled
Build Canary Image / build-push (linux/amd64) (push) Has been cancelled
Build Canary Image / build-push (linux/arm64) (push) Has been cancelled
Build Canary Image / merge (push) Has been cancelled
Frontend Tests / Lint (push) Has been cancelled
Frontend Tests / Build (push) Has been cancelled
Proto Linter / Lint Protos (push) Has been cancelled
This commit is contained in:
510
proto/gen/api/v1/apiv1connect/memo_service.connect.go
Normal file
510
proto/gen/api/v1/apiv1connect/memo_service.connect.go
Normal file
@@ -0,0 +1,510 @@
|
||||
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
|
||||
//
|
||||
// Source: api/v1/memo_service.proto
|
||||
|
||||
package apiv1connect
|
||||
|
||||
import (
|
||||
connect "connectrpc.com/connect"
|
||||
context "context"
|
||||
errors "errors"
|
||||
v1 "github.com/usememos/memos/proto/gen/api/v1"
|
||||
emptypb "google.golang.org/protobuf/types/known/emptypb"
|
||||
http "net/http"
|
||||
strings "strings"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file and the connect package are
|
||||
// compatible. If you get a compiler error that this constant is not defined, this code was
|
||||
// generated with a version of connect newer than the one compiled into your binary. You can fix the
|
||||
// problem by either regenerating this code with an older version of connect or updating the connect
|
||||
// version compiled into your binary.
|
||||
const _ = connect.IsAtLeastVersion1_13_0
|
||||
|
||||
const (
|
||||
// MemoServiceName is the fully-qualified name of the MemoService service.
|
||||
MemoServiceName = "memos.api.v1.MemoService"
|
||||
)
|
||||
|
||||
// These constants are the fully-qualified names of the RPCs defined in this package. They're
|
||||
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
|
||||
//
|
||||
// Note that these are different from the fully-qualified method names used by
|
||||
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
|
||||
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
|
||||
// period.
|
||||
const (
|
||||
// MemoServiceCreateMemoProcedure is the fully-qualified name of the MemoService's CreateMemo RPC.
|
||||
MemoServiceCreateMemoProcedure = "/memos.api.v1.MemoService/CreateMemo"
|
||||
// MemoServiceListMemosProcedure is the fully-qualified name of the MemoService's ListMemos RPC.
|
||||
MemoServiceListMemosProcedure = "/memos.api.v1.MemoService/ListMemos"
|
||||
// MemoServiceGetMemoProcedure is the fully-qualified name of the MemoService's GetMemo RPC.
|
||||
MemoServiceGetMemoProcedure = "/memos.api.v1.MemoService/GetMemo"
|
||||
// MemoServiceUpdateMemoProcedure is the fully-qualified name of the MemoService's UpdateMemo RPC.
|
||||
MemoServiceUpdateMemoProcedure = "/memos.api.v1.MemoService/UpdateMemo"
|
||||
// MemoServiceDeleteMemoProcedure is the fully-qualified name of the MemoService's DeleteMemo RPC.
|
||||
MemoServiceDeleteMemoProcedure = "/memos.api.v1.MemoService/DeleteMemo"
|
||||
// MemoServiceSetMemoAttachmentsProcedure is the fully-qualified name of the MemoService's
|
||||
// SetMemoAttachments RPC.
|
||||
MemoServiceSetMemoAttachmentsProcedure = "/memos.api.v1.MemoService/SetMemoAttachments"
|
||||
// MemoServiceListMemoAttachmentsProcedure is the fully-qualified name of the MemoService's
|
||||
// ListMemoAttachments RPC.
|
||||
MemoServiceListMemoAttachmentsProcedure = "/memos.api.v1.MemoService/ListMemoAttachments"
|
||||
// MemoServiceSetMemoRelationsProcedure is the fully-qualified name of the MemoService's
|
||||
// SetMemoRelations RPC.
|
||||
MemoServiceSetMemoRelationsProcedure = "/memos.api.v1.MemoService/SetMemoRelations"
|
||||
// MemoServiceListMemoRelationsProcedure is the fully-qualified name of the MemoService's
|
||||
// ListMemoRelations RPC.
|
||||
MemoServiceListMemoRelationsProcedure = "/memos.api.v1.MemoService/ListMemoRelations"
|
||||
// MemoServiceCreateMemoCommentProcedure is the fully-qualified name of the MemoService's
|
||||
// CreateMemoComment RPC.
|
||||
MemoServiceCreateMemoCommentProcedure = "/memos.api.v1.MemoService/CreateMemoComment"
|
||||
// MemoServiceListMemoCommentsProcedure is the fully-qualified name of the MemoService's
|
||||
// ListMemoComments RPC.
|
||||
MemoServiceListMemoCommentsProcedure = "/memos.api.v1.MemoService/ListMemoComments"
|
||||
// MemoServiceListMemoReactionsProcedure is the fully-qualified name of the MemoService's
|
||||
// ListMemoReactions RPC.
|
||||
MemoServiceListMemoReactionsProcedure = "/memos.api.v1.MemoService/ListMemoReactions"
|
||||
// MemoServiceUpsertMemoReactionProcedure is the fully-qualified name of the MemoService's
|
||||
// UpsertMemoReaction RPC.
|
||||
MemoServiceUpsertMemoReactionProcedure = "/memos.api.v1.MemoService/UpsertMemoReaction"
|
||||
// MemoServiceDeleteMemoReactionProcedure is the fully-qualified name of the MemoService's
|
||||
// DeleteMemoReaction RPC.
|
||||
MemoServiceDeleteMemoReactionProcedure = "/memos.api.v1.MemoService/DeleteMemoReaction"
|
||||
)
|
||||
|
||||
// MemoServiceClient is a client for the memos.api.v1.MemoService service.
|
||||
type MemoServiceClient interface {
|
||||
// CreateMemo creates a memo.
|
||||
CreateMemo(context.Context, *connect.Request[v1.CreateMemoRequest]) (*connect.Response[v1.Memo], error)
|
||||
// ListMemos lists memos with pagination and filter.
|
||||
ListMemos(context.Context, *connect.Request[v1.ListMemosRequest]) (*connect.Response[v1.ListMemosResponse], error)
|
||||
// GetMemo gets a memo.
|
||||
GetMemo(context.Context, *connect.Request[v1.GetMemoRequest]) (*connect.Response[v1.Memo], error)
|
||||
// UpdateMemo updates a memo.
|
||||
UpdateMemo(context.Context, *connect.Request[v1.UpdateMemoRequest]) (*connect.Response[v1.Memo], error)
|
||||
// DeleteMemo deletes a memo.
|
||||
DeleteMemo(context.Context, *connect.Request[v1.DeleteMemoRequest]) (*connect.Response[emptypb.Empty], error)
|
||||
// SetMemoAttachments sets attachments for a memo.
|
||||
SetMemoAttachments(context.Context, *connect.Request[v1.SetMemoAttachmentsRequest]) (*connect.Response[emptypb.Empty], error)
|
||||
// ListMemoAttachments lists attachments for a memo.
|
||||
ListMemoAttachments(context.Context, *connect.Request[v1.ListMemoAttachmentsRequest]) (*connect.Response[v1.ListMemoAttachmentsResponse], error)
|
||||
// SetMemoRelations sets relations for a memo.
|
||||
SetMemoRelations(context.Context, *connect.Request[v1.SetMemoRelationsRequest]) (*connect.Response[emptypb.Empty], error)
|
||||
// ListMemoRelations lists relations for a memo.
|
||||
ListMemoRelations(context.Context, *connect.Request[v1.ListMemoRelationsRequest]) (*connect.Response[v1.ListMemoRelationsResponse], error)
|
||||
// CreateMemoComment creates a comment for a memo.
|
||||
CreateMemoComment(context.Context, *connect.Request[v1.CreateMemoCommentRequest]) (*connect.Response[v1.Memo], error)
|
||||
// ListMemoComments lists comments for a memo.
|
||||
ListMemoComments(context.Context, *connect.Request[v1.ListMemoCommentsRequest]) (*connect.Response[v1.ListMemoCommentsResponse], error)
|
||||
// ListMemoReactions lists reactions for a memo.
|
||||
ListMemoReactions(context.Context, *connect.Request[v1.ListMemoReactionsRequest]) (*connect.Response[v1.ListMemoReactionsResponse], error)
|
||||
// UpsertMemoReaction upserts a reaction for a memo.
|
||||
UpsertMemoReaction(context.Context, *connect.Request[v1.UpsertMemoReactionRequest]) (*connect.Response[v1.Reaction], error)
|
||||
// DeleteMemoReaction deletes a reaction for a memo.
|
||||
DeleteMemoReaction(context.Context, *connect.Request[v1.DeleteMemoReactionRequest]) (*connect.Response[emptypb.Empty], error)
|
||||
}
|
||||
|
||||
// NewMemoServiceClient constructs a client for the memos.api.v1.MemoService service. By default, it
|
||||
// uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends
|
||||
// uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or
|
||||
// connect.WithGRPCWeb() options.
|
||||
//
|
||||
// The URL supplied here should be the base URL for the Connect or gRPC server (for example,
|
||||
// http://api.acme.com or https://acme.com/grpc).
|
||||
func NewMemoServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) MemoServiceClient {
|
||||
baseURL = strings.TrimRight(baseURL, "/")
|
||||
memoServiceMethods := v1.File_api_v1_memo_service_proto.Services().ByName("MemoService").Methods()
|
||||
return &memoServiceClient{
|
||||
createMemo: connect.NewClient[v1.CreateMemoRequest, v1.Memo](
|
||||
httpClient,
|
||||
baseURL+MemoServiceCreateMemoProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("CreateMemo")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
listMemos: connect.NewClient[v1.ListMemosRequest, v1.ListMemosResponse](
|
||||
httpClient,
|
||||
baseURL+MemoServiceListMemosProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("ListMemos")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
getMemo: connect.NewClient[v1.GetMemoRequest, v1.Memo](
|
||||
httpClient,
|
||||
baseURL+MemoServiceGetMemoProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("GetMemo")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
updateMemo: connect.NewClient[v1.UpdateMemoRequest, v1.Memo](
|
||||
httpClient,
|
||||
baseURL+MemoServiceUpdateMemoProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("UpdateMemo")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
deleteMemo: connect.NewClient[v1.DeleteMemoRequest, emptypb.Empty](
|
||||
httpClient,
|
||||
baseURL+MemoServiceDeleteMemoProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("DeleteMemo")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
setMemoAttachments: connect.NewClient[v1.SetMemoAttachmentsRequest, emptypb.Empty](
|
||||
httpClient,
|
||||
baseURL+MemoServiceSetMemoAttachmentsProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("SetMemoAttachments")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
listMemoAttachments: connect.NewClient[v1.ListMemoAttachmentsRequest, v1.ListMemoAttachmentsResponse](
|
||||
httpClient,
|
||||
baseURL+MemoServiceListMemoAttachmentsProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("ListMemoAttachments")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
setMemoRelations: connect.NewClient[v1.SetMemoRelationsRequest, emptypb.Empty](
|
||||
httpClient,
|
||||
baseURL+MemoServiceSetMemoRelationsProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("SetMemoRelations")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
listMemoRelations: connect.NewClient[v1.ListMemoRelationsRequest, v1.ListMemoRelationsResponse](
|
||||
httpClient,
|
||||
baseURL+MemoServiceListMemoRelationsProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("ListMemoRelations")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
createMemoComment: connect.NewClient[v1.CreateMemoCommentRequest, v1.Memo](
|
||||
httpClient,
|
||||
baseURL+MemoServiceCreateMemoCommentProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("CreateMemoComment")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
listMemoComments: connect.NewClient[v1.ListMemoCommentsRequest, v1.ListMemoCommentsResponse](
|
||||
httpClient,
|
||||
baseURL+MemoServiceListMemoCommentsProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("ListMemoComments")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
listMemoReactions: connect.NewClient[v1.ListMemoReactionsRequest, v1.ListMemoReactionsResponse](
|
||||
httpClient,
|
||||
baseURL+MemoServiceListMemoReactionsProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("ListMemoReactions")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
upsertMemoReaction: connect.NewClient[v1.UpsertMemoReactionRequest, v1.Reaction](
|
||||
httpClient,
|
||||
baseURL+MemoServiceUpsertMemoReactionProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("UpsertMemoReaction")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
deleteMemoReaction: connect.NewClient[v1.DeleteMemoReactionRequest, emptypb.Empty](
|
||||
httpClient,
|
||||
baseURL+MemoServiceDeleteMemoReactionProcedure,
|
||||
connect.WithSchema(memoServiceMethods.ByName("DeleteMemoReaction")),
|
||||
connect.WithClientOptions(opts...),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
// memoServiceClient implements MemoServiceClient.
|
||||
type memoServiceClient struct {
|
||||
createMemo *connect.Client[v1.CreateMemoRequest, v1.Memo]
|
||||
listMemos *connect.Client[v1.ListMemosRequest, v1.ListMemosResponse]
|
||||
getMemo *connect.Client[v1.GetMemoRequest, v1.Memo]
|
||||
updateMemo *connect.Client[v1.UpdateMemoRequest, v1.Memo]
|
||||
deleteMemo *connect.Client[v1.DeleteMemoRequest, emptypb.Empty]
|
||||
setMemoAttachments *connect.Client[v1.SetMemoAttachmentsRequest, emptypb.Empty]
|
||||
listMemoAttachments *connect.Client[v1.ListMemoAttachmentsRequest, v1.ListMemoAttachmentsResponse]
|
||||
setMemoRelations *connect.Client[v1.SetMemoRelationsRequest, emptypb.Empty]
|
||||
listMemoRelations *connect.Client[v1.ListMemoRelationsRequest, v1.ListMemoRelationsResponse]
|
||||
createMemoComment *connect.Client[v1.CreateMemoCommentRequest, v1.Memo]
|
||||
listMemoComments *connect.Client[v1.ListMemoCommentsRequest, v1.ListMemoCommentsResponse]
|
||||
listMemoReactions *connect.Client[v1.ListMemoReactionsRequest, v1.ListMemoReactionsResponse]
|
||||
upsertMemoReaction *connect.Client[v1.UpsertMemoReactionRequest, v1.Reaction]
|
||||
deleteMemoReaction *connect.Client[v1.DeleteMemoReactionRequest, emptypb.Empty]
|
||||
}
|
||||
|
||||
// CreateMemo calls memos.api.v1.MemoService.CreateMemo.
|
||||
func (c *memoServiceClient) CreateMemo(ctx context.Context, req *connect.Request[v1.CreateMemoRequest]) (*connect.Response[v1.Memo], error) {
|
||||
return c.createMemo.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// ListMemos calls memos.api.v1.MemoService.ListMemos.
|
||||
func (c *memoServiceClient) ListMemos(ctx context.Context, req *connect.Request[v1.ListMemosRequest]) (*connect.Response[v1.ListMemosResponse], error) {
|
||||
return c.listMemos.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// GetMemo calls memos.api.v1.MemoService.GetMemo.
|
||||
func (c *memoServiceClient) GetMemo(ctx context.Context, req *connect.Request[v1.GetMemoRequest]) (*connect.Response[v1.Memo], error) {
|
||||
return c.getMemo.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// UpdateMemo calls memos.api.v1.MemoService.UpdateMemo.
|
||||
func (c *memoServiceClient) UpdateMemo(ctx context.Context, req *connect.Request[v1.UpdateMemoRequest]) (*connect.Response[v1.Memo], error) {
|
||||
return c.updateMemo.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteMemo calls memos.api.v1.MemoService.DeleteMemo.
|
||||
func (c *memoServiceClient) DeleteMemo(ctx context.Context, req *connect.Request[v1.DeleteMemoRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||
return c.deleteMemo.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// SetMemoAttachments calls memos.api.v1.MemoService.SetMemoAttachments.
|
||||
func (c *memoServiceClient) SetMemoAttachments(ctx context.Context, req *connect.Request[v1.SetMemoAttachmentsRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||
return c.setMemoAttachments.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// ListMemoAttachments calls memos.api.v1.MemoService.ListMemoAttachments.
|
||||
func (c *memoServiceClient) ListMemoAttachments(ctx context.Context, req *connect.Request[v1.ListMemoAttachmentsRequest]) (*connect.Response[v1.ListMemoAttachmentsResponse], error) {
|
||||
return c.listMemoAttachments.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// SetMemoRelations calls memos.api.v1.MemoService.SetMemoRelations.
|
||||
func (c *memoServiceClient) SetMemoRelations(ctx context.Context, req *connect.Request[v1.SetMemoRelationsRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||
return c.setMemoRelations.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// ListMemoRelations calls memos.api.v1.MemoService.ListMemoRelations.
|
||||
func (c *memoServiceClient) ListMemoRelations(ctx context.Context, req *connect.Request[v1.ListMemoRelationsRequest]) (*connect.Response[v1.ListMemoRelationsResponse], error) {
|
||||
return c.listMemoRelations.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// CreateMemoComment calls memos.api.v1.MemoService.CreateMemoComment.
|
||||
func (c *memoServiceClient) CreateMemoComment(ctx context.Context, req *connect.Request[v1.CreateMemoCommentRequest]) (*connect.Response[v1.Memo], error) {
|
||||
return c.createMemoComment.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// ListMemoComments calls memos.api.v1.MemoService.ListMemoComments.
|
||||
func (c *memoServiceClient) ListMemoComments(ctx context.Context, req *connect.Request[v1.ListMemoCommentsRequest]) (*connect.Response[v1.ListMemoCommentsResponse], error) {
|
||||
return c.listMemoComments.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// ListMemoReactions calls memos.api.v1.MemoService.ListMemoReactions.
|
||||
func (c *memoServiceClient) ListMemoReactions(ctx context.Context, req *connect.Request[v1.ListMemoReactionsRequest]) (*connect.Response[v1.ListMemoReactionsResponse], error) {
|
||||
return c.listMemoReactions.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// UpsertMemoReaction calls memos.api.v1.MemoService.UpsertMemoReaction.
|
||||
func (c *memoServiceClient) UpsertMemoReaction(ctx context.Context, req *connect.Request[v1.UpsertMemoReactionRequest]) (*connect.Response[v1.Reaction], error) {
|
||||
return c.upsertMemoReaction.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteMemoReaction calls memos.api.v1.MemoService.DeleteMemoReaction.
|
||||
func (c *memoServiceClient) DeleteMemoReaction(ctx context.Context, req *connect.Request[v1.DeleteMemoReactionRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||
return c.deleteMemoReaction.CallUnary(ctx, req)
|
||||
}
|
||||
|
||||
// MemoServiceHandler is an implementation of the memos.api.v1.MemoService service.
|
||||
type MemoServiceHandler interface {
|
||||
// CreateMemo creates a memo.
|
||||
CreateMemo(context.Context, *connect.Request[v1.CreateMemoRequest]) (*connect.Response[v1.Memo], error)
|
||||
// ListMemos lists memos with pagination and filter.
|
||||
ListMemos(context.Context, *connect.Request[v1.ListMemosRequest]) (*connect.Response[v1.ListMemosResponse], error)
|
||||
// GetMemo gets a memo.
|
||||
GetMemo(context.Context, *connect.Request[v1.GetMemoRequest]) (*connect.Response[v1.Memo], error)
|
||||
// UpdateMemo updates a memo.
|
||||
UpdateMemo(context.Context, *connect.Request[v1.UpdateMemoRequest]) (*connect.Response[v1.Memo], error)
|
||||
// DeleteMemo deletes a memo.
|
||||
DeleteMemo(context.Context, *connect.Request[v1.DeleteMemoRequest]) (*connect.Response[emptypb.Empty], error)
|
||||
// SetMemoAttachments sets attachments for a memo.
|
||||
SetMemoAttachments(context.Context, *connect.Request[v1.SetMemoAttachmentsRequest]) (*connect.Response[emptypb.Empty], error)
|
||||
// ListMemoAttachments lists attachments for a memo.
|
||||
ListMemoAttachments(context.Context, *connect.Request[v1.ListMemoAttachmentsRequest]) (*connect.Response[v1.ListMemoAttachmentsResponse], error)
|
||||
// SetMemoRelations sets relations for a memo.
|
||||
SetMemoRelations(context.Context, *connect.Request[v1.SetMemoRelationsRequest]) (*connect.Response[emptypb.Empty], error)
|
||||
// ListMemoRelations lists relations for a memo.
|
||||
ListMemoRelations(context.Context, *connect.Request[v1.ListMemoRelationsRequest]) (*connect.Response[v1.ListMemoRelationsResponse], error)
|
||||
// CreateMemoComment creates a comment for a memo.
|
||||
CreateMemoComment(context.Context, *connect.Request[v1.CreateMemoCommentRequest]) (*connect.Response[v1.Memo], error)
|
||||
// ListMemoComments lists comments for a memo.
|
||||
ListMemoComments(context.Context, *connect.Request[v1.ListMemoCommentsRequest]) (*connect.Response[v1.ListMemoCommentsResponse], error)
|
||||
// ListMemoReactions lists reactions for a memo.
|
||||
ListMemoReactions(context.Context, *connect.Request[v1.ListMemoReactionsRequest]) (*connect.Response[v1.ListMemoReactionsResponse], error)
|
||||
// UpsertMemoReaction upserts a reaction for a memo.
|
||||
UpsertMemoReaction(context.Context, *connect.Request[v1.UpsertMemoReactionRequest]) (*connect.Response[v1.Reaction], error)
|
||||
// DeleteMemoReaction deletes a reaction for a memo.
|
||||
DeleteMemoReaction(context.Context, *connect.Request[v1.DeleteMemoReactionRequest]) (*connect.Response[emptypb.Empty], error)
|
||||
}
|
||||
|
||||
// NewMemoServiceHandler builds an HTTP handler from the service implementation. It returns the path
|
||||
// on which to mount the handler and the handler itself.
|
||||
//
|
||||
// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf
|
||||
// and JSON codecs. They also support gzip compression.
|
||||
func NewMemoServiceHandler(svc MemoServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
|
||||
memoServiceMethods := v1.File_api_v1_memo_service_proto.Services().ByName("MemoService").Methods()
|
||||
memoServiceCreateMemoHandler := connect.NewUnaryHandler(
|
||||
MemoServiceCreateMemoProcedure,
|
||||
svc.CreateMemo,
|
||||
connect.WithSchema(memoServiceMethods.ByName("CreateMemo")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceListMemosHandler := connect.NewUnaryHandler(
|
||||
MemoServiceListMemosProcedure,
|
||||
svc.ListMemos,
|
||||
connect.WithSchema(memoServiceMethods.ByName("ListMemos")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceGetMemoHandler := connect.NewUnaryHandler(
|
||||
MemoServiceGetMemoProcedure,
|
||||
svc.GetMemo,
|
||||
connect.WithSchema(memoServiceMethods.ByName("GetMemo")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceUpdateMemoHandler := connect.NewUnaryHandler(
|
||||
MemoServiceUpdateMemoProcedure,
|
||||
svc.UpdateMemo,
|
||||
connect.WithSchema(memoServiceMethods.ByName("UpdateMemo")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceDeleteMemoHandler := connect.NewUnaryHandler(
|
||||
MemoServiceDeleteMemoProcedure,
|
||||
svc.DeleteMemo,
|
||||
connect.WithSchema(memoServiceMethods.ByName("DeleteMemo")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceSetMemoAttachmentsHandler := connect.NewUnaryHandler(
|
||||
MemoServiceSetMemoAttachmentsProcedure,
|
||||
svc.SetMemoAttachments,
|
||||
connect.WithSchema(memoServiceMethods.ByName("SetMemoAttachments")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceListMemoAttachmentsHandler := connect.NewUnaryHandler(
|
||||
MemoServiceListMemoAttachmentsProcedure,
|
||||
svc.ListMemoAttachments,
|
||||
connect.WithSchema(memoServiceMethods.ByName("ListMemoAttachments")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceSetMemoRelationsHandler := connect.NewUnaryHandler(
|
||||
MemoServiceSetMemoRelationsProcedure,
|
||||
svc.SetMemoRelations,
|
||||
connect.WithSchema(memoServiceMethods.ByName("SetMemoRelations")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceListMemoRelationsHandler := connect.NewUnaryHandler(
|
||||
MemoServiceListMemoRelationsProcedure,
|
||||
svc.ListMemoRelations,
|
||||
connect.WithSchema(memoServiceMethods.ByName("ListMemoRelations")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceCreateMemoCommentHandler := connect.NewUnaryHandler(
|
||||
MemoServiceCreateMemoCommentProcedure,
|
||||
svc.CreateMemoComment,
|
||||
connect.WithSchema(memoServiceMethods.ByName("CreateMemoComment")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceListMemoCommentsHandler := connect.NewUnaryHandler(
|
||||
MemoServiceListMemoCommentsProcedure,
|
||||
svc.ListMemoComments,
|
||||
connect.WithSchema(memoServiceMethods.ByName("ListMemoComments")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceListMemoReactionsHandler := connect.NewUnaryHandler(
|
||||
MemoServiceListMemoReactionsProcedure,
|
||||
svc.ListMemoReactions,
|
||||
connect.WithSchema(memoServiceMethods.ByName("ListMemoReactions")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceUpsertMemoReactionHandler := connect.NewUnaryHandler(
|
||||
MemoServiceUpsertMemoReactionProcedure,
|
||||
svc.UpsertMemoReaction,
|
||||
connect.WithSchema(memoServiceMethods.ByName("UpsertMemoReaction")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
memoServiceDeleteMemoReactionHandler := connect.NewUnaryHandler(
|
||||
MemoServiceDeleteMemoReactionProcedure,
|
||||
svc.DeleteMemoReaction,
|
||||
connect.WithSchema(memoServiceMethods.ByName("DeleteMemoReaction")),
|
||||
connect.WithHandlerOptions(opts...),
|
||||
)
|
||||
return "/memos.api.v1.MemoService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.URL.Path {
|
||||
case MemoServiceCreateMemoProcedure:
|
||||
memoServiceCreateMemoHandler.ServeHTTP(w, r)
|
||||
case MemoServiceListMemosProcedure:
|
||||
memoServiceListMemosHandler.ServeHTTP(w, r)
|
||||
case MemoServiceGetMemoProcedure:
|
||||
memoServiceGetMemoHandler.ServeHTTP(w, r)
|
||||
case MemoServiceUpdateMemoProcedure:
|
||||
memoServiceUpdateMemoHandler.ServeHTTP(w, r)
|
||||
case MemoServiceDeleteMemoProcedure:
|
||||
memoServiceDeleteMemoHandler.ServeHTTP(w, r)
|
||||
case MemoServiceSetMemoAttachmentsProcedure:
|
||||
memoServiceSetMemoAttachmentsHandler.ServeHTTP(w, r)
|
||||
case MemoServiceListMemoAttachmentsProcedure:
|
||||
memoServiceListMemoAttachmentsHandler.ServeHTTP(w, r)
|
||||
case MemoServiceSetMemoRelationsProcedure:
|
||||
memoServiceSetMemoRelationsHandler.ServeHTTP(w, r)
|
||||
case MemoServiceListMemoRelationsProcedure:
|
||||
memoServiceListMemoRelationsHandler.ServeHTTP(w, r)
|
||||
case MemoServiceCreateMemoCommentProcedure:
|
||||
memoServiceCreateMemoCommentHandler.ServeHTTP(w, r)
|
||||
case MemoServiceListMemoCommentsProcedure:
|
||||
memoServiceListMemoCommentsHandler.ServeHTTP(w, r)
|
||||
case MemoServiceListMemoReactionsProcedure:
|
||||
memoServiceListMemoReactionsHandler.ServeHTTP(w, r)
|
||||
case MemoServiceUpsertMemoReactionProcedure:
|
||||
memoServiceUpsertMemoReactionHandler.ServeHTTP(w, r)
|
||||
case MemoServiceDeleteMemoReactionProcedure:
|
||||
memoServiceDeleteMemoReactionHandler.ServeHTTP(w, r)
|
||||
default:
|
||||
http.NotFound(w, r)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// UnimplementedMemoServiceHandler returns CodeUnimplemented from all methods.
|
||||
type UnimplementedMemoServiceHandler struct{}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) CreateMemo(context.Context, *connect.Request[v1.CreateMemoRequest]) (*connect.Response[v1.Memo], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.CreateMemo is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) ListMemos(context.Context, *connect.Request[v1.ListMemosRequest]) (*connect.Response[v1.ListMemosResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.ListMemos is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) GetMemo(context.Context, *connect.Request[v1.GetMemoRequest]) (*connect.Response[v1.Memo], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.GetMemo is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) UpdateMemo(context.Context, *connect.Request[v1.UpdateMemoRequest]) (*connect.Response[v1.Memo], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.UpdateMemo is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) DeleteMemo(context.Context, *connect.Request[v1.DeleteMemoRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.DeleteMemo is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) SetMemoAttachments(context.Context, *connect.Request[v1.SetMemoAttachmentsRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.SetMemoAttachments is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) ListMemoAttachments(context.Context, *connect.Request[v1.ListMemoAttachmentsRequest]) (*connect.Response[v1.ListMemoAttachmentsResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.ListMemoAttachments is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) SetMemoRelations(context.Context, *connect.Request[v1.SetMemoRelationsRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.SetMemoRelations is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) ListMemoRelations(context.Context, *connect.Request[v1.ListMemoRelationsRequest]) (*connect.Response[v1.ListMemoRelationsResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.ListMemoRelations is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) CreateMemoComment(context.Context, *connect.Request[v1.CreateMemoCommentRequest]) (*connect.Response[v1.Memo], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.CreateMemoComment is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) ListMemoComments(context.Context, *connect.Request[v1.ListMemoCommentsRequest]) (*connect.Response[v1.ListMemoCommentsResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.ListMemoComments is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) ListMemoReactions(context.Context, *connect.Request[v1.ListMemoReactionsRequest]) (*connect.Response[v1.ListMemoReactionsResponse], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.ListMemoReactions is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) UpsertMemoReaction(context.Context, *connect.Request[v1.UpsertMemoReactionRequest]) (*connect.Response[v1.Reaction], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.UpsertMemoReaction is not implemented"))
|
||||
}
|
||||
|
||||
func (UnimplementedMemoServiceHandler) DeleteMemoReaction(context.Context, *connect.Request[v1.DeleteMemoReactionRequest]) (*connect.Response[emptypb.Empty], error) {
|
||||
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("memos.api.v1.MemoService.DeleteMemoReaction is not implemented"))
|
||||
}
|
||||
Reference in New Issue
Block a user