1857 lines
75 KiB
Go
1857 lines
75 KiB
Go
|
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||
|
|
// versions:
|
||
|
|
// - protoc-gen-go-grpc v1.6.1
|
||
|
|
// - protoc v6.32.0
|
||
|
|
// source: cloudprint.proto
|
||
|
|
|
||
|
|
package generated
|
||
|
|
|
||
|
|
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 (
|
||
|
|
AuthService_Login_FullMethodName = "/cloudprint.AuthService/Login"
|
||
|
|
AuthService_RefreshToken_FullMethodName = "/cloudprint.AuthService/RefreshToken"
|
||
|
|
AuthService_GetUserInfo_FullMethodName = "/cloudprint.AuthService/GetUserInfo"
|
||
|
|
AuthService_UpdateUser_FullMethodName = "/cloudprint.AuthService/UpdateUser"
|
||
|
|
)
|
||
|
|
|
||
|
|
// AuthServiceClient is the client API for AuthService 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 AuthServiceClient interface {
|
||
|
|
Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
|
||
|
|
RefreshToken(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error)
|
||
|
|
GetUserInfo(ctx context.Context, in *GetUserInfoRequest, opts ...grpc.CallOption) (*User, error)
|
||
|
|
UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error)
|
||
|
|
}
|
||
|
|
|
||
|
|
type authServiceClient struct {
|
||
|
|
cc grpc.ClientConnInterface
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
|
||
|
|
return &authServiceClient{cc}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *authServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(LoginResponse)
|
||
|
|
err := c.cc.Invoke(ctx, AuthService_Login_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *authServiceClient) RefreshToken(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(RefreshResponse)
|
||
|
|
err := c.cc.Invoke(ctx, AuthService_RefreshToken_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *authServiceClient) GetUserInfo(ctx context.Context, in *GetUserInfoRequest, opts ...grpc.CallOption) (*User, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(User)
|
||
|
|
err := c.cc.Invoke(ctx, AuthService_GetUserInfo_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *authServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(User)
|
||
|
|
err := c.cc.Invoke(ctx, AuthService_UpdateUser_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// AuthServiceServer is the server API for AuthService service.
|
||
|
|
// All implementations must embed UnimplementedAuthServiceServer
|
||
|
|
// for forward compatibility.
|
||
|
|
type AuthServiceServer interface {
|
||
|
|
Login(context.Context, *LoginRequest) (*LoginResponse, error)
|
||
|
|
RefreshToken(context.Context, *RefreshRequest) (*RefreshResponse, error)
|
||
|
|
GetUserInfo(context.Context, *GetUserInfoRequest) (*User, error)
|
||
|
|
UpdateUser(context.Context, *UpdateUserRequest) (*User, error)
|
||
|
|
mustEmbedUnimplementedAuthServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnimplementedAuthServiceServer 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 UnimplementedAuthServiceServer struct{}
|
||
|
|
|
||
|
|
func (UnimplementedAuthServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method Login not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedAuthServiceServer) RefreshToken(context.Context, *RefreshRequest) (*RefreshResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method RefreshToken not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedAuthServiceServer) GetUserInfo(context.Context, *GetUserInfoRequest) (*User, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method GetUserInfo not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedAuthServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method UpdateUser not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
|
||
|
|
func (UnimplementedAuthServiceServer) testEmbeddedByValue() {}
|
||
|
|
|
||
|
|
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
|
||
|
|
// Use of this interface is not recommended, as added methods to AuthServiceServer will
|
||
|
|
// result in compilation errors.
|
||
|
|
type UnsafeAuthServiceServer interface {
|
||
|
|
mustEmbedUnimplementedAuthServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
|
||
|
|
// If the following call panics, it indicates UnimplementedAuthServiceServer 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(&AuthService_ServiceDesc, srv)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _AuthService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(LoginRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(AuthServiceServer).Login(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: AuthService_Login_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(AuthServiceServer).Login(ctx, req.(*LoginRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _AuthService_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(RefreshRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(AuthServiceServer).RefreshToken(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: AuthService_RefreshToken_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(AuthServiceServer).RefreshToken(ctx, req.(*RefreshRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _AuthService_GetUserInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(GetUserInfoRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(AuthServiceServer).GetUserInfo(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: AuthService_GetUserInfo_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(AuthServiceServer).GetUserInfo(ctx, req.(*GetUserInfoRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _AuthService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(UpdateUserRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(AuthServiceServer).UpdateUser(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: AuthService_UpdateUser_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(AuthServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
|
||
|
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
|
// and not to be introspected or modified (even as a copy)
|
||
|
|
var AuthService_ServiceDesc = grpc.ServiceDesc{
|
||
|
|
ServiceName: "cloudprint.AuthService",
|
||
|
|
HandlerType: (*AuthServiceServer)(nil),
|
||
|
|
Methods: []grpc.MethodDesc{
|
||
|
|
{
|
||
|
|
MethodName: "Login",
|
||
|
|
Handler: _AuthService_Login_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "RefreshToken",
|
||
|
|
Handler: _AuthService_RefreshToken_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "GetUserInfo",
|
||
|
|
Handler: _AuthService_GetUserInfo_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "UpdateUser",
|
||
|
|
Handler: _AuthService_UpdateUser_Handler,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Streams: []grpc.StreamDesc{},
|
||
|
|
Metadata: "cloudprint.proto",
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
FileService_Upload_FullMethodName = "/cloudprint.FileService/Upload"
|
||
|
|
FileService_GetFile_FullMethodName = "/cloudprint.FileService/GetFile"
|
||
|
|
FileService_DeleteFile_FullMethodName = "/cloudprint.FileService/DeleteFile"
|
||
|
|
FileService_AddWatermark_FullMethodName = "/cloudprint.FileService/AddWatermark"
|
||
|
|
FileService_GetFileList_FullMethodName = "/cloudprint.FileService/GetFileList"
|
||
|
|
)
|
||
|
|
|
||
|
|
// 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 {
|
||
|
|
Upload(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadRequest, UploadResponse], error)
|
||
|
|
GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FileData], error)
|
||
|
|
DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*Empty, error)
|
||
|
|
AddWatermark(ctx context.Context, in *WatermarkRequest, opts ...grpc.CallOption) (*WatermarkResponse, error)
|
||
|
|
GetFileList(ctx context.Context, in *GetFileListRequest, opts ...grpc.CallOption) (*FileListResponse, error)
|
||
|
|
}
|
||
|
|
|
||
|
|
type fileServiceClient struct {
|
||
|
|
cc grpc.ClientConnInterface
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewFileServiceClient(cc grpc.ClientConnInterface) FileServiceClient {
|
||
|
|
return &fileServiceClient{cc}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *fileServiceClient) Upload(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadRequest, UploadResponse], error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
stream, err := c.cc.NewStream(ctx, &FileService_ServiceDesc.Streams[0], FileService_Upload_FullMethodName, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
x := &grpc.GenericClientStream[UploadRequest, UploadResponse]{ClientStream: stream}
|
||
|
|
return x, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||
|
|
type FileService_UploadClient = grpc.ClientStreamingClient[UploadRequest, UploadResponse]
|
||
|
|
|
||
|
|
func (c *fileServiceClient) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[FileData], error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
stream, err := c.cc.NewStream(ctx, &FileService_ServiceDesc.Streams[1], FileService_GetFile_FullMethodName, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
x := &grpc.GenericClientStream[GetFileRequest, FileData]{ClientStream: stream}
|
||
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return x, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||
|
|
type FileService_GetFileClient = grpc.ServerStreamingClient[FileData]
|
||
|
|
|
||
|
|
func (c *fileServiceClient) DeleteFile(ctx context.Context, in *DeleteFileRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(Empty)
|
||
|
|
err := c.cc.Invoke(ctx, FileService_DeleteFile_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *fileServiceClient) AddWatermark(ctx context.Context, in *WatermarkRequest, opts ...grpc.CallOption) (*WatermarkResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(WatermarkResponse)
|
||
|
|
err := c.cc.Invoke(ctx, FileService_AddWatermark_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *fileServiceClient) GetFileList(ctx context.Context, in *GetFileListRequest, opts ...grpc.CallOption) (*FileListResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(FileListResponse)
|
||
|
|
err := c.cc.Invoke(ctx, FileService_GetFileList_FullMethodName, in, out, cOpts...)
|
||
|
|
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 {
|
||
|
|
Upload(grpc.ClientStreamingServer[UploadRequest, UploadResponse]) error
|
||
|
|
GetFile(*GetFileRequest, grpc.ServerStreamingServer[FileData]) error
|
||
|
|
DeleteFile(context.Context, *DeleteFileRequest) (*Empty, error)
|
||
|
|
AddWatermark(context.Context, *WatermarkRequest) (*WatermarkResponse, error)
|
||
|
|
GetFileList(context.Context, *GetFileListRequest) (*FileListResponse, error)
|
||
|
|
mustEmbedUnimplementedFileServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnimplementedFileServiceServer 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 UnimplementedFileServiceServer struct{}
|
||
|
|
|
||
|
|
func (UnimplementedFileServiceServer) Upload(grpc.ClientStreamingServer[UploadRequest, UploadResponse]) error {
|
||
|
|
return status.Error(codes.Unimplemented, "method Upload not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedFileServiceServer) GetFile(*GetFileRequest, grpc.ServerStreamingServer[FileData]) error {
|
||
|
|
return status.Error(codes.Unimplemented, "method GetFile not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedFileServiceServer) DeleteFile(context.Context, *DeleteFileRequest) (*Empty, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method DeleteFile not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedFileServiceServer) AddWatermark(context.Context, *WatermarkRequest) (*WatermarkResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method AddWatermark not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedFileServiceServer) GetFileList(context.Context, *GetFileListRequest) (*FileListResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method GetFileList not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedFileServiceServer) mustEmbedUnimplementedFileServiceServer() {}
|
||
|
|
func (UnimplementedFileServiceServer) testEmbeddedByValue() {}
|
||
|
|
|
||
|
|
// 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) {
|
||
|
|
// If the following call panics, it indicates UnimplementedFileServiceServer 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(&FileService_ServiceDesc, srv)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _FileService_Upload_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||
|
|
return srv.(FileServiceServer).Upload(&grpc.GenericServerStream[UploadRequest, UploadResponse]{ServerStream: stream})
|
||
|
|
}
|
||
|
|
|
||
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||
|
|
type FileService_UploadServer = grpc.ClientStreamingServer[UploadRequest, UploadResponse]
|
||
|
|
|
||
|
|
func _FileService_GetFile_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||
|
|
m := new(GetFileRequest)
|
||
|
|
if err := stream.RecvMsg(m); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return srv.(FileServiceServer).GetFile(m, &grpc.GenericServerStream[GetFileRequest, FileData]{ServerStream: stream})
|
||
|
|
}
|
||
|
|
|
||
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||
|
|
type FileService_GetFileServer = grpc.ServerStreamingServer[FileData]
|
||
|
|
|
||
|
|
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: FileService_DeleteFile_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(FileServiceServer).DeleteFile(ctx, req.(*DeleteFileRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _FileService_AddWatermark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(WatermarkRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(FileServiceServer).AddWatermark(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: FileService_AddWatermark_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(FileServiceServer).AddWatermark(ctx, req.(*WatermarkRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _FileService_GetFileList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(GetFileListRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(FileServiceServer).GetFileList(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: FileService_GetFileList_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(FileServiceServer).GetFileList(ctx, req.(*GetFileListRequest))
|
||
|
|
}
|
||
|
|
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: "cloudprint.FileService",
|
||
|
|
HandlerType: (*FileServiceServer)(nil),
|
||
|
|
Methods: []grpc.MethodDesc{
|
||
|
|
{
|
||
|
|
MethodName: "DeleteFile",
|
||
|
|
Handler: _FileService_DeleteFile_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "AddWatermark",
|
||
|
|
Handler: _FileService_AddWatermark_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "GetFileList",
|
||
|
|
Handler: _FileService_GetFileList_Handler,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Streams: []grpc.StreamDesc{
|
||
|
|
{
|
||
|
|
StreamName: "Upload",
|
||
|
|
Handler: _FileService_Upload_Handler,
|
||
|
|
ClientStreams: true,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
StreamName: "GetFile",
|
||
|
|
Handler: _FileService_GetFile_Handler,
|
||
|
|
ServerStreams: true,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Metadata: "cloudprint.proto",
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
OrderService_CreateOrder_FullMethodName = "/cloudprint.OrderService/CreateOrder"
|
||
|
|
OrderService_GetOrder_FullMethodName = "/cloudprint.OrderService/GetOrder"
|
||
|
|
OrderService_GetOrderList_FullMethodName = "/cloudprint.OrderService/GetOrderList"
|
||
|
|
OrderService_UpdateOrderStatus_FullMethodName = "/cloudprint.OrderService/UpdateOrderStatus"
|
||
|
|
OrderService_CancelOrder_FullMethodName = "/cloudprint.OrderService/CancelOrder"
|
||
|
|
)
|
||
|
|
|
||
|
|
// OrderServiceClient is the client API for OrderService 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 OrderServiceClient interface {
|
||
|
|
CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderResponse, error)
|
||
|
|
GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*Order, error)
|
||
|
|
GetOrderList(ctx context.Context, in *GetOrderListRequest, opts ...grpc.CallOption) (*OrderListResponse, error)
|
||
|
|
UpdateOrderStatus(ctx context.Context, in *UpdateOrderStatusRequest, opts ...grpc.CallOption) (*Empty, error)
|
||
|
|
CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*Empty, error)
|
||
|
|
}
|
||
|
|
|
||
|
|
type orderServiceClient struct {
|
||
|
|
cc grpc.ClientConnInterface
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewOrderServiceClient(cc grpc.ClientConnInterface) OrderServiceClient {
|
||
|
|
return &orderServiceClient{cc}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *orderServiceClient) CreateOrder(ctx context.Context, in *CreateOrderRequest, opts ...grpc.CallOption) (*CreateOrderResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(CreateOrderResponse)
|
||
|
|
err := c.cc.Invoke(ctx, OrderService_CreateOrder_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *orderServiceClient) GetOrder(ctx context.Context, in *GetOrderRequest, opts ...grpc.CallOption) (*Order, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(Order)
|
||
|
|
err := c.cc.Invoke(ctx, OrderService_GetOrder_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *orderServiceClient) GetOrderList(ctx context.Context, in *GetOrderListRequest, opts ...grpc.CallOption) (*OrderListResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(OrderListResponse)
|
||
|
|
err := c.cc.Invoke(ctx, OrderService_GetOrderList_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *orderServiceClient) UpdateOrderStatus(ctx context.Context, in *UpdateOrderStatusRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(Empty)
|
||
|
|
err := c.cc.Invoke(ctx, OrderService_UpdateOrderStatus_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *orderServiceClient) CancelOrder(ctx context.Context, in *CancelOrderRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(Empty)
|
||
|
|
err := c.cc.Invoke(ctx, OrderService_CancelOrder_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// OrderServiceServer is the server API for OrderService service.
|
||
|
|
// All implementations must embed UnimplementedOrderServiceServer
|
||
|
|
// for forward compatibility.
|
||
|
|
type OrderServiceServer interface {
|
||
|
|
CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error)
|
||
|
|
GetOrder(context.Context, *GetOrderRequest) (*Order, error)
|
||
|
|
GetOrderList(context.Context, *GetOrderListRequest) (*OrderListResponse, error)
|
||
|
|
UpdateOrderStatus(context.Context, *UpdateOrderStatusRequest) (*Empty, error)
|
||
|
|
CancelOrder(context.Context, *CancelOrderRequest) (*Empty, error)
|
||
|
|
mustEmbedUnimplementedOrderServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnimplementedOrderServiceServer 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 UnimplementedOrderServiceServer struct{}
|
||
|
|
|
||
|
|
func (UnimplementedOrderServiceServer) CreateOrder(context.Context, *CreateOrderRequest) (*CreateOrderResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method CreateOrder not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedOrderServiceServer) GetOrder(context.Context, *GetOrderRequest) (*Order, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method GetOrder not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedOrderServiceServer) GetOrderList(context.Context, *GetOrderListRequest) (*OrderListResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method GetOrderList not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedOrderServiceServer) UpdateOrderStatus(context.Context, *UpdateOrderStatusRequest) (*Empty, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method UpdateOrderStatus not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedOrderServiceServer) CancelOrder(context.Context, *CancelOrderRequest) (*Empty, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method CancelOrder not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedOrderServiceServer) mustEmbedUnimplementedOrderServiceServer() {}
|
||
|
|
func (UnimplementedOrderServiceServer) testEmbeddedByValue() {}
|
||
|
|
|
||
|
|
// UnsafeOrderServiceServer may be embedded to opt out of forward compatibility for this service.
|
||
|
|
// Use of this interface is not recommended, as added methods to OrderServiceServer will
|
||
|
|
// result in compilation errors.
|
||
|
|
type UnsafeOrderServiceServer interface {
|
||
|
|
mustEmbedUnimplementedOrderServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer) {
|
||
|
|
// If the following call panics, it indicates UnimplementedOrderServiceServer 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(&OrderService_ServiceDesc, srv)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _OrderService_CreateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(CreateOrderRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(OrderServiceServer).CreateOrder(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: OrderService_CreateOrder_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(OrderServiceServer).CreateOrder(ctx, req.(*CreateOrderRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _OrderService_GetOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(GetOrderRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(OrderServiceServer).GetOrder(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: OrderService_GetOrder_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(OrderServiceServer).GetOrder(ctx, req.(*GetOrderRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _OrderService_GetOrderList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(GetOrderListRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(OrderServiceServer).GetOrderList(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: OrderService_GetOrderList_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(OrderServiceServer).GetOrderList(ctx, req.(*GetOrderListRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _OrderService_UpdateOrderStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(UpdateOrderStatusRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(OrderServiceServer).UpdateOrderStatus(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: OrderService_UpdateOrderStatus_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(OrderServiceServer).UpdateOrderStatus(ctx, req.(*UpdateOrderStatusRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _OrderService_CancelOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(CancelOrderRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(OrderServiceServer).CancelOrder(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: OrderService_CancelOrder_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(OrderServiceServer).CancelOrder(ctx, req.(*CancelOrderRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
// OrderService_ServiceDesc is the grpc.ServiceDesc for OrderService service.
|
||
|
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
|
// and not to be introspected or modified (even as a copy)
|
||
|
|
var OrderService_ServiceDesc = grpc.ServiceDesc{
|
||
|
|
ServiceName: "cloudprint.OrderService",
|
||
|
|
HandlerType: (*OrderServiceServer)(nil),
|
||
|
|
Methods: []grpc.MethodDesc{
|
||
|
|
{
|
||
|
|
MethodName: "CreateOrder",
|
||
|
|
Handler: _OrderService_CreateOrder_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "GetOrder",
|
||
|
|
Handler: _OrderService_GetOrder_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "GetOrderList",
|
||
|
|
Handler: _OrderService_GetOrderList_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "UpdateOrderStatus",
|
||
|
|
Handler: _OrderService_UpdateOrderStatus_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "CancelOrder",
|
||
|
|
Handler: _OrderService_CancelOrder_Handler,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Streams: []grpc.StreamDesc{},
|
||
|
|
Metadata: "cloudprint.proto",
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
PrintService_GetPrinters_FullMethodName = "/cloudprint.PrintService/GetPrinters"
|
||
|
|
PrintService_GetPrinterStatus_FullMethodName = "/cloudprint.PrintService/GetPrinterStatus"
|
||
|
|
PrintService_RegisterPrinter_FullMethodName = "/cloudprint.PrintService/RegisterPrinter"
|
||
|
|
PrintService_PrinterHeartbeat_FullMethodName = "/cloudprint.PrintService/PrinterHeartbeat"
|
||
|
|
PrintService_SubmitPrintJob_FullMethodName = "/cloudprint.PrintService/SubmitPrintJob"
|
||
|
|
PrintService_CancelPrintJob_FullMethodName = "/cloudprint.PrintService/CancelPrintJob"
|
||
|
|
PrintService_SubscribeJobs_FullMethodName = "/cloudprint.PrintService/SubscribeJobs"
|
||
|
|
PrintService_ReportJobStatus_FullMethodName = "/cloudprint.PrintService/ReportJobStatus"
|
||
|
|
)
|
||
|
|
|
||
|
|
// PrintServiceClient is the client API for PrintService 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 PrintServiceClient interface {
|
||
|
|
GetPrinters(ctx context.Context, in *GetPrintersRequest, opts ...grpc.CallOption) (*PrinterListResponse, error)
|
||
|
|
GetPrinterStatus(ctx context.Context, in *GetPrinterStatusRequest, opts ...grpc.CallOption) (*PrinterStatusResponse, error)
|
||
|
|
RegisterPrinter(ctx context.Context, in *RegisterPrinterRequest, opts ...grpc.CallOption) (*RegisterPrinterResponse, error)
|
||
|
|
PrinterHeartbeat(ctx context.Context, in *PrinterHeartbeatRequest, opts ...grpc.CallOption) (*Empty, error)
|
||
|
|
SubmitPrintJob(ctx context.Context, in *SubmitPrintJobRequest, opts ...grpc.CallOption) (*SubmitPrintJobResponse, error)
|
||
|
|
CancelPrintJob(ctx context.Context, in *CancelPrintJobRequest, opts ...grpc.CallOption) (*Empty, error)
|
||
|
|
SubscribeJobs(ctx context.Context, in *SubscribeJobsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PrintJob], error)
|
||
|
|
ReportJobStatus(ctx context.Context, in *ReportJobStatusRequest, opts ...grpc.CallOption) (*Empty, error)
|
||
|
|
}
|
||
|
|
|
||
|
|
type printServiceClient struct {
|
||
|
|
cc grpc.ClientConnInterface
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewPrintServiceClient(cc grpc.ClientConnInterface) PrintServiceClient {
|
||
|
|
return &printServiceClient{cc}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *printServiceClient) GetPrinters(ctx context.Context, in *GetPrintersRequest, opts ...grpc.CallOption) (*PrinterListResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(PrinterListResponse)
|
||
|
|
err := c.cc.Invoke(ctx, PrintService_GetPrinters_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *printServiceClient) GetPrinterStatus(ctx context.Context, in *GetPrinterStatusRequest, opts ...grpc.CallOption) (*PrinterStatusResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(PrinterStatusResponse)
|
||
|
|
err := c.cc.Invoke(ctx, PrintService_GetPrinterStatus_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *printServiceClient) RegisterPrinter(ctx context.Context, in *RegisterPrinterRequest, opts ...grpc.CallOption) (*RegisterPrinterResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(RegisterPrinterResponse)
|
||
|
|
err := c.cc.Invoke(ctx, PrintService_RegisterPrinter_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *printServiceClient) PrinterHeartbeat(ctx context.Context, in *PrinterHeartbeatRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(Empty)
|
||
|
|
err := c.cc.Invoke(ctx, PrintService_PrinterHeartbeat_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *printServiceClient) SubmitPrintJob(ctx context.Context, in *SubmitPrintJobRequest, opts ...grpc.CallOption) (*SubmitPrintJobResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(SubmitPrintJobResponse)
|
||
|
|
err := c.cc.Invoke(ctx, PrintService_SubmitPrintJob_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *printServiceClient) CancelPrintJob(ctx context.Context, in *CancelPrintJobRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(Empty)
|
||
|
|
err := c.cc.Invoke(ctx, PrintService_CancelPrintJob_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *printServiceClient) SubscribeJobs(ctx context.Context, in *SubscribeJobsRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[PrintJob], error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
stream, err := c.cc.NewStream(ctx, &PrintService_ServiceDesc.Streams[0], PrintService_SubscribeJobs_FullMethodName, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
x := &grpc.GenericClientStream[SubscribeJobsRequest, PrintJob]{ClientStream: stream}
|
||
|
|
if err := x.ClientStream.SendMsg(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if err := x.ClientStream.CloseSend(); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return x, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||
|
|
type PrintService_SubscribeJobsClient = grpc.ServerStreamingClient[PrintJob]
|
||
|
|
|
||
|
|
func (c *printServiceClient) ReportJobStatus(ctx context.Context, in *ReportJobStatusRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(Empty)
|
||
|
|
err := c.cc.Invoke(ctx, PrintService_ReportJobStatus_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// PrintServiceServer is the server API for PrintService service.
|
||
|
|
// All implementations must embed UnimplementedPrintServiceServer
|
||
|
|
// for forward compatibility.
|
||
|
|
type PrintServiceServer interface {
|
||
|
|
GetPrinters(context.Context, *GetPrintersRequest) (*PrinterListResponse, error)
|
||
|
|
GetPrinterStatus(context.Context, *GetPrinterStatusRequest) (*PrinterStatusResponse, error)
|
||
|
|
RegisterPrinter(context.Context, *RegisterPrinterRequest) (*RegisterPrinterResponse, error)
|
||
|
|
PrinterHeartbeat(context.Context, *PrinterHeartbeatRequest) (*Empty, error)
|
||
|
|
SubmitPrintJob(context.Context, *SubmitPrintJobRequest) (*SubmitPrintJobResponse, error)
|
||
|
|
CancelPrintJob(context.Context, *CancelPrintJobRequest) (*Empty, error)
|
||
|
|
SubscribeJobs(*SubscribeJobsRequest, grpc.ServerStreamingServer[PrintJob]) error
|
||
|
|
ReportJobStatus(context.Context, *ReportJobStatusRequest) (*Empty, error)
|
||
|
|
mustEmbedUnimplementedPrintServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnimplementedPrintServiceServer 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 UnimplementedPrintServiceServer struct{}
|
||
|
|
|
||
|
|
func (UnimplementedPrintServiceServer) GetPrinters(context.Context, *GetPrintersRequest) (*PrinterListResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method GetPrinters not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPrintServiceServer) GetPrinterStatus(context.Context, *GetPrinterStatusRequest) (*PrinterStatusResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method GetPrinterStatus not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPrintServiceServer) RegisterPrinter(context.Context, *RegisterPrinterRequest) (*RegisterPrinterResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method RegisterPrinter not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPrintServiceServer) PrinterHeartbeat(context.Context, *PrinterHeartbeatRequest) (*Empty, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method PrinterHeartbeat not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPrintServiceServer) SubmitPrintJob(context.Context, *SubmitPrintJobRequest) (*SubmitPrintJobResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method SubmitPrintJob not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPrintServiceServer) CancelPrintJob(context.Context, *CancelPrintJobRequest) (*Empty, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method CancelPrintJob not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPrintServiceServer) SubscribeJobs(*SubscribeJobsRequest, grpc.ServerStreamingServer[PrintJob]) error {
|
||
|
|
return status.Error(codes.Unimplemented, "method SubscribeJobs not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPrintServiceServer) ReportJobStatus(context.Context, *ReportJobStatusRequest) (*Empty, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method ReportJobStatus not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPrintServiceServer) mustEmbedUnimplementedPrintServiceServer() {}
|
||
|
|
func (UnimplementedPrintServiceServer) testEmbeddedByValue() {}
|
||
|
|
|
||
|
|
// UnsafePrintServiceServer may be embedded to opt out of forward compatibility for this service.
|
||
|
|
// Use of this interface is not recommended, as added methods to PrintServiceServer will
|
||
|
|
// result in compilation errors.
|
||
|
|
type UnsafePrintServiceServer interface {
|
||
|
|
mustEmbedUnimplementedPrintServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
func RegisterPrintServiceServer(s grpc.ServiceRegistrar, srv PrintServiceServer) {
|
||
|
|
// If the following call panics, it indicates UnimplementedPrintServiceServer 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(&PrintService_ServiceDesc, srv)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PrintService_GetPrinters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(GetPrintersRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PrintServiceServer).GetPrinters(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PrintService_GetPrinters_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PrintServiceServer).GetPrinters(ctx, req.(*GetPrintersRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PrintService_GetPrinterStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(GetPrinterStatusRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PrintServiceServer).GetPrinterStatus(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PrintService_GetPrinterStatus_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PrintServiceServer).GetPrinterStatus(ctx, req.(*GetPrinterStatusRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PrintService_RegisterPrinter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(RegisterPrinterRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PrintServiceServer).RegisterPrinter(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PrintService_RegisterPrinter_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PrintServiceServer).RegisterPrinter(ctx, req.(*RegisterPrinterRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PrintService_PrinterHeartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(PrinterHeartbeatRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PrintServiceServer).PrinterHeartbeat(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PrintService_PrinterHeartbeat_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PrintServiceServer).PrinterHeartbeat(ctx, req.(*PrinterHeartbeatRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PrintService_SubmitPrintJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(SubmitPrintJobRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PrintServiceServer).SubmitPrintJob(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PrintService_SubmitPrintJob_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PrintServiceServer).SubmitPrintJob(ctx, req.(*SubmitPrintJobRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PrintService_CancelPrintJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(CancelPrintJobRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PrintServiceServer).CancelPrintJob(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PrintService_CancelPrintJob_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PrintServiceServer).CancelPrintJob(ctx, req.(*CancelPrintJobRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PrintService_SubscribeJobs_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||
|
|
m := new(SubscribeJobsRequest)
|
||
|
|
if err := stream.RecvMsg(m); err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return srv.(PrintServiceServer).SubscribeJobs(m, &grpc.GenericServerStream[SubscribeJobsRequest, PrintJob]{ServerStream: stream})
|
||
|
|
}
|
||
|
|
|
||
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||
|
|
type PrintService_SubscribeJobsServer = grpc.ServerStreamingServer[PrintJob]
|
||
|
|
|
||
|
|
func _PrintService_ReportJobStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(ReportJobStatusRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PrintServiceServer).ReportJobStatus(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PrintService_ReportJobStatus_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PrintServiceServer).ReportJobStatus(ctx, req.(*ReportJobStatusRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
// PrintService_ServiceDesc is the grpc.ServiceDesc for PrintService service.
|
||
|
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
|
// and not to be introspected or modified (even as a copy)
|
||
|
|
var PrintService_ServiceDesc = grpc.ServiceDesc{
|
||
|
|
ServiceName: "cloudprint.PrintService",
|
||
|
|
HandlerType: (*PrintServiceServer)(nil),
|
||
|
|
Methods: []grpc.MethodDesc{
|
||
|
|
{
|
||
|
|
MethodName: "GetPrinters",
|
||
|
|
Handler: _PrintService_GetPrinters_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "GetPrinterStatus",
|
||
|
|
Handler: _PrintService_GetPrinterStatus_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "RegisterPrinter",
|
||
|
|
Handler: _PrintService_RegisterPrinter_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "PrinterHeartbeat",
|
||
|
|
Handler: _PrintService_PrinterHeartbeat_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "SubmitPrintJob",
|
||
|
|
Handler: _PrintService_SubmitPrintJob_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "CancelPrintJob",
|
||
|
|
Handler: _PrintService_CancelPrintJob_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "ReportJobStatus",
|
||
|
|
Handler: _PrintService_ReportJobStatus_Handler,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Streams: []grpc.StreamDesc{
|
||
|
|
{
|
||
|
|
StreamName: "SubscribeJobs",
|
||
|
|
Handler: _PrintService_SubscribeJobs_Handler,
|
||
|
|
ServerStreams: true,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Metadata: "cloudprint.proto",
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
LibraryService_GetCategories_FullMethodName = "/cloudprint.LibraryService/GetCategories"
|
||
|
|
LibraryService_GetFiles_FullMethodName = "/cloudprint.LibraryService/GetFiles"
|
||
|
|
LibraryService_UploadFile_FullMethodName = "/cloudprint.LibraryService/UploadFile"
|
||
|
|
LibraryService_DeleteFile_FullMethodName = "/cloudprint.LibraryService/DeleteFile"
|
||
|
|
)
|
||
|
|
|
||
|
|
// LibraryServiceClient is the client API for LibraryService 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 LibraryServiceClient interface {
|
||
|
|
GetCategories(ctx context.Context, in *GetCategoriesRequest, opts ...grpc.CallOption) (*CategoryListResponse, error)
|
||
|
|
GetFiles(ctx context.Context, in *GetLibraryFilesRequest, opts ...grpc.CallOption) (*LibraryFileListResponse, error)
|
||
|
|
UploadFile(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadLibraryFileRequest, UploadLibraryFileResponse], error)
|
||
|
|
DeleteFile(ctx context.Context, in *DeleteLibraryFileRequest, opts ...grpc.CallOption) (*Empty, error)
|
||
|
|
}
|
||
|
|
|
||
|
|
type libraryServiceClient struct {
|
||
|
|
cc grpc.ClientConnInterface
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewLibraryServiceClient(cc grpc.ClientConnInterface) LibraryServiceClient {
|
||
|
|
return &libraryServiceClient{cc}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *libraryServiceClient) GetCategories(ctx context.Context, in *GetCategoriesRequest, opts ...grpc.CallOption) (*CategoryListResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(CategoryListResponse)
|
||
|
|
err := c.cc.Invoke(ctx, LibraryService_GetCategories_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *libraryServiceClient) GetFiles(ctx context.Context, in *GetLibraryFilesRequest, opts ...grpc.CallOption) (*LibraryFileListResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(LibraryFileListResponse)
|
||
|
|
err := c.cc.Invoke(ctx, LibraryService_GetFiles_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *libraryServiceClient) UploadFile(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[UploadLibraryFileRequest, UploadLibraryFileResponse], error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
stream, err := c.cc.NewStream(ctx, &LibraryService_ServiceDesc.Streams[0], LibraryService_UploadFile_FullMethodName, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
x := &grpc.GenericClientStream[UploadLibraryFileRequest, UploadLibraryFileResponse]{ClientStream: stream}
|
||
|
|
return x, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||
|
|
type LibraryService_UploadFileClient = grpc.ClientStreamingClient[UploadLibraryFileRequest, UploadLibraryFileResponse]
|
||
|
|
|
||
|
|
func (c *libraryServiceClient) DeleteFile(ctx context.Context, in *DeleteLibraryFileRequest, opts ...grpc.CallOption) (*Empty, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(Empty)
|
||
|
|
err := c.cc.Invoke(ctx, LibraryService_DeleteFile_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// LibraryServiceServer is the server API for LibraryService service.
|
||
|
|
// All implementations must embed UnimplementedLibraryServiceServer
|
||
|
|
// for forward compatibility.
|
||
|
|
type LibraryServiceServer interface {
|
||
|
|
GetCategories(context.Context, *GetCategoriesRequest) (*CategoryListResponse, error)
|
||
|
|
GetFiles(context.Context, *GetLibraryFilesRequest) (*LibraryFileListResponse, error)
|
||
|
|
UploadFile(grpc.ClientStreamingServer[UploadLibraryFileRequest, UploadLibraryFileResponse]) error
|
||
|
|
DeleteFile(context.Context, *DeleteLibraryFileRequest) (*Empty, error)
|
||
|
|
mustEmbedUnimplementedLibraryServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnimplementedLibraryServiceServer 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 UnimplementedLibraryServiceServer struct{}
|
||
|
|
|
||
|
|
func (UnimplementedLibraryServiceServer) GetCategories(context.Context, *GetCategoriesRequest) (*CategoryListResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method GetCategories not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedLibraryServiceServer) GetFiles(context.Context, *GetLibraryFilesRequest) (*LibraryFileListResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method GetFiles not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedLibraryServiceServer) UploadFile(grpc.ClientStreamingServer[UploadLibraryFileRequest, UploadLibraryFileResponse]) error {
|
||
|
|
return status.Error(codes.Unimplemented, "method UploadFile not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedLibraryServiceServer) DeleteFile(context.Context, *DeleteLibraryFileRequest) (*Empty, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method DeleteFile not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedLibraryServiceServer) mustEmbedUnimplementedLibraryServiceServer() {}
|
||
|
|
func (UnimplementedLibraryServiceServer) testEmbeddedByValue() {}
|
||
|
|
|
||
|
|
// UnsafeLibraryServiceServer may be embedded to opt out of forward compatibility for this service.
|
||
|
|
// Use of this interface is not recommended, as added methods to LibraryServiceServer will
|
||
|
|
// result in compilation errors.
|
||
|
|
type UnsafeLibraryServiceServer interface {
|
||
|
|
mustEmbedUnimplementedLibraryServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
func RegisterLibraryServiceServer(s grpc.ServiceRegistrar, srv LibraryServiceServer) {
|
||
|
|
// If the following call panics, it indicates UnimplementedLibraryServiceServer 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(&LibraryService_ServiceDesc, srv)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _LibraryService_GetCategories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(GetCategoriesRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(LibraryServiceServer).GetCategories(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: LibraryService_GetCategories_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(LibraryServiceServer).GetCategories(ctx, req.(*GetCategoriesRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _LibraryService_GetFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(GetLibraryFilesRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(LibraryServiceServer).GetFiles(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: LibraryService_GetFiles_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(LibraryServiceServer).GetFiles(ctx, req.(*GetLibraryFilesRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _LibraryService_UploadFile_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||
|
|
return srv.(LibraryServiceServer).UploadFile(&grpc.GenericServerStream[UploadLibraryFileRequest, UploadLibraryFileResponse]{ServerStream: stream})
|
||
|
|
}
|
||
|
|
|
||
|
|
// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
|
||
|
|
type LibraryService_UploadFileServer = grpc.ClientStreamingServer[UploadLibraryFileRequest, UploadLibraryFileResponse]
|
||
|
|
|
||
|
|
func _LibraryService_DeleteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(DeleteLibraryFileRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(LibraryServiceServer).DeleteFile(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: LibraryService_DeleteFile_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(LibraryServiceServer).DeleteFile(ctx, req.(*DeleteLibraryFileRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
// LibraryService_ServiceDesc is the grpc.ServiceDesc for LibraryService service.
|
||
|
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
|
// and not to be introspected or modified (even as a copy)
|
||
|
|
var LibraryService_ServiceDesc = grpc.ServiceDesc{
|
||
|
|
ServiceName: "cloudprint.LibraryService",
|
||
|
|
HandlerType: (*LibraryServiceServer)(nil),
|
||
|
|
Methods: []grpc.MethodDesc{
|
||
|
|
{
|
||
|
|
MethodName: "GetCategories",
|
||
|
|
Handler: _LibraryService_GetCategories_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "GetFiles",
|
||
|
|
Handler: _LibraryService_GetFiles_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "DeleteFile",
|
||
|
|
Handler: _LibraryService_DeleteFile_Handler,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Streams: []grpc.StreamDesc{
|
||
|
|
{
|
||
|
|
StreamName: "UploadFile",
|
||
|
|
Handler: _LibraryService_UploadFile_Handler,
|
||
|
|
ClientStreams: true,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Metadata: "cloudprint.proto",
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
PriceService_GetPriceList_FullMethodName = "/cloudprint.PriceService/GetPriceList"
|
||
|
|
PriceService_CreatePriceItem_FullMethodName = "/cloudprint.PriceService/CreatePriceItem"
|
||
|
|
PriceService_UpdatePriceItem_FullMethodName = "/cloudprint.PriceService/UpdatePriceItem"
|
||
|
|
)
|
||
|
|
|
||
|
|
// PriceServiceClient is the client API for PriceService 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 PriceServiceClient interface {
|
||
|
|
GetPriceList(ctx context.Context, in *GetPriceListRequest, opts ...grpc.CallOption) (*PriceListResponse, error)
|
||
|
|
CreatePriceItem(ctx context.Context, in *CreatePriceItemRequest, opts ...grpc.CallOption) (*PriceItem, error)
|
||
|
|
UpdatePriceItem(ctx context.Context, in *UpdatePriceItemRequest, opts ...grpc.CallOption) (*PriceItem, error)
|
||
|
|
}
|
||
|
|
|
||
|
|
type priceServiceClient struct {
|
||
|
|
cc grpc.ClientConnInterface
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewPriceServiceClient(cc grpc.ClientConnInterface) PriceServiceClient {
|
||
|
|
return &priceServiceClient{cc}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *priceServiceClient) GetPriceList(ctx context.Context, in *GetPriceListRequest, opts ...grpc.CallOption) (*PriceListResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(PriceListResponse)
|
||
|
|
err := c.cc.Invoke(ctx, PriceService_GetPriceList_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *priceServiceClient) CreatePriceItem(ctx context.Context, in *CreatePriceItemRequest, opts ...grpc.CallOption) (*PriceItem, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(PriceItem)
|
||
|
|
err := c.cc.Invoke(ctx, PriceService_CreatePriceItem_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *priceServiceClient) UpdatePriceItem(ctx context.Context, in *UpdatePriceItemRequest, opts ...grpc.CallOption) (*PriceItem, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(PriceItem)
|
||
|
|
err := c.cc.Invoke(ctx, PriceService_UpdatePriceItem_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// PriceServiceServer is the server API for PriceService service.
|
||
|
|
// All implementations must embed UnimplementedPriceServiceServer
|
||
|
|
// for forward compatibility.
|
||
|
|
type PriceServiceServer interface {
|
||
|
|
GetPriceList(context.Context, *GetPriceListRequest) (*PriceListResponse, error)
|
||
|
|
CreatePriceItem(context.Context, *CreatePriceItemRequest) (*PriceItem, error)
|
||
|
|
UpdatePriceItem(context.Context, *UpdatePriceItemRequest) (*PriceItem, error)
|
||
|
|
mustEmbedUnimplementedPriceServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnimplementedPriceServiceServer 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 UnimplementedPriceServiceServer struct{}
|
||
|
|
|
||
|
|
func (UnimplementedPriceServiceServer) GetPriceList(context.Context, *GetPriceListRequest) (*PriceListResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method GetPriceList not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPriceServiceServer) CreatePriceItem(context.Context, *CreatePriceItemRequest) (*PriceItem, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method CreatePriceItem not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPriceServiceServer) UpdatePriceItem(context.Context, *UpdatePriceItemRequest) (*PriceItem, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method UpdatePriceItem not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPriceServiceServer) mustEmbedUnimplementedPriceServiceServer() {}
|
||
|
|
func (UnimplementedPriceServiceServer) testEmbeddedByValue() {}
|
||
|
|
|
||
|
|
// UnsafePriceServiceServer may be embedded to opt out of forward compatibility for this service.
|
||
|
|
// Use of this interface is not recommended, as added methods to PriceServiceServer will
|
||
|
|
// result in compilation errors.
|
||
|
|
type UnsafePriceServiceServer interface {
|
||
|
|
mustEmbedUnimplementedPriceServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
func RegisterPriceServiceServer(s grpc.ServiceRegistrar, srv PriceServiceServer) {
|
||
|
|
// If the following call panics, it indicates UnimplementedPriceServiceServer 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(&PriceService_ServiceDesc, srv)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PriceService_GetPriceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(GetPriceListRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PriceServiceServer).GetPriceList(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PriceService_GetPriceList_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PriceServiceServer).GetPriceList(ctx, req.(*GetPriceListRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PriceService_CreatePriceItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(CreatePriceItemRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PriceServiceServer).CreatePriceItem(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PriceService_CreatePriceItem_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PriceServiceServer).CreatePriceItem(ctx, req.(*CreatePriceItemRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PriceService_UpdatePriceItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(UpdatePriceItemRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PriceServiceServer).UpdatePriceItem(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PriceService_UpdatePriceItem_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PriceServiceServer).UpdatePriceItem(ctx, req.(*UpdatePriceItemRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
// PriceService_ServiceDesc is the grpc.ServiceDesc for PriceService service.
|
||
|
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
|
// and not to be introspected or modified (even as a copy)
|
||
|
|
var PriceService_ServiceDesc = grpc.ServiceDesc{
|
||
|
|
ServiceName: "cloudprint.PriceService",
|
||
|
|
HandlerType: (*PriceServiceServer)(nil),
|
||
|
|
Methods: []grpc.MethodDesc{
|
||
|
|
{
|
||
|
|
MethodName: "GetPriceList",
|
||
|
|
Handler: _PriceService_GetPriceList_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "CreatePriceItem",
|
||
|
|
Handler: _PriceService_CreatePriceItem_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "UpdatePriceItem",
|
||
|
|
Handler: _PriceService_UpdatePriceItem_Handler,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Streams: []grpc.StreamDesc{},
|
||
|
|
Metadata: "cloudprint.proto",
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
PayService_CreateWxPayOrder_FullMethodName = "/cloudprint.PayService/CreateWxPayOrder"
|
||
|
|
PayService_QueryPayStatus_FullMethodName = "/cloudprint.PayService/QueryPayStatus"
|
||
|
|
PayService_HandlePayCallback_FullMethodName = "/cloudprint.PayService/HandlePayCallback"
|
||
|
|
PayService_PayByBalance_FullMethodName = "/cloudprint.PayService/PayByBalance"
|
||
|
|
)
|
||
|
|
|
||
|
|
// PayServiceClient is the client API for PayService 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 PayServiceClient interface {
|
||
|
|
CreateWxPayOrder(ctx context.Context, in *WxPayRequest, opts ...grpc.CallOption) (*WxPayResponse, error)
|
||
|
|
QueryPayStatus(ctx context.Context, in *QueryPayStatusRequest, opts ...grpc.CallOption) (*PayStatusResponse, error)
|
||
|
|
HandlePayCallback(ctx context.Context, in *PayCallbackRequest, opts ...grpc.CallOption) (*PayCallbackResponse, error)
|
||
|
|
PayByBalance(ctx context.Context, in *PayByBalanceRequest, opts ...grpc.CallOption) (*StatusResponse, error)
|
||
|
|
}
|
||
|
|
|
||
|
|
type payServiceClient struct {
|
||
|
|
cc grpc.ClientConnInterface
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewPayServiceClient(cc grpc.ClientConnInterface) PayServiceClient {
|
||
|
|
return &payServiceClient{cc}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *payServiceClient) CreateWxPayOrder(ctx context.Context, in *WxPayRequest, opts ...grpc.CallOption) (*WxPayResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(WxPayResponse)
|
||
|
|
err := c.cc.Invoke(ctx, PayService_CreateWxPayOrder_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *payServiceClient) QueryPayStatus(ctx context.Context, in *QueryPayStatusRequest, opts ...grpc.CallOption) (*PayStatusResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(PayStatusResponse)
|
||
|
|
err := c.cc.Invoke(ctx, PayService_QueryPayStatus_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *payServiceClient) HandlePayCallback(ctx context.Context, in *PayCallbackRequest, opts ...grpc.CallOption) (*PayCallbackResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(PayCallbackResponse)
|
||
|
|
err := c.cc.Invoke(ctx, PayService_HandlePayCallback_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *payServiceClient) PayByBalance(ctx context.Context, in *PayByBalanceRequest, opts ...grpc.CallOption) (*StatusResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(StatusResponse)
|
||
|
|
err := c.cc.Invoke(ctx, PayService_PayByBalance_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// PayServiceServer is the server API for PayService service.
|
||
|
|
// All implementations must embed UnimplementedPayServiceServer
|
||
|
|
// for forward compatibility.
|
||
|
|
type PayServiceServer interface {
|
||
|
|
CreateWxPayOrder(context.Context, *WxPayRequest) (*WxPayResponse, error)
|
||
|
|
QueryPayStatus(context.Context, *QueryPayStatusRequest) (*PayStatusResponse, error)
|
||
|
|
HandlePayCallback(context.Context, *PayCallbackRequest) (*PayCallbackResponse, error)
|
||
|
|
PayByBalance(context.Context, *PayByBalanceRequest) (*StatusResponse, error)
|
||
|
|
mustEmbedUnimplementedPayServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnimplementedPayServiceServer 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 UnimplementedPayServiceServer struct{}
|
||
|
|
|
||
|
|
func (UnimplementedPayServiceServer) CreateWxPayOrder(context.Context, *WxPayRequest) (*WxPayResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method CreateWxPayOrder not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPayServiceServer) QueryPayStatus(context.Context, *QueryPayStatusRequest) (*PayStatusResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method QueryPayStatus not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPayServiceServer) HandlePayCallback(context.Context, *PayCallbackRequest) (*PayCallbackResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method HandlePayCallback not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPayServiceServer) PayByBalance(context.Context, *PayByBalanceRequest) (*StatusResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method PayByBalance not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedPayServiceServer) mustEmbedUnimplementedPayServiceServer() {}
|
||
|
|
func (UnimplementedPayServiceServer) testEmbeddedByValue() {}
|
||
|
|
|
||
|
|
// UnsafePayServiceServer may be embedded to opt out of forward compatibility for this service.
|
||
|
|
// Use of this interface is not recommended, as added methods to PayServiceServer will
|
||
|
|
// result in compilation errors.
|
||
|
|
type UnsafePayServiceServer interface {
|
||
|
|
mustEmbedUnimplementedPayServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
func RegisterPayServiceServer(s grpc.ServiceRegistrar, srv PayServiceServer) {
|
||
|
|
// If the following call panics, it indicates UnimplementedPayServiceServer 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(&PayService_ServiceDesc, srv)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PayService_CreateWxPayOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(WxPayRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PayServiceServer).CreateWxPayOrder(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PayService_CreateWxPayOrder_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PayServiceServer).CreateWxPayOrder(ctx, req.(*WxPayRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PayService_QueryPayStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(QueryPayStatusRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PayServiceServer).QueryPayStatus(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PayService_QueryPayStatus_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PayServiceServer).QueryPayStatus(ctx, req.(*QueryPayStatusRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PayService_HandlePayCallback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(PayCallbackRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PayServiceServer).HandlePayCallback(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PayService_HandlePayCallback_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PayServiceServer).HandlePayCallback(ctx, req.(*PayCallbackRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _PayService_PayByBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(PayByBalanceRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(PayServiceServer).PayByBalance(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: PayService_PayByBalance_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(PayServiceServer).PayByBalance(ctx, req.(*PayByBalanceRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
// PayService_ServiceDesc is the grpc.ServiceDesc for PayService service.
|
||
|
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
|
// and not to be introspected or modified (even as a copy)
|
||
|
|
var PayService_ServiceDesc = grpc.ServiceDesc{
|
||
|
|
ServiceName: "cloudprint.PayService",
|
||
|
|
HandlerType: (*PayServiceServer)(nil),
|
||
|
|
Methods: []grpc.MethodDesc{
|
||
|
|
{
|
||
|
|
MethodName: "CreateWxPayOrder",
|
||
|
|
Handler: _PayService_CreateWxPayOrder_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "QueryPayStatus",
|
||
|
|
Handler: _PayService_QueryPayStatus_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "HandlePayCallback",
|
||
|
|
Handler: _PayService_HandlePayCallback_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "PayByBalance",
|
||
|
|
Handler: _PayService_PayByBalance_Handler,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Streams: []grpc.StreamDesc{},
|
||
|
|
Metadata: "cloudprint.proto",
|
||
|
|
}
|
||
|
|
|
||
|
|
const (
|
||
|
|
AdminService_Login_FullMethodName = "/cloudprint.AdminService/Login"
|
||
|
|
AdminService_GetStatistics_FullMethodName = "/cloudprint.AdminService/GetStatistics"
|
||
|
|
)
|
||
|
|
|
||
|
|
// AdminServiceClient is the client API for AdminService 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 AdminServiceClient interface {
|
||
|
|
Login(ctx context.Context, in *AdminLoginRequest, opts ...grpc.CallOption) (*AdminLoginResponse, error)
|
||
|
|
GetStatistics(ctx context.Context, in *GetStatisticsRequest, opts ...grpc.CallOption) (*Statistics, error)
|
||
|
|
}
|
||
|
|
|
||
|
|
type adminServiceClient struct {
|
||
|
|
cc grpc.ClientConnInterface
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewAdminServiceClient(cc grpc.ClientConnInterface) AdminServiceClient {
|
||
|
|
return &adminServiceClient{cc}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *adminServiceClient) Login(ctx context.Context, in *AdminLoginRequest, opts ...grpc.CallOption) (*AdminLoginResponse, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(AdminLoginResponse)
|
||
|
|
err := c.cc.Invoke(ctx, AdminService_Login_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func (c *adminServiceClient) GetStatistics(ctx context.Context, in *GetStatisticsRequest, opts ...grpc.CallOption) (*Statistics, error) {
|
||
|
|
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||
|
|
out := new(Statistics)
|
||
|
|
err := c.cc.Invoke(ctx, AdminService_GetStatistics_FullMethodName, in, out, cOpts...)
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
return out, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// AdminServiceServer is the server API for AdminService service.
|
||
|
|
// All implementations must embed UnimplementedAdminServiceServer
|
||
|
|
// for forward compatibility.
|
||
|
|
type AdminServiceServer interface {
|
||
|
|
Login(context.Context, *AdminLoginRequest) (*AdminLoginResponse, error)
|
||
|
|
GetStatistics(context.Context, *GetStatisticsRequest) (*Statistics, error)
|
||
|
|
mustEmbedUnimplementedAdminServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
// UnimplementedAdminServiceServer 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 UnimplementedAdminServiceServer struct{}
|
||
|
|
|
||
|
|
func (UnimplementedAdminServiceServer) Login(context.Context, *AdminLoginRequest) (*AdminLoginResponse, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method Login not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedAdminServiceServer) GetStatistics(context.Context, *GetStatisticsRequest) (*Statistics, error) {
|
||
|
|
return nil, status.Error(codes.Unimplemented, "method GetStatistics not implemented")
|
||
|
|
}
|
||
|
|
func (UnimplementedAdminServiceServer) mustEmbedUnimplementedAdminServiceServer() {}
|
||
|
|
func (UnimplementedAdminServiceServer) testEmbeddedByValue() {}
|
||
|
|
|
||
|
|
// UnsafeAdminServiceServer may be embedded to opt out of forward compatibility for this service.
|
||
|
|
// Use of this interface is not recommended, as added methods to AdminServiceServer will
|
||
|
|
// result in compilation errors.
|
||
|
|
type UnsafeAdminServiceServer interface {
|
||
|
|
mustEmbedUnimplementedAdminServiceServer()
|
||
|
|
}
|
||
|
|
|
||
|
|
func RegisterAdminServiceServer(s grpc.ServiceRegistrar, srv AdminServiceServer) {
|
||
|
|
// If the following call panics, it indicates UnimplementedAdminServiceServer 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(&AdminService_ServiceDesc, srv)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _AdminService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(AdminLoginRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(AdminServiceServer).Login(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: AdminService_Login_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(AdminServiceServer).Login(ctx, req.(*AdminLoginRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _AdminService_GetStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
|
in := new(GetStatisticsRequest)
|
||
|
|
if err := dec(in); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
if interceptor == nil {
|
||
|
|
return srv.(AdminServiceServer).GetStatistics(ctx, in)
|
||
|
|
}
|
||
|
|
info := &grpc.UnaryServerInfo{
|
||
|
|
Server: srv,
|
||
|
|
FullMethod: AdminService_GetStatistics_FullMethodName,
|
||
|
|
}
|
||
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
|
return srv.(AdminServiceServer).GetStatistics(ctx, req.(*GetStatisticsRequest))
|
||
|
|
}
|
||
|
|
return interceptor(ctx, in, info, handler)
|
||
|
|
}
|
||
|
|
|
||
|
|
// AdminService_ServiceDesc is the grpc.ServiceDesc for AdminService service.
|
||
|
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
|
// and not to be introspected or modified (even as a copy)
|
||
|
|
var AdminService_ServiceDesc = grpc.ServiceDesc{
|
||
|
|
ServiceName: "cloudprint.AdminService",
|
||
|
|
HandlerType: (*AdminServiceServer)(nil),
|
||
|
|
Methods: []grpc.MethodDesc{
|
||
|
|
{
|
||
|
|
MethodName: "Login",
|
||
|
|
Handler: _AdminService_Login_Handler,
|
||
|
|
},
|
||
|
|
{
|
||
|
|
MethodName: "GetStatistics",
|
||
|
|
Handler: _AdminService_GetStatistics_Handler,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
Streams: []grpc.StreamDesc{},
|
||
|
|
Metadata: "cloudprint.proto",
|
||
|
|
}
|