328 lines
12 KiB
Go
328 lines
12 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.5.1
|
|
// - protoc (unknown)
|
|
// source: bookmark.proto
|
|
|
|
package cloud
|
|
|
|
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.64.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion9
|
|
|
|
const (
|
|
Bookmark_CreateBookmark_FullMethodName = "/cloud.Bookmark/CreateBookmark"
|
|
Bookmark_GetBookmark_FullMethodName = "/cloud.Bookmark/GetBookmark"
|
|
Bookmark_UpdateBookmark_FullMethodName = "/cloud.Bookmark/UpdateBookmark"
|
|
Bookmark_DeleteBookmark_FullMethodName = "/cloud.Bookmark/DeleteBookmark"
|
|
Bookmark_ListBookmarks_FullMethodName = "/cloud.Bookmark/ListBookmarks"
|
|
Bookmark_ImportBookmarks_FullMethodName = "/cloud.Bookmark/ImportBookmarks"
|
|
)
|
|
|
|
// BookmarkClient is the client API for Bookmark 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 BookmarkClient interface {
|
|
// 创建书签
|
|
CreateBookmark(ctx context.Context, in *CreateBookmarkRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
|
// 获取书签详情
|
|
GetBookmark(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*CloudBookmarkItem, error)
|
|
// 更新书签
|
|
UpdateBookmark(ctx context.Context, in *CloudBookmarkItem, opts ...grpc.CallOption) (*StatusReply, error)
|
|
// 删除书签
|
|
DeleteBookmark(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
|
// 获取书签列表
|
|
ListBookmarks(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListBookmarksResponse, error)
|
|
// 导入书签
|
|
ImportBookmarks(ctx context.Context, in *ImportBookmarksRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
|
}
|
|
|
|
type bookmarkClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewBookmarkClient(cc grpc.ClientConnInterface) BookmarkClient {
|
|
return &bookmarkClient{cc}
|
|
}
|
|
|
|
func (c *bookmarkClient) CreateBookmark(ctx context.Context, in *CreateBookmarkRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(StatusReply)
|
|
err := c.cc.Invoke(ctx, Bookmark_CreateBookmark_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *bookmarkClient) GetBookmark(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*CloudBookmarkItem, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(CloudBookmarkItem)
|
|
err := c.cc.Invoke(ctx, Bookmark_GetBookmark_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *bookmarkClient) UpdateBookmark(ctx context.Context, in *CloudBookmarkItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(StatusReply)
|
|
err := c.cc.Invoke(ctx, Bookmark_UpdateBookmark_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *bookmarkClient) DeleteBookmark(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(StatusReply)
|
|
err := c.cc.Invoke(ctx, Bookmark_DeleteBookmark_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *bookmarkClient) ListBookmarks(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListBookmarksResponse, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(ListBookmarksResponse)
|
|
err := c.cc.Invoke(ctx, Bookmark_ListBookmarks_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *bookmarkClient) ImportBookmarks(ctx context.Context, in *ImportBookmarksRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
out := new(StatusReply)
|
|
err := c.cc.Invoke(ctx, Bookmark_ImportBookmarks_FullMethodName, in, out, cOpts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// BookmarkServer is the server API for Bookmark service.
|
|
// All implementations must embed UnimplementedBookmarkServer
|
|
// for forward compatibility.
|
|
//
|
|
// 书签服务
|
|
type BookmarkServer interface {
|
|
// 创建书签
|
|
CreateBookmark(context.Context, *CreateBookmarkRequest) (*StatusReply, error)
|
|
// 获取书签详情
|
|
GetBookmark(context.Context, *IDRequest) (*CloudBookmarkItem, error)
|
|
// 更新书签
|
|
UpdateBookmark(context.Context, *CloudBookmarkItem) (*StatusReply, error)
|
|
// 删除书签
|
|
DeleteBookmark(context.Context, *IDRequest) (*StatusReply, error)
|
|
// 获取书签列表
|
|
ListBookmarks(context.Context, *FetchRequest) (*ListBookmarksResponse, error)
|
|
// 导入书签
|
|
ImportBookmarks(context.Context, *ImportBookmarksRequest) (*StatusReply, error)
|
|
mustEmbedUnimplementedBookmarkServer()
|
|
}
|
|
|
|
// UnimplementedBookmarkServer must be embedded to have
|
|
// forward compatible implementations.
|
|
//
|
|
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
// pointer dereference when methods are called.
|
|
type UnimplementedBookmarkServer struct{}
|
|
|
|
func (UnimplementedBookmarkServer) CreateBookmark(context.Context, *CreateBookmarkRequest) (*StatusReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method CreateBookmark not implemented")
|
|
}
|
|
func (UnimplementedBookmarkServer) GetBookmark(context.Context, *IDRequest) (*CloudBookmarkItem, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetBookmark not implemented")
|
|
}
|
|
func (UnimplementedBookmarkServer) UpdateBookmark(context.Context, *CloudBookmarkItem) (*StatusReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UpdateBookmark not implemented")
|
|
}
|
|
func (UnimplementedBookmarkServer) DeleteBookmark(context.Context, *IDRequest) (*StatusReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteBookmark not implemented")
|
|
}
|
|
func (UnimplementedBookmarkServer) ListBookmarks(context.Context, *FetchRequest) (*ListBookmarksResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListBookmarks not implemented")
|
|
}
|
|
func (UnimplementedBookmarkServer) ImportBookmarks(context.Context, *ImportBookmarksRequest) (*StatusReply, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ImportBookmarks not implemented")
|
|
}
|
|
func (UnimplementedBookmarkServer) mustEmbedUnimplementedBookmarkServer() {}
|
|
func (UnimplementedBookmarkServer) testEmbeddedByValue() {}
|
|
|
|
// UnsafeBookmarkServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to BookmarkServer will
|
|
// result in compilation errors.
|
|
type UnsafeBookmarkServer interface {
|
|
mustEmbedUnimplementedBookmarkServer()
|
|
}
|
|
|
|
func RegisterBookmarkServer(s grpc.ServiceRegistrar, srv BookmarkServer) {
|
|
// If the following call pancis, it indicates UnimplementedBookmarkServer was
|
|
// embedded by pointer and is nil. This will cause panics if an
|
|
// unimplemented method is ever invoked, so we test this at initialization
|
|
// time to prevent it from happening at runtime later due to I/O.
|
|
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
t.testEmbeddedByValue()
|
|
}
|
|
s.RegisterService(&Bookmark_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Bookmark_CreateBookmark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateBookmarkRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BookmarkServer).CreateBookmark(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Bookmark_CreateBookmark_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BookmarkServer).CreateBookmark(ctx, req.(*CreateBookmarkRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Bookmark_GetBookmark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(IDRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BookmarkServer).GetBookmark(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Bookmark_GetBookmark_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BookmarkServer).GetBookmark(ctx, req.(*IDRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Bookmark_UpdateBookmark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CloudBookmarkItem)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BookmarkServer).UpdateBookmark(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Bookmark_UpdateBookmark_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BookmarkServer).UpdateBookmark(ctx, req.(*CloudBookmarkItem))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Bookmark_DeleteBookmark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(IDRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BookmarkServer).DeleteBookmark(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Bookmark_DeleteBookmark_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BookmarkServer).DeleteBookmark(ctx, req.(*IDRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Bookmark_ListBookmarks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(FetchRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BookmarkServer).ListBookmarks(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Bookmark_ListBookmarks_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BookmarkServer).ListBookmarks(ctx, req.(*FetchRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Bookmark_ImportBookmarks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ImportBookmarksRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BookmarkServer).ImportBookmarks(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Bookmark_ImportBookmarks_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BookmarkServer).ImportBookmarks(ctx, req.(*ImportBookmarksRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Bookmark_ServiceDesc is the grpc.ServiceDesc for Bookmark service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Bookmark_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "cloud.Bookmark",
|
|
HandlerType: (*BookmarkServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "CreateBookmark",
|
|
Handler: _Bookmark_CreateBookmark_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetBookmark",
|
|
Handler: _Bookmark_GetBookmark_Handler,
|
|
},
|
|
{
|
|
MethodName: "UpdateBookmark",
|
|
Handler: _Bookmark_UpdateBookmark_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteBookmark",
|
|
Handler: _Bookmark_DeleteBookmark_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListBookmarks",
|
|
Handler: _Bookmark_ListBookmarks_Handler,
|
|
},
|
|
{
|
|
MethodName: "ImportBookmarks",
|
|
Handler: _Bookmark_ImportBookmarks_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "bookmark.proto",
|
|
}
|