github.com/Asutorufa/yuhaiin@v0.3.6-0.20240502055049-7984da7023a0/pkg/protos/config/grpc/config_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.3.0
     4  // - protoc             v4.25.3
     5  // source: config/grpc/config.proto
     6  
     7  package service
     8  
     9  import (
    10  	context "context"
    11  	config "github.com/Asutorufa/yuhaiin/pkg/protos/config"
    12  	grpc "google.golang.org/grpc"
    13  	codes "google.golang.org/grpc/codes"
    14  	status "google.golang.org/grpc/status"
    15  	emptypb "google.golang.org/protobuf/types/known/emptypb"
    16  )
    17  
    18  // This is a compile-time assertion to ensure that this generated file
    19  // is compatible with the grpc package it is being compiled against.
    20  // Requires gRPC-Go v1.32.0 or later.
    21  const _ = grpc.SupportPackageIsVersion7
    22  
    23  const (
    24  	ConfigService_Load_FullMethodName = "/yuhaiin.protos.config.service.config_service/load"
    25  	ConfigService_Save_FullMethodName = "/yuhaiin.protos.config.service.config_service/save"
    26  	ConfigService_Info_FullMethodName = "/yuhaiin.protos.config.service.config_service/info"
    27  )
    28  
    29  // ConfigServiceClient is the client API for ConfigService service.
    30  //
    31  // 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.
    32  type ConfigServiceClient interface {
    33  	Load(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*config.Setting, error)
    34  	Save(ctx context.Context, in *config.Setting, opts ...grpc.CallOption) (*emptypb.Empty, error)
    35  	Info(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*config.Info, error)
    36  }
    37  
    38  type configServiceClient struct {
    39  	cc grpc.ClientConnInterface
    40  }
    41  
    42  func NewConfigServiceClient(cc grpc.ClientConnInterface) ConfigServiceClient {
    43  	return &configServiceClient{cc}
    44  }
    45  
    46  func (c *configServiceClient) Load(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*config.Setting, error) {
    47  	out := new(config.Setting)
    48  	err := c.cc.Invoke(ctx, ConfigService_Load_FullMethodName, in, out, opts...)
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return out, nil
    53  }
    54  
    55  func (c *configServiceClient) Save(ctx context.Context, in *config.Setting, opts ...grpc.CallOption) (*emptypb.Empty, error) {
    56  	out := new(emptypb.Empty)
    57  	err := c.cc.Invoke(ctx, ConfigService_Save_FullMethodName, in, out, opts...)
    58  	if err != nil {
    59  		return nil, err
    60  	}
    61  	return out, nil
    62  }
    63  
    64  func (c *configServiceClient) Info(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*config.Info, error) {
    65  	out := new(config.Info)
    66  	err := c.cc.Invoke(ctx, ConfigService_Info_FullMethodName, in, out, opts...)
    67  	if err != nil {
    68  		return nil, err
    69  	}
    70  	return out, nil
    71  }
    72  
    73  // ConfigServiceServer is the server API for ConfigService service.
    74  // All implementations must embed UnimplementedConfigServiceServer
    75  // for forward compatibility
    76  type ConfigServiceServer interface {
    77  	Load(context.Context, *emptypb.Empty) (*config.Setting, error)
    78  	Save(context.Context, *config.Setting) (*emptypb.Empty, error)
    79  	Info(context.Context, *emptypb.Empty) (*config.Info, error)
    80  	mustEmbedUnimplementedConfigServiceServer()
    81  }
    82  
    83  // UnimplementedConfigServiceServer must be embedded to have forward compatible implementations.
    84  type UnimplementedConfigServiceServer struct {
    85  }
    86  
    87  func (UnimplementedConfigServiceServer) Load(context.Context, *emptypb.Empty) (*config.Setting, error) {
    88  	return nil, status.Errorf(codes.Unimplemented, "method Load not implemented")
    89  }
    90  func (UnimplementedConfigServiceServer) Save(context.Context, *config.Setting) (*emptypb.Empty, error) {
    91  	return nil, status.Errorf(codes.Unimplemented, "method Save not implemented")
    92  }
    93  func (UnimplementedConfigServiceServer) Info(context.Context, *emptypb.Empty) (*config.Info, error) {
    94  	return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
    95  }
    96  func (UnimplementedConfigServiceServer) mustEmbedUnimplementedConfigServiceServer() {}
    97  
    98  // UnsafeConfigServiceServer may be embedded to opt out of forward compatibility for this service.
    99  // Use of this interface is not recommended, as added methods to ConfigServiceServer will
   100  // result in compilation errors.
   101  type UnsafeConfigServiceServer interface {
   102  	mustEmbedUnimplementedConfigServiceServer()
   103  }
   104  
   105  func RegisterConfigServiceServer(s grpc.ServiceRegistrar, srv ConfigServiceServer) {
   106  	s.RegisterService(&ConfigService_ServiceDesc, srv)
   107  }
   108  
   109  func _ConfigService_Load_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   110  	in := new(emptypb.Empty)
   111  	if err := dec(in); err != nil {
   112  		return nil, err
   113  	}
   114  	if interceptor == nil {
   115  		return srv.(ConfigServiceServer).Load(ctx, in)
   116  	}
   117  	info := &grpc.UnaryServerInfo{
   118  		Server:     srv,
   119  		FullMethod: ConfigService_Load_FullMethodName,
   120  	}
   121  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   122  		return srv.(ConfigServiceServer).Load(ctx, req.(*emptypb.Empty))
   123  	}
   124  	return interceptor(ctx, in, info, handler)
   125  }
   126  
   127  func _ConfigService_Save_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   128  	in := new(config.Setting)
   129  	if err := dec(in); err != nil {
   130  		return nil, err
   131  	}
   132  	if interceptor == nil {
   133  		return srv.(ConfigServiceServer).Save(ctx, in)
   134  	}
   135  	info := &grpc.UnaryServerInfo{
   136  		Server:     srv,
   137  		FullMethod: ConfigService_Save_FullMethodName,
   138  	}
   139  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   140  		return srv.(ConfigServiceServer).Save(ctx, req.(*config.Setting))
   141  	}
   142  	return interceptor(ctx, in, info, handler)
   143  }
   144  
   145  func _ConfigService_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   146  	in := new(emptypb.Empty)
   147  	if err := dec(in); err != nil {
   148  		return nil, err
   149  	}
   150  	if interceptor == nil {
   151  		return srv.(ConfigServiceServer).Info(ctx, in)
   152  	}
   153  	info := &grpc.UnaryServerInfo{
   154  		Server:     srv,
   155  		FullMethod: ConfigService_Info_FullMethodName,
   156  	}
   157  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   158  		return srv.(ConfigServiceServer).Info(ctx, req.(*emptypb.Empty))
   159  	}
   160  	return interceptor(ctx, in, info, handler)
   161  }
   162  
   163  // ConfigService_ServiceDesc is the grpc.ServiceDesc for ConfigService service.
   164  // It's only intended for direct use with grpc.RegisterService,
   165  // and not to be introspected or modified (even as a copy)
   166  var ConfigService_ServiceDesc = grpc.ServiceDesc{
   167  	ServiceName: "yuhaiin.protos.config.service.config_service",
   168  	HandlerType: (*ConfigServiceServer)(nil),
   169  	Methods: []grpc.MethodDesc{
   170  		{
   171  			MethodName: "load",
   172  			Handler:    _ConfigService_Load_Handler,
   173  		},
   174  		{
   175  			MethodName: "save",
   176  			Handler:    _ConfigService_Save_Handler,
   177  		},
   178  		{
   179  			MethodName: "info",
   180  			Handler:    _ConfigService_Info_Handler,
   181  		},
   182  	},
   183  	Streams:  []grpc.StreamDesc{},
   184  	Metadata: "config/grpc/config.proto",
   185  }