2023-10-17 14:49:57 +00:00
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.9
// source: pkg/service/control/service.proto
package control
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
// ControlServiceClient is the client API for ControlService 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 ControlServiceClient interface {
// Performs health check of the storage node.
HealthCheck ( ctx context . Context , in * HealthCheckRequest , opts ... grpc . CallOption ) ( * HealthCheckResponse , error )
2023-10-19 13:37:35 +00:00
AddPolicy ( ctx context . Context , in * AddPolicyRequest , opts ... grpc . CallOption ) ( * AddPolicyResponse , error )
2023-11-02 12:23:18 +00:00
PutPolicy ( ctx context . Context , in * PutPolicyRequest , opts ... grpc . CallOption ) ( * PutPolicyResponse , error )
RemovePolicy ( ctx context . Context , in * RemovePolicyRequest , opts ... grpc . CallOption ) ( * RemovePolicyResponse , error )
2023-10-17 14:49:57 +00:00
}
type controlServiceClient struct {
cc grpc . ClientConnInterface
}
func NewControlServiceClient ( cc grpc . ClientConnInterface ) ControlServiceClient {
return & controlServiceClient { cc }
}
func ( c * controlServiceClient ) HealthCheck ( ctx context . Context , in * HealthCheckRequest , opts ... grpc . CallOption ) ( * HealthCheckResponse , error ) {
out := new ( HealthCheckResponse )
err := c . cc . Invoke ( ctx , "/control.ControlService/HealthCheck" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-10-19 13:37:35 +00:00
func ( c * controlServiceClient ) AddPolicy ( ctx context . Context , in * AddPolicyRequest , opts ... grpc . CallOption ) ( * AddPolicyResponse , error ) {
out := new ( AddPolicyResponse )
err := c . cc . Invoke ( ctx , "/control.ControlService/AddPolicy" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-11-02 12:23:18 +00:00
func ( c * controlServiceClient ) PutPolicy ( ctx context . Context , in * PutPolicyRequest , opts ... grpc . CallOption ) ( * PutPolicyResponse , error ) {
out := new ( PutPolicyResponse )
err := c . cc . Invoke ( ctx , "/control.ControlService/PutPolicy" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
func ( c * controlServiceClient ) RemovePolicy ( ctx context . Context , in * RemovePolicyRequest , opts ... grpc . CallOption ) ( * RemovePolicyResponse , error ) {
out := new ( RemovePolicyResponse )
err := c . cc . Invoke ( ctx , "/control.ControlService/RemovePolicy" , in , out , opts ... )
if err != nil {
return nil , err
}
return out , nil
}
2023-10-17 14:49:57 +00:00
// ControlServiceServer is the server API for ControlService service.
// All implementations should embed UnimplementedControlServiceServer
// for forward compatibility
type ControlServiceServer interface {
// Performs health check of the storage node.
HealthCheck ( context . Context , * HealthCheckRequest ) ( * HealthCheckResponse , error )
2023-10-19 13:37:35 +00:00
AddPolicy ( context . Context , * AddPolicyRequest ) ( * AddPolicyResponse , error )
2023-11-02 12:23:18 +00:00
PutPolicy ( context . Context , * PutPolicyRequest ) ( * PutPolicyResponse , error )
RemovePolicy ( context . Context , * RemovePolicyRequest ) ( * RemovePolicyResponse , error )
2023-10-17 14:49:57 +00:00
}
// UnimplementedControlServiceServer should be embedded to have forward compatible implementations.
type UnimplementedControlServiceServer struct {
}
func ( UnimplementedControlServiceServer ) HealthCheck ( context . Context , * HealthCheckRequest ) ( * HealthCheckResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method HealthCheck not implemented" )
}
2023-10-19 13:37:35 +00:00
func ( UnimplementedControlServiceServer ) AddPolicy ( context . Context , * AddPolicyRequest ) ( * AddPolicyResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method AddPolicy not implemented" )
}
2023-11-02 12:23:18 +00:00
func ( UnimplementedControlServiceServer ) PutPolicy ( context . Context , * PutPolicyRequest ) ( * PutPolicyResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method PutPolicy not implemented" )
}
func ( UnimplementedControlServiceServer ) RemovePolicy ( context . Context , * RemovePolicyRequest ) ( * RemovePolicyResponse , error ) {
return nil , status . Errorf ( codes . Unimplemented , "method RemovePolicy not implemented" )
}
2023-10-17 14:49:57 +00:00
// UnsafeControlServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ControlServiceServer will
// result in compilation errors.
type UnsafeControlServiceServer interface {
mustEmbedUnimplementedControlServiceServer ( )
}
func RegisterControlServiceServer ( s grpc . ServiceRegistrar , srv ControlServiceServer ) {
s . RegisterService ( & ControlService_ServiceDesc , srv )
}
func _ControlService_HealthCheck_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( HealthCheckRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ControlServiceServer ) . HealthCheck ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/control.ControlService/HealthCheck" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ControlServiceServer ) . HealthCheck ( ctx , req . ( * HealthCheckRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-10-19 13:37:35 +00:00
func _ControlService_AddPolicy_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( AddPolicyRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ControlServiceServer ) . AddPolicy ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/control.ControlService/AddPolicy" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ControlServiceServer ) . AddPolicy ( ctx , req . ( * AddPolicyRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-11-02 12:23:18 +00:00
func _ControlService_PutPolicy_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( PutPolicyRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ControlServiceServer ) . PutPolicy ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/control.ControlService/PutPolicy" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ControlServiceServer ) . PutPolicy ( ctx , req . ( * PutPolicyRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
func _ControlService_RemovePolicy_Handler ( srv interface { } , ctx context . Context , dec func ( interface { } ) error , interceptor grpc . UnaryServerInterceptor ) ( interface { } , error ) {
in := new ( RemovePolicyRequest )
if err := dec ( in ) ; err != nil {
return nil , err
}
if interceptor == nil {
return srv . ( ControlServiceServer ) . RemovePolicy ( ctx , in )
}
info := & grpc . UnaryServerInfo {
Server : srv ,
FullMethod : "/control.ControlService/RemovePolicy" ,
}
handler := func ( ctx context . Context , req interface { } ) ( interface { } , error ) {
return srv . ( ControlServiceServer ) . RemovePolicy ( ctx , req . ( * RemovePolicyRequest ) )
}
return interceptor ( ctx , in , info , handler )
}
2023-10-17 14:49:57 +00:00
// ControlService_ServiceDesc is the grpc.ServiceDesc for ControlService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ControlService_ServiceDesc = grpc . ServiceDesc {
ServiceName : "control.ControlService" ,
HandlerType : ( * ControlServiceServer ) ( nil ) ,
Methods : [ ] grpc . MethodDesc {
{
MethodName : "HealthCheck" ,
Handler : _ControlService_HealthCheck_Handler ,
} ,
2023-10-19 13:37:35 +00:00
{
MethodName : "AddPolicy" ,
Handler : _ControlService_AddPolicy_Handler ,
} ,
2023-11-02 12:23:18 +00:00
{
MethodName : "PutPolicy" ,
Handler : _ControlService_PutPolicy_Handler ,
} ,
{
MethodName : "RemovePolicy" ,
Handler : _ControlService_RemovePolicy_Handler ,
} ,
2023-10-17 14:49:57 +00:00
} ,
Streams : [ ] grpc . StreamDesc { } ,
Metadata : "pkg/service/control/service.proto" ,
}