github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgettracermanager/api/gadgettracermanager_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  
     3  package gadgettracermanager
     4  
     5  import (
     6  	context "context"
     7  
     8  	grpc "google.golang.org/grpc"
     9  	codes "google.golang.org/grpc/codes"
    10  	status "google.golang.org/grpc/status"
    11  )
    12  
    13  // This is a compile-time assertion to ensure that this generated file
    14  // is compatible with the grpc package it is being compiled against.
    15  // Requires gRPC-Go v1.32.0 or later.
    16  const _ = grpc.SupportPackageIsVersion7
    17  
    18  // GadgetTracerManagerClient is the client API for GadgetTracerManager service.
    19  //
    20  // 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.
    21  type GadgetTracerManagerClient interface {
    22  	// Methods called via kubectl-exec
    23  	ReceiveStream(ctx context.Context, in *TracerID, opts ...grpc.CallOption) (GadgetTracerManager_ReceiveStreamClient, error)
    24  	// Methods called by OCI Hooks
    25  	AddContainer(ctx context.Context, in *ContainerDefinition, opts ...grpc.CallOption) (*AddContainerResponse, error)
    26  	RemoveContainer(ctx context.Context, in *ContainerDefinition, opts ...grpc.CallOption) (*RemoveContainerResponse, error)
    27  	// Methods called for debugging
    28  	DumpState(ctx context.Context, in *DumpStateRequest, opts ...grpc.CallOption) (*Dump, error)
    29  }
    30  
    31  type gadgetTracerManagerClient struct {
    32  	cc grpc.ClientConnInterface
    33  }
    34  
    35  func NewGadgetTracerManagerClient(cc grpc.ClientConnInterface) GadgetTracerManagerClient {
    36  	return &gadgetTracerManagerClient{cc}
    37  }
    38  
    39  func (c *gadgetTracerManagerClient) ReceiveStream(ctx context.Context, in *TracerID, opts ...grpc.CallOption) (GadgetTracerManager_ReceiveStreamClient, error) {
    40  	stream, err := c.cc.NewStream(ctx, &GadgetTracerManager_ServiceDesc.Streams[0], "/gadgettracermanager.GadgetTracerManager/ReceiveStream", opts...)
    41  	if err != nil {
    42  		return nil, err
    43  	}
    44  	x := &gadgetTracerManagerReceiveStreamClient{stream}
    45  	if err := x.ClientStream.SendMsg(in); err != nil {
    46  		return nil, err
    47  	}
    48  	if err := x.ClientStream.CloseSend(); err != nil {
    49  		return nil, err
    50  	}
    51  	return x, nil
    52  }
    53  
    54  type GadgetTracerManager_ReceiveStreamClient interface {
    55  	Recv() (*StreamData, error)
    56  	grpc.ClientStream
    57  }
    58  
    59  type gadgetTracerManagerReceiveStreamClient struct {
    60  	grpc.ClientStream
    61  }
    62  
    63  func (x *gadgetTracerManagerReceiveStreamClient) Recv() (*StreamData, error) {
    64  	m := new(StreamData)
    65  	if err := x.ClientStream.RecvMsg(m); err != nil {
    66  		return nil, err
    67  	}
    68  	return m, nil
    69  }
    70  
    71  func (c *gadgetTracerManagerClient) AddContainer(ctx context.Context, in *ContainerDefinition, opts ...grpc.CallOption) (*AddContainerResponse, error) {
    72  	out := new(AddContainerResponse)
    73  	err := c.cc.Invoke(ctx, "/gadgettracermanager.GadgetTracerManager/AddContainer", in, out, opts...)
    74  	if err != nil {
    75  		return nil, err
    76  	}
    77  	return out, nil
    78  }
    79  
    80  func (c *gadgetTracerManagerClient) RemoveContainer(ctx context.Context, in *ContainerDefinition, opts ...grpc.CallOption) (*RemoveContainerResponse, error) {
    81  	out := new(RemoveContainerResponse)
    82  	err := c.cc.Invoke(ctx, "/gadgettracermanager.GadgetTracerManager/RemoveContainer", in, out, opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	return out, nil
    87  }
    88  
    89  func (c *gadgetTracerManagerClient) DumpState(ctx context.Context, in *DumpStateRequest, opts ...grpc.CallOption) (*Dump, error) {
    90  	out := new(Dump)
    91  	err := c.cc.Invoke(ctx, "/gadgettracermanager.GadgetTracerManager/DumpState", in, out, opts...)
    92  	if err != nil {
    93  		return nil, err
    94  	}
    95  	return out, nil
    96  }
    97  
    98  // GadgetTracerManagerServer is the server API for GadgetTracerManager service.
    99  // All implementations must embed UnimplementedGadgetTracerManagerServer
   100  // for forward compatibility
   101  type GadgetTracerManagerServer interface {
   102  	// Methods called via kubectl-exec
   103  	ReceiveStream(*TracerID, GadgetTracerManager_ReceiveStreamServer) error
   104  	// Methods called by OCI Hooks
   105  	AddContainer(context.Context, *ContainerDefinition) (*AddContainerResponse, error)
   106  	RemoveContainer(context.Context, *ContainerDefinition) (*RemoveContainerResponse, error)
   107  	// Methods called for debugging
   108  	DumpState(context.Context, *DumpStateRequest) (*Dump, error)
   109  	mustEmbedUnimplementedGadgetTracerManagerServer()
   110  }
   111  
   112  // UnimplementedGadgetTracerManagerServer must be embedded to have forward compatible implementations.
   113  type UnimplementedGadgetTracerManagerServer struct{}
   114  
   115  func (UnimplementedGadgetTracerManagerServer) ReceiveStream(*TracerID, GadgetTracerManager_ReceiveStreamServer) error {
   116  	return status.Errorf(codes.Unimplemented, "method ReceiveStream not implemented")
   117  }
   118  
   119  func (UnimplementedGadgetTracerManagerServer) AddContainer(context.Context, *ContainerDefinition) (*AddContainerResponse, error) {
   120  	return nil, status.Errorf(codes.Unimplemented, "method AddContainer not implemented")
   121  }
   122  
   123  func (UnimplementedGadgetTracerManagerServer) RemoveContainer(context.Context, *ContainerDefinition) (*RemoveContainerResponse, error) {
   124  	return nil, status.Errorf(codes.Unimplemented, "method RemoveContainer not implemented")
   125  }
   126  
   127  func (UnimplementedGadgetTracerManagerServer) DumpState(context.Context, *DumpStateRequest) (*Dump, error) {
   128  	return nil, status.Errorf(codes.Unimplemented, "method DumpState not implemented")
   129  }
   130  func (UnimplementedGadgetTracerManagerServer) mustEmbedUnimplementedGadgetTracerManagerServer() {}
   131  
   132  // UnsafeGadgetTracerManagerServer may be embedded to opt out of forward compatibility for this service.
   133  // Use of this interface is not recommended, as added methods to GadgetTracerManagerServer will
   134  // result in compilation errors.
   135  type UnsafeGadgetTracerManagerServer interface {
   136  	mustEmbedUnimplementedGadgetTracerManagerServer()
   137  }
   138  
   139  func RegisterGadgetTracerManagerServer(s grpc.ServiceRegistrar, srv GadgetTracerManagerServer) {
   140  	s.RegisterService(&GadgetTracerManager_ServiceDesc, srv)
   141  }
   142  
   143  func _GadgetTracerManager_ReceiveStream_Handler(srv interface{}, stream grpc.ServerStream) error {
   144  	m := new(TracerID)
   145  	if err := stream.RecvMsg(m); err != nil {
   146  		return err
   147  	}
   148  	return srv.(GadgetTracerManagerServer).ReceiveStream(m, &gadgetTracerManagerReceiveStreamServer{stream})
   149  }
   150  
   151  type GadgetTracerManager_ReceiveStreamServer interface {
   152  	Send(*StreamData) error
   153  	grpc.ServerStream
   154  }
   155  
   156  type gadgetTracerManagerReceiveStreamServer struct {
   157  	grpc.ServerStream
   158  }
   159  
   160  func (x *gadgetTracerManagerReceiveStreamServer) Send(m *StreamData) error {
   161  	return x.ServerStream.SendMsg(m)
   162  }
   163  
   164  func _GadgetTracerManager_AddContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   165  	in := new(ContainerDefinition)
   166  	if err := dec(in); err != nil {
   167  		return nil, err
   168  	}
   169  	if interceptor == nil {
   170  		return srv.(GadgetTracerManagerServer).AddContainer(ctx, in)
   171  	}
   172  	info := &grpc.UnaryServerInfo{
   173  		Server:     srv,
   174  		FullMethod: "/gadgettracermanager.GadgetTracerManager/AddContainer",
   175  	}
   176  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   177  		return srv.(GadgetTracerManagerServer).AddContainer(ctx, req.(*ContainerDefinition))
   178  	}
   179  	return interceptor(ctx, in, info, handler)
   180  }
   181  
   182  func _GadgetTracerManager_RemoveContainer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   183  	in := new(ContainerDefinition)
   184  	if err := dec(in); err != nil {
   185  		return nil, err
   186  	}
   187  	if interceptor == nil {
   188  		return srv.(GadgetTracerManagerServer).RemoveContainer(ctx, in)
   189  	}
   190  	info := &grpc.UnaryServerInfo{
   191  		Server:     srv,
   192  		FullMethod: "/gadgettracermanager.GadgetTracerManager/RemoveContainer",
   193  	}
   194  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   195  		return srv.(GadgetTracerManagerServer).RemoveContainer(ctx, req.(*ContainerDefinition))
   196  	}
   197  	return interceptor(ctx, in, info, handler)
   198  }
   199  
   200  func _GadgetTracerManager_DumpState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   201  	in := new(DumpStateRequest)
   202  	if err := dec(in); err != nil {
   203  		return nil, err
   204  	}
   205  	if interceptor == nil {
   206  		return srv.(GadgetTracerManagerServer).DumpState(ctx, in)
   207  	}
   208  	info := &grpc.UnaryServerInfo{
   209  		Server:     srv,
   210  		FullMethod: "/gadgettracermanager.GadgetTracerManager/DumpState",
   211  	}
   212  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   213  		return srv.(GadgetTracerManagerServer).DumpState(ctx, req.(*DumpStateRequest))
   214  	}
   215  	return interceptor(ctx, in, info, handler)
   216  }
   217  
   218  // GadgetTracerManager_ServiceDesc is the grpc.ServiceDesc for GadgetTracerManager service.
   219  // It's only intended for direct use with grpc.RegisterService,
   220  // and not to be introspected or modified (even as a copy)
   221  var GadgetTracerManager_ServiceDesc = grpc.ServiceDesc{
   222  	ServiceName: "gadgettracermanager.GadgetTracerManager",
   223  	HandlerType: (*GadgetTracerManagerServer)(nil),
   224  	Methods: []grpc.MethodDesc{
   225  		{
   226  			MethodName: "AddContainer",
   227  			Handler:    _GadgetTracerManager_AddContainer_Handler,
   228  		},
   229  		{
   230  			MethodName: "RemoveContainer",
   231  			Handler:    _GadgetTracerManager_RemoveContainer_Handler,
   232  		},
   233  		{
   234  			MethodName: "DumpState",
   235  			Handler:    _GadgetTracerManager_DumpState_Handler,
   236  		},
   237  	},
   238  	Streams: []grpc.StreamDesc{
   239  		{
   240  			StreamName:    "ReceiveStream",
   241  			Handler:       _GadgetTracerManager_ReceiveStream_Handler,
   242  			ServerStreams: true,
   243  		},
   244  	},
   245  	Metadata: "api/gadgettracermanager.proto",
   246  }