// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 // - protoc (unknown) // source: share.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 ( Share_CreateShare_FullMethodName = "/cloud.Share/CreateShare" Share_GetShare_FullMethodName = "/cloud.Share/GetShare" Share_DeleteShare_FullMethodName = "/cloud.Share/DeleteShare" Share_ListShares_FullMethodName = "/cloud.Share/ListShares" Share_ValidateSharePassword_FullMethodName = "/cloud.Share/ValidateSharePassword" ) // ShareClient is the client API for Share 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 ShareClient interface { // 创建分享 CreateShare(ctx context.Context, in *CreateShareRequest, opts ...grpc.CallOption) (*StatusReply, error) // 获取分享详情 GetShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudShareItem, error) // 删除分享 DeleteShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) // 获取分享列表 ListShares(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListSharesResponse, error) // 验证分享密码 ValidateSharePassword(ctx context.Context, in *ValidateSharePasswordRequest, opts ...grpc.CallOption) (*StatusReply, error) } type shareClient struct { cc grpc.ClientConnInterface } func NewShareClient(cc grpc.ClientConnInterface) ShareClient { return &shareClient{cc} } func (c *shareClient) CreateShare(ctx context.Context, in *CreateShareRequest, opts ...grpc.CallOption) (*StatusReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StatusReply) err := c.cc.Invoke(ctx, Share_CreateShare_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *shareClient) GetShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudShareItem, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CloudShareItem) err := c.cc.Invoke(ctx, Share_GetShare_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *shareClient) DeleteShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StatusReply) err := c.cc.Invoke(ctx, Share_DeleteShare_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *shareClient) ListShares(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListSharesResponse, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(ListSharesResponse) err := c.cc.Invoke(ctx, Share_ListShares_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } func (c *shareClient) ValidateSharePassword(ctx context.Context, in *ValidateSharePasswordRequest, opts ...grpc.CallOption) (*StatusReply, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(StatusReply) err := c.cc.Invoke(ctx, Share_ValidateSharePassword_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } // ShareServer is the server API for Share service. // All implementations must embed UnimplementedShareServer // for forward compatibility. // // 分享服务 type ShareServer interface { // 创建分享 CreateShare(context.Context, *CreateShareRequest) (*StatusReply, error) // 获取分享详情 GetShare(context.Context, *IdentRequest) (*CloudShareItem, error) // 删除分享 DeleteShare(context.Context, *IdentRequest) (*StatusReply, error) // 获取分享列表 ListShares(context.Context, *FetchRequest) (*ListSharesResponse, error) // 验证分享密码 ValidateSharePassword(context.Context, *ValidateSharePasswordRequest) (*StatusReply, error) mustEmbedUnimplementedShareServer() } // UnimplementedShareServer 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 UnimplementedShareServer struct{} func (UnimplementedShareServer) CreateShare(context.Context, *CreateShareRequest) (*StatusReply, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateShare not implemented") } func (UnimplementedShareServer) GetShare(context.Context, *IdentRequest) (*CloudShareItem, error) { return nil, status.Errorf(codes.Unimplemented, "method GetShare not implemented") } func (UnimplementedShareServer) DeleteShare(context.Context, *IdentRequest) (*StatusReply, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteShare not implemented") } func (UnimplementedShareServer) ListShares(context.Context, *FetchRequest) (*ListSharesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListShares not implemented") } func (UnimplementedShareServer) ValidateSharePassword(context.Context, *ValidateSharePasswordRequest) (*StatusReply, error) { return nil, status.Errorf(codes.Unimplemented, "method ValidateSharePassword not implemented") } func (UnimplementedShareServer) mustEmbedUnimplementedShareServer() {} func (UnimplementedShareServer) testEmbeddedByValue() {} // UnsafeShareServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to ShareServer will // result in compilation errors. type UnsafeShareServer interface { mustEmbedUnimplementedShareServer() } func RegisterShareServer(s grpc.ServiceRegistrar, srv ShareServer) { // If the following call pancis, it indicates UnimplementedShareServer 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(&Share_ServiceDesc, srv) } func _Share_CreateShare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateShareRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShareServer).CreateShare(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: Share_CreateShare_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShareServer).CreateShare(ctx, req.(*CreateShareRequest)) } return interceptor(ctx, in, info, handler) } func _Share_GetShare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdentRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShareServer).GetShare(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: Share_GetShare_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShareServer).GetShare(ctx, req.(*IdentRequest)) } return interceptor(ctx, in, info, handler) } func _Share_DeleteShare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(IdentRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShareServer).DeleteShare(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: Share_DeleteShare_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShareServer).DeleteShare(ctx, req.(*IdentRequest)) } return interceptor(ctx, in, info, handler) } func _Share_ListShares_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.(ShareServer).ListShares(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: Share_ListShares_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShareServer).ListShares(ctx, req.(*FetchRequest)) } return interceptor(ctx, in, info, handler) } func _Share_ValidateSharePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ValidateSharePasswordRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { return srv.(ShareServer).ValidateSharePassword(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, FullMethod: Share_ValidateSharePassword_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShareServer).ValidateSharePassword(ctx, req.(*ValidateSharePasswordRequest)) } return interceptor(ctx, in, info, handler) } // Share_ServiceDesc is the grpc.ServiceDesc for Share service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Share_ServiceDesc = grpc.ServiceDesc{ ServiceName: "cloud.Share", HandlerType: (*ShareServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateShare", Handler: _Share_CreateShare_Handler, }, { MethodName: "GetShare", Handler: _Share_GetShare_Handler, }, { MethodName: "DeleteShare", Handler: _Share_DeleteShare_Handler, }, { MethodName: "ListShares", Handler: _Share_ListShares_Handler, }, { MethodName: "ValidateSharePassword", Handler: _Share_ValidateSharePassword_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "share.proto", }