720 lines
27 KiB
Go
720 lines
27 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
|
|
package pb
|
|
|
|
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
|
|
|
|
// FileServiceClient is the client API for FileService 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 FileServiceClient interface {
|
|
UploadFile(ctx context.Context, in *UploadFileRequest, opts ...grpc.CallOption) (*UploadFileResponse, error)
|
|
GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*GetFileResponse, error)
|
|
DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*DeleteFileResponse, error)
|
|
ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
|
|
}
|
|
|
|
type fileServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewFileServiceClient(cc grpc.ClientConnInterface) FileServiceClient {
|
|
return &fileServiceClient{cc}
|
|
}
|
|
|
|
func (c *fileServiceClient) UploadFile(ctx context.Context, in *UploadFileRequest, opts ...grpc.CallOption) (*UploadFileResponse, error) {
|
|
out := new(UploadFileResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.FileService/UploadFile", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *fileServiceClient) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*GetFileResponse, error) {
|
|
out := new(GetFileResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.FileService/GetFile", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *fileServiceClient) DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*DeleteFileResponse, error) {
|
|
out := new(DeleteFileResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.FileService/DeleteFile", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *fileServiceClient) ListFiles(ctx context.Context, in *ListFilesRequest, opts ...grpc.CallOption) (*ListFilesResponse, error) {
|
|
out := new(ListFilesResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.FileService/ListFiles", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// FileServiceServer is the server API for FileService service.
|
|
// All implementations must embed UnimplementedFileServiceServer
|
|
// for forward compatibility
|
|
type FileServiceServer interface {
|
|
UploadFile(context.Context, *UploadFileRequest) (*UploadFileResponse, error)
|
|
GetFile(context.Context, *GetFileRequest) (*GetFileResponse, error)
|
|
DeleteFile(context.Context, *DeleteFileRequest) (*DeleteFileResponse, error)
|
|
ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error)
|
|
mustEmbedUnimplementedFileServiceServer()
|
|
}
|
|
|
|
// UnimplementedFileServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedFileServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedFileServiceServer) UploadFile(context.Context, *UploadFileRequest) (*UploadFileResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UploadFile not implemented")
|
|
}
|
|
func (UnimplementedFileServiceServer) GetFile(context.Context, *GetFileRequest) (*GetFileResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetFile not implemented")
|
|
}
|
|
func (UnimplementedFileServiceServer) DeleteFile(context.Context, *DeleteFileRequest) (*DeleteFileResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteFile not implemented")
|
|
}
|
|
func (UnimplementedFileServiceServer) ListFiles(context.Context, *ListFilesRequest) (*ListFilesResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListFiles not implemented")
|
|
}
|
|
func (UnimplementedFileServiceServer) mustEmbedUnimplementedFileServiceServer() {}
|
|
|
|
// UnsafeFileServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to FileServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeFileServiceServer interface {
|
|
mustEmbedUnimplementedFileServiceServer()
|
|
}
|
|
|
|
func RegisterFileServiceServer(s grpc.ServiceRegistrar, srv FileServiceServer) {
|
|
s.RegisterService(&FileService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _FileService_UploadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UploadFileRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(FileServiceServer).UploadFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.FileService/UploadFile",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(FileServiceServer).UploadFile(ctx, req.(*UploadFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _FileService_GetFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetFileRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(FileServiceServer).GetFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.FileService/GetFile",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(FileServiceServer).GetFile(ctx, req.(*GetFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _FileService_DeleteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteFileRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(FileServiceServer).DeleteFile(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.FileService/DeleteFile",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(FileServiceServer).DeleteFile(ctx, req.(*DeleteFileRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _FileService_ListFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListFilesRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(FileServiceServer).ListFiles(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.FileService/ListFiles",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(FileServiceServer).ListFiles(ctx, req.(*ListFilesRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// FileService_ServiceDesc is the grpc.ServiceDesc for FileService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var FileService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "ezshare.FileService",
|
|
HandlerType: (*FileServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "UploadFile",
|
|
Handler: _FileService_UploadFile_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetFile",
|
|
Handler: _FileService_GetFile_Handler,
|
|
},
|
|
{
|
|
MethodName: "DeleteFile",
|
|
Handler: _FileService_DeleteFile_Handler,
|
|
},
|
|
{
|
|
MethodName: "ListFiles",
|
|
Handler: _FileService_ListFiles_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "protos/ezshare.proto",
|
|
}
|
|
|
|
// UserServiceClient is the client API for UserService 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 UserServiceClient interface {
|
|
Register(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error)
|
|
Login(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error)
|
|
List(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)
|
|
Approve(ctx context.Context, in *ApproveUserRequest, opts ...grpc.CallOption) (*Empty, error)
|
|
ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*Empty, error)
|
|
}
|
|
|
|
type userServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
|
|
return &userServiceClient{cc}
|
|
}
|
|
|
|
func (c *userServiceClient) Register(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error) {
|
|
out := new(RegisterUserResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.UserService/Register", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) Login(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error) {
|
|
out := new(LoginUserResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.UserService/Login", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) List(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) {
|
|
out := new(ListUsersResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.UserService/List", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) Approve(ctx context.Context, in *ApproveUserRequest, opts ...grpc.CallOption) (*Empty, error) {
|
|
out := new(Empty)
|
|
err := c.cc.Invoke(ctx, "/ezshare.UserService/Approve", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *userServiceClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*Empty, error) {
|
|
out := new(Empty)
|
|
err := c.cc.Invoke(ctx, "/ezshare.UserService/ChangePassword", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// UserServiceServer is the server API for UserService service.
|
|
// All implementations must embed UnimplementedUserServiceServer
|
|
// for forward compatibility
|
|
type UserServiceServer interface {
|
|
Register(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error)
|
|
Login(context.Context, *LoginUserRequest) (*LoginUserResponse, error)
|
|
List(context.Context, *ListUsersRequest) (*ListUsersResponse, error)
|
|
Approve(context.Context, *ApproveUserRequest) (*Empty, error)
|
|
ChangePassword(context.Context, *ChangePasswordRequest) (*Empty, error)
|
|
mustEmbedUnimplementedUserServiceServer()
|
|
}
|
|
|
|
// UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedUserServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedUserServiceServer) Register(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Register not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) Login(context.Context, *LoginUserRequest) (*LoginUserResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) List(context.Context, *ListUsersRequest) (*ListUsersResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) Approve(context.Context, *ApproveUserRequest) (*Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Approve not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) ChangePassword(context.Context, *ChangePasswordRequest) (*Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented")
|
|
}
|
|
func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {}
|
|
|
|
// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to UserServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeUserServiceServer interface {
|
|
mustEmbedUnimplementedUserServiceServer()
|
|
}
|
|
|
|
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
|
|
s.RegisterService(&UserService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _UserService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RegisterUserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).Register(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.UserService/Register",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).Register(ctx, req.(*RegisterUserRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(LoginUserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).Login(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.UserService/Login",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).Login(ctx, req.(*LoginUserRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ListUsersRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).List(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.UserService/List",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).List(ctx, req.(*ListUsersRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_Approve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ApproveUserRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).Approve(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.UserService/Approve",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).Approve(ctx, req.(*ApproveUserRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _UserService_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(ChangePasswordRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(UserServiceServer).ChangePassword(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.UserService/ChangePassword",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(UserServiceServer).ChangePassword(ctx, req.(*ChangePasswordRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var UserService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "ezshare.UserService",
|
|
HandlerType: (*UserServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Register",
|
|
Handler: _UserService_Register_Handler,
|
|
},
|
|
{
|
|
MethodName: "Login",
|
|
Handler: _UserService_Login_Handler,
|
|
},
|
|
{
|
|
MethodName: "List",
|
|
Handler: _UserService_List_Handler,
|
|
},
|
|
{
|
|
MethodName: "Approve",
|
|
Handler: _UserService_Approve_Handler,
|
|
},
|
|
{
|
|
MethodName: "ChangePassword",
|
|
Handler: _UserService_ChangePassword_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "protos/ezshare.proto",
|
|
}
|
|
|
|
// CertificateServiceClient is the client API for CertificateService 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 CertificateServiceClient interface {
|
|
ListCertificates(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListCertificatesResponse, error)
|
|
RevokeCertificate(ctx context.Context, in *RevokeCertificateRequest, opts ...grpc.CallOption) (*Empty, error)
|
|
}
|
|
|
|
type certificateServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewCertificateServiceClient(cc grpc.ClientConnInterface) CertificateServiceClient {
|
|
return &certificateServiceClient{cc}
|
|
}
|
|
|
|
func (c *certificateServiceClient) ListCertificates(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ListCertificatesResponse, error) {
|
|
out := new(ListCertificatesResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.CertificateService/ListCertificates", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *certificateServiceClient) RevokeCertificate(ctx context.Context, in *RevokeCertificateRequest, opts ...grpc.CallOption) (*Empty, error) {
|
|
out := new(Empty)
|
|
err := c.cc.Invoke(ctx, "/ezshare.CertificateService/RevokeCertificate", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// CertificateServiceServer is the server API for CertificateService service.
|
|
// All implementations must embed UnimplementedCertificateServiceServer
|
|
// for forward compatibility
|
|
type CertificateServiceServer interface {
|
|
ListCertificates(context.Context, *Empty) (*ListCertificatesResponse, error)
|
|
RevokeCertificate(context.Context, *RevokeCertificateRequest) (*Empty, error)
|
|
mustEmbedUnimplementedCertificateServiceServer()
|
|
}
|
|
|
|
// UnimplementedCertificateServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedCertificateServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedCertificateServiceServer) ListCertificates(context.Context, *Empty) (*ListCertificatesResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method ListCertificates not implemented")
|
|
}
|
|
func (UnimplementedCertificateServiceServer) RevokeCertificate(context.Context, *RevokeCertificateRequest) (*Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method RevokeCertificate not implemented")
|
|
}
|
|
func (UnimplementedCertificateServiceServer) mustEmbedUnimplementedCertificateServiceServer() {}
|
|
|
|
// UnsafeCertificateServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to CertificateServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeCertificateServiceServer interface {
|
|
mustEmbedUnimplementedCertificateServiceServer()
|
|
}
|
|
|
|
func RegisterCertificateServiceServer(s grpc.ServiceRegistrar, srv CertificateServiceServer) {
|
|
s.RegisterService(&CertificateService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _CertificateService_ListCertificates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CertificateServiceServer).ListCertificates(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.CertificateService/ListCertificates",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CertificateServiceServer).ListCertificates(ctx, req.(*Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _CertificateService_RevokeCertificate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(RevokeCertificateRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(CertificateServiceServer).RevokeCertificate(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.CertificateService/RevokeCertificate",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(CertificateServiceServer).RevokeCertificate(ctx, req.(*RevokeCertificateRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// CertificateService_ServiceDesc is the grpc.ServiceDesc for CertificateService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var CertificateService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "ezshare.CertificateService",
|
|
HandlerType: (*CertificateServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "ListCertificates",
|
|
Handler: _CertificateService_ListCertificates_Handler,
|
|
},
|
|
{
|
|
MethodName: "RevokeCertificate",
|
|
Handler: _CertificateService_RevokeCertificate_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "protos/ezshare.proto",
|
|
}
|
|
|
|
// BinaryServiceClient is the client API for BinaryService 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 BinaryServiceClient interface {
|
|
UploadBinaries(ctx context.Context, in *UploadBinariesRequest, opts ...grpc.CallOption) (*Empty, error)
|
|
GetBinary(ctx context.Context, in *GetBinaryRequest, opts ...grpc.CallOption) (*Binary, error)
|
|
GetLatestVersion(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*LatestVersionResponse, error)
|
|
}
|
|
|
|
type binaryServiceClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewBinaryServiceClient(cc grpc.ClientConnInterface) BinaryServiceClient {
|
|
return &binaryServiceClient{cc}
|
|
}
|
|
|
|
func (c *binaryServiceClient) UploadBinaries(ctx context.Context, in *UploadBinariesRequest, opts ...grpc.CallOption) (*Empty, error) {
|
|
out := new(Empty)
|
|
err := c.cc.Invoke(ctx, "/ezshare.BinaryService/UploadBinaries", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *binaryServiceClient) GetBinary(ctx context.Context, in *GetBinaryRequest, opts ...grpc.CallOption) (*Binary, error) {
|
|
out := new(Binary)
|
|
err := c.cc.Invoke(ctx, "/ezshare.BinaryService/GetBinary", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *binaryServiceClient) GetLatestVersion(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*LatestVersionResponse, error) {
|
|
out := new(LatestVersionResponse)
|
|
err := c.cc.Invoke(ctx, "/ezshare.BinaryService/GetLatestVersion", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// BinaryServiceServer is the server API for BinaryService service.
|
|
// All implementations must embed UnimplementedBinaryServiceServer
|
|
// for forward compatibility
|
|
type BinaryServiceServer interface {
|
|
UploadBinaries(context.Context, *UploadBinariesRequest) (*Empty, error)
|
|
GetBinary(context.Context, *GetBinaryRequest) (*Binary, error)
|
|
GetLatestVersion(context.Context, *Empty) (*LatestVersionResponse, error)
|
|
mustEmbedUnimplementedBinaryServiceServer()
|
|
}
|
|
|
|
// UnimplementedBinaryServiceServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedBinaryServiceServer struct {
|
|
}
|
|
|
|
func (UnimplementedBinaryServiceServer) UploadBinaries(context.Context, *UploadBinariesRequest) (*Empty, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method UploadBinaries not implemented")
|
|
}
|
|
func (UnimplementedBinaryServiceServer) GetBinary(context.Context, *GetBinaryRequest) (*Binary, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetBinary not implemented")
|
|
}
|
|
func (UnimplementedBinaryServiceServer) GetLatestVersion(context.Context, *Empty) (*LatestVersionResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method GetLatestVersion not implemented")
|
|
}
|
|
func (UnimplementedBinaryServiceServer) mustEmbedUnimplementedBinaryServiceServer() {}
|
|
|
|
// UnsafeBinaryServiceServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to BinaryServiceServer will
|
|
// result in compilation errors.
|
|
type UnsafeBinaryServiceServer interface {
|
|
mustEmbedUnimplementedBinaryServiceServer()
|
|
}
|
|
|
|
func RegisterBinaryServiceServer(s grpc.ServiceRegistrar, srv BinaryServiceServer) {
|
|
s.RegisterService(&BinaryService_ServiceDesc, srv)
|
|
}
|
|
|
|
func _BinaryService_UploadBinaries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UploadBinariesRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BinaryServiceServer).UploadBinaries(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.BinaryService/UploadBinaries",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BinaryServiceServer).UploadBinaries(ctx, req.(*UploadBinariesRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BinaryService_GetBinary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetBinaryRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BinaryServiceServer).GetBinary(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.BinaryService/GetBinary",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BinaryServiceServer).GetBinary(ctx, req.(*GetBinaryRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _BinaryService_GetLatestVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Empty)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(BinaryServiceServer).GetLatestVersion(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/ezshare.BinaryService/GetLatestVersion",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(BinaryServiceServer).GetLatestVersion(ctx, req.(*Empty))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// BinaryService_ServiceDesc is the grpc.ServiceDesc for BinaryService service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var BinaryService_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "ezshare.BinaryService",
|
|
HandlerType: (*BinaryServiceServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "UploadBinaries",
|
|
Handler: _BinaryService_UploadBinaries_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetBinary",
|
|
Handler: _BinaryService_GetBinary_Handler,
|
|
},
|
|
{
|
|
MethodName: "GetLatestVersion",
|
|
Handler: _BinaryService_GetLatestVersion_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "protos/ezshare.proto",
|
|
}
|