147 lines
4.7 KiB
Go
147 lines
4.7 KiB
Go
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
|
// versions:
|
|
// - protoc-gen-go-grpc v1.3.0
|
|
// - protoc v3.21.12
|
|
// source: service.proto
|
|
|
|
package servicepb
|
|
|
|
import (
|
|
context "context"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
// Requires gRPC-Go v1.32.0 or later.
|
|
const _ = grpc.SupportPackageIsVersion7
|
|
|
|
const (
|
|
Config_Load_FullMethodName = "/service.Config/Load"
|
|
Config_Save_FullMethodName = "/service.Config/Save"
|
|
)
|
|
|
|
// ConfigClient is the client API for Config 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 ConfigClient interface {
|
|
Load(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*LoadResponse, error)
|
|
Save(ctx context.Context, in *SaveRequest, opts ...grpc.CallOption) (*SaveResponse, error)
|
|
}
|
|
|
|
type configClient struct {
|
|
cc grpc.ClientConnInterface
|
|
}
|
|
|
|
func NewConfigClient(cc grpc.ClientConnInterface) ConfigClient {
|
|
return &configClient{cc}
|
|
}
|
|
|
|
func (c *configClient) Load(ctx context.Context, in *LoadRequest, opts ...grpc.CallOption) (*LoadResponse, error) {
|
|
out := new(LoadResponse)
|
|
err := c.cc.Invoke(ctx, Config_Load_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *configClient) Save(ctx context.Context, in *SaveRequest, opts ...grpc.CallOption) (*SaveResponse, error) {
|
|
out := new(SaveResponse)
|
|
err := c.cc.Invoke(ctx, Config_Save_FullMethodName, in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// ConfigServer is the server API for Config service.
|
|
// All implementations must embed UnimplementedConfigServer
|
|
// for forward compatibility
|
|
type ConfigServer interface {
|
|
Load(context.Context, *LoadRequest) (*LoadResponse, error)
|
|
Save(context.Context, *SaveRequest) (*SaveResponse, error)
|
|
mustEmbedUnimplementedConfigServer()
|
|
}
|
|
|
|
// UnimplementedConfigServer must be embedded to have forward compatible implementations.
|
|
type UnimplementedConfigServer struct {
|
|
}
|
|
|
|
func (UnimplementedConfigServer) Load(context.Context, *LoadRequest) (*LoadResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Load not implemented")
|
|
}
|
|
func (UnimplementedConfigServer) Save(context.Context, *SaveRequest) (*SaveResponse, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method Save not implemented")
|
|
}
|
|
func (UnimplementedConfigServer) mustEmbedUnimplementedConfigServer() {}
|
|
|
|
// UnsafeConfigServer may be embedded to opt out of forward compatibility for this service.
|
|
// Use of this interface is not recommended, as added methods to ConfigServer will
|
|
// result in compilation errors.
|
|
type UnsafeConfigServer interface {
|
|
mustEmbedUnimplementedConfigServer()
|
|
}
|
|
|
|
func RegisterConfigServer(s grpc.ServiceRegistrar, srv ConfigServer) {
|
|
s.RegisterService(&Config_ServiceDesc, srv)
|
|
}
|
|
|
|
func _Config_Load_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(LoadRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ConfigServer).Load(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Config_Load_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ConfigServer).Load(ctx, req.(*LoadRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _Config_Save_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(SaveRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ConfigServer).Save(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: Config_Save_FullMethodName,
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ConfigServer).Save(ctx, req.(*SaveRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
// Config_ServiceDesc is the grpc.ServiceDesc for Config service.
|
|
// It's only intended for direct use with grpc.RegisterService,
|
|
// and not to be introspected or modified (even as a copy)
|
|
var Config_ServiceDesc = grpc.ServiceDesc{
|
|
ServiceName: "service.Config",
|
|
HandlerType: (*ConfigServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Load",
|
|
Handler: _Config_Load_Handler,
|
|
},
|
|
{
|
|
MethodName: "Save",
|
|
Handler: _Config_Save_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "service.proto",
|
|
}
|