Files
portmaster/plugin/shared/proto/config_grpc.pb.go
2023-09-22 12:07:28 +02:00

206 lines
7.2 KiB
Go

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.2
// source: config.proto
package proto
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
// ConfigServiceClient is the client API for ConfigService 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 ConfigServiceClient interface {
RegisterOption(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error)
GetValue(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*GetValueResponse, error)
WatchValues(ctx context.Context, in *WatchChangesRequest, opts ...grpc.CallOption) (ConfigService_WatchValuesClient, error)
}
type configServiceClient struct {
cc grpc.ClientConnInterface
}
func NewConfigServiceClient(cc grpc.ClientConnInterface) ConfigServiceClient {
return &configServiceClient{cc}
}
func (c *configServiceClient) RegisterOption(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) {
out := new(RegisterResponse)
err := c.cc.Invoke(ctx, "/safing.portmaster.plugin.proto.ConfigService/RegisterOption", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *configServiceClient) GetValue(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*GetValueResponse, error) {
out := new(GetValueResponse)
err := c.cc.Invoke(ctx, "/safing.portmaster.plugin.proto.ConfigService/GetValue", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *configServiceClient) WatchValues(ctx context.Context, in *WatchChangesRequest, opts ...grpc.CallOption) (ConfigService_WatchValuesClient, error) {
stream, err := c.cc.NewStream(ctx, &ConfigService_ServiceDesc.Streams[0], "/safing.portmaster.plugin.proto.ConfigService/WatchValues", opts...)
if err != nil {
return nil, err
}
x := &configServiceWatchValuesClient{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
}
type ConfigService_WatchValuesClient interface {
Recv() (*WatchChangesResponse, error)
grpc.ClientStream
}
type configServiceWatchValuesClient struct {
grpc.ClientStream
}
func (x *configServiceWatchValuesClient) Recv() (*WatchChangesResponse, error) {
m := new(WatchChangesResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
// ConfigServiceServer is the server API for ConfigService service.
// All implementations must embed UnimplementedConfigServiceServer
// for forward compatibility
type ConfigServiceServer interface {
RegisterOption(context.Context, *RegisterRequest) (*RegisterResponse, error)
GetValue(context.Context, *GetValueRequest) (*GetValueResponse, error)
WatchValues(*WatchChangesRequest, ConfigService_WatchValuesServer) error
mustEmbedUnimplementedConfigServiceServer()
}
// UnimplementedConfigServiceServer must be embedded to have forward compatible implementations.
type UnimplementedConfigServiceServer struct {
}
func (UnimplementedConfigServiceServer) RegisterOption(context.Context, *RegisterRequest) (*RegisterResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterOption not implemented")
}
func (UnimplementedConfigServiceServer) GetValue(context.Context, *GetValueRequest) (*GetValueResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetValue not implemented")
}
func (UnimplementedConfigServiceServer) WatchValues(*WatchChangesRequest, ConfigService_WatchValuesServer) error {
return status.Errorf(codes.Unimplemented, "method WatchValues not implemented")
}
func (UnimplementedConfigServiceServer) mustEmbedUnimplementedConfigServiceServer() {}
// UnsafeConfigServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ConfigServiceServer will
// result in compilation errors.
type UnsafeConfigServiceServer interface {
mustEmbedUnimplementedConfigServiceServer()
}
func RegisterConfigServiceServer(s grpc.ServiceRegistrar, srv ConfigServiceServer) {
s.RegisterService(&ConfigService_ServiceDesc, srv)
}
func _ConfigService_RegisterOption_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RegisterRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConfigServiceServer).RegisterOption(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/safing.portmaster.plugin.proto.ConfigService/RegisterOption",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConfigServiceServer).RegisterOption(ctx, req.(*RegisterRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConfigService_GetValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetValueRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ConfigServiceServer).GetValue(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/safing.portmaster.plugin.proto.ConfigService/GetValue",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ConfigServiceServer).GetValue(ctx, req.(*GetValueRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ConfigService_WatchValues_Handler(srv interface{}, stream grpc.ServerStream) error {
m := new(WatchChangesRequest)
if err := stream.RecvMsg(m); err != nil {
return err
}
return srv.(ConfigServiceServer).WatchValues(m, &configServiceWatchValuesServer{stream})
}
type ConfigService_WatchValuesServer interface {
Send(*WatchChangesResponse) error
grpc.ServerStream
}
type configServiceWatchValuesServer struct {
grpc.ServerStream
}
func (x *configServiceWatchValuesServer) Send(m *WatchChangesResponse) error {
return x.ServerStream.SendMsg(m)
}
// ConfigService_ServiceDesc is the grpc.ServiceDesc for ConfigService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ConfigService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "safing.portmaster.plugin.proto.ConfigService",
HandlerType: (*ConfigServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "RegisterOption",
Handler: _ConfigService_RegisterOption_Handler,
},
{
MethodName: "GetValue",
Handler: _ConfigService_GetValue_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "WatchValues",
Handler: _ConfigService_WatchValues_Handler,
ServerStreams: true,
},
},
Metadata: "config.proto",
}