2021-01-13 09:06:45 +03:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package service
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.
2021-03-22 08:59:52 +03:00
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc . SupportPackageIsVersion7
2021-01-13 09:06:45 +03:00
// 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 , "/service.Config/Load" , 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 , "/service.Config/Save" , 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 {
}
2021-03-22 08:59:52 +03:00
func ( UnimplementedConfigServer ) Load ( context . Context , * LoadRequest ) ( * LoadResponse , error ) {
2021-01-13 09:06:45 +03:00
return nil , status . Errorf ( codes . Unimplemented , "method Load not implemented" )
}
2021-03-22 08:59:52 +03:00
func ( UnimplementedConfigServer ) Save ( context . Context , * SaveRequest ) ( * SaveResponse , error ) {
2021-01-13 09:06:45 +03:00
return nil , status . Errorf ( codes . Unimplemented , "method Save not implemented" )
}
2021-03-22 08:59:52 +03:00
func ( UnimplementedConfigServer ) mustEmbedUnimplementedConfigServer ( ) { }
2021-01-13 09:06:45 +03:00
2021-03-22 08:59:52 +03:00
// 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 )
2021-01-13 09:06:45 +03:00
}
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 : "/service.Config/Load" ,
}
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 : "/service.Config/Save" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ConfigServer ) . Save ( ctx , req . ( * SaveRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2021-03-22 08:59:52 +03:00
// 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 {
2021-01-13 09:06:45 +03:00
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" ,
}