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

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  
     3  package api
     4  
     5  import (
     6  	context "context"
     7  	grpc "google.golang.org/grpc"
     8  	codes "google.golang.org/grpc/codes"
     9  	status "google.golang.org/grpc/status"
    10  )
    11  
    12  // This is a compile-time assertion to ensure that this generated file
    13  // is compatible with the grpc package it is being compiled against.
    14  // Requires gRPC-Go v1.32.0 or later.
    15  const _ = grpc.SupportPackageIsVersion7
    16  
    17  // BuiltInGadgetManagerClient is the client API for BuiltInGadgetManager service.
    18  //
    19  // 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.
    20  type BuiltInGadgetManagerClient interface {
    21  	GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error)
    22  	RunBuiltInGadget(ctx context.Context, opts ...grpc.CallOption) (BuiltInGadgetManager_RunBuiltInGadgetClient, error)
    23  }
    24  
    25  type builtInGadgetManagerClient struct {
    26  	cc grpc.ClientConnInterface
    27  }
    28  
    29  func NewBuiltInGadgetManagerClient(cc grpc.ClientConnInterface) BuiltInGadgetManagerClient {
    30  	return &builtInGadgetManagerClient{cc}
    31  }
    32  
    33  func (c *builtInGadgetManagerClient) GetInfo(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) {
    34  	out := new(InfoResponse)
    35  	err := c.cc.Invoke(ctx, "/api.BuiltInGadgetManager/GetInfo", in, out, opts...)
    36  	if err != nil {
    37  		return nil, err
    38  	}
    39  	return out, nil
    40  }
    41  
    42  func (c *builtInGadgetManagerClient) RunBuiltInGadget(ctx context.Context, opts ...grpc.CallOption) (BuiltInGadgetManager_RunBuiltInGadgetClient, error) {
    43  	stream, err := c.cc.NewStream(ctx, &BuiltInGadgetManager_ServiceDesc.Streams[0], "/api.BuiltInGadgetManager/RunBuiltInGadget", opts...)
    44  	if err != nil {
    45  		return nil, err
    46  	}
    47  	x := &builtInGadgetManagerRunBuiltInGadgetClient{stream}
    48  	return x, nil
    49  }
    50  
    51  type BuiltInGadgetManager_RunBuiltInGadgetClient interface {
    52  	Send(*BuiltInGadgetControlRequest) error
    53  	Recv() (*GadgetEvent, error)
    54  	grpc.ClientStream
    55  }
    56  
    57  type builtInGadgetManagerRunBuiltInGadgetClient struct {
    58  	grpc.ClientStream
    59  }
    60  
    61  func (x *builtInGadgetManagerRunBuiltInGadgetClient) Send(m *BuiltInGadgetControlRequest) error {
    62  	return x.ClientStream.SendMsg(m)
    63  }
    64  
    65  func (x *builtInGadgetManagerRunBuiltInGadgetClient) Recv() (*GadgetEvent, error) {
    66  	m := new(GadgetEvent)
    67  	if err := x.ClientStream.RecvMsg(m); err != nil {
    68  		return nil, err
    69  	}
    70  	return m, nil
    71  }
    72  
    73  // BuiltInGadgetManagerServer is the server API for BuiltInGadgetManager service.
    74  // All implementations must embed UnimplementedBuiltInGadgetManagerServer
    75  // for forward compatibility
    76  type BuiltInGadgetManagerServer interface {
    77  	GetInfo(context.Context, *InfoRequest) (*InfoResponse, error)
    78  	RunBuiltInGadget(BuiltInGadgetManager_RunBuiltInGadgetServer) error
    79  	mustEmbedUnimplementedBuiltInGadgetManagerServer()
    80  }
    81  
    82  // UnimplementedBuiltInGadgetManagerServer must be embedded to have forward compatible implementations.
    83  type UnimplementedBuiltInGadgetManagerServer struct {
    84  }
    85  
    86  func (UnimplementedBuiltInGadgetManagerServer) GetInfo(context.Context, *InfoRequest) (*InfoResponse, error) {
    87  	return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented")
    88  }
    89  func (UnimplementedBuiltInGadgetManagerServer) RunBuiltInGadget(BuiltInGadgetManager_RunBuiltInGadgetServer) error {
    90  	return status.Errorf(codes.Unimplemented, "method RunBuiltInGadget not implemented")
    91  }
    92  func (UnimplementedBuiltInGadgetManagerServer) mustEmbedUnimplementedBuiltInGadgetManagerServer() {}
    93  
    94  // UnsafeBuiltInGadgetManagerServer may be embedded to opt out of forward compatibility for this service.
    95  // Use of this interface is not recommended, as added methods to BuiltInGadgetManagerServer will
    96  // result in compilation errors.
    97  type UnsafeBuiltInGadgetManagerServer interface {
    98  	mustEmbedUnimplementedBuiltInGadgetManagerServer()
    99  }
   100  
   101  func RegisterBuiltInGadgetManagerServer(s grpc.ServiceRegistrar, srv BuiltInGadgetManagerServer) {
   102  	s.RegisterService(&BuiltInGadgetManager_ServiceDesc, srv)
   103  }
   104  
   105  func _BuiltInGadgetManager_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   106  	in := new(InfoRequest)
   107  	if err := dec(in); err != nil {
   108  		return nil, err
   109  	}
   110  	if interceptor == nil {
   111  		return srv.(BuiltInGadgetManagerServer).GetInfo(ctx, in)
   112  	}
   113  	info := &grpc.UnaryServerInfo{
   114  		Server:     srv,
   115  		FullMethod: "/api.BuiltInGadgetManager/GetInfo",
   116  	}
   117  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   118  		return srv.(BuiltInGadgetManagerServer).GetInfo(ctx, req.(*InfoRequest))
   119  	}
   120  	return interceptor(ctx, in, info, handler)
   121  }
   122  
   123  func _BuiltInGadgetManager_RunBuiltInGadget_Handler(srv interface{}, stream grpc.ServerStream) error {
   124  	return srv.(BuiltInGadgetManagerServer).RunBuiltInGadget(&builtInGadgetManagerRunBuiltInGadgetServer{stream})
   125  }
   126  
   127  type BuiltInGadgetManager_RunBuiltInGadgetServer interface {
   128  	Send(*GadgetEvent) error
   129  	Recv() (*BuiltInGadgetControlRequest, error)
   130  	grpc.ServerStream
   131  }
   132  
   133  type builtInGadgetManagerRunBuiltInGadgetServer struct {
   134  	grpc.ServerStream
   135  }
   136  
   137  func (x *builtInGadgetManagerRunBuiltInGadgetServer) Send(m *GadgetEvent) error {
   138  	return x.ServerStream.SendMsg(m)
   139  }
   140  
   141  func (x *builtInGadgetManagerRunBuiltInGadgetServer) Recv() (*BuiltInGadgetControlRequest, error) {
   142  	m := new(BuiltInGadgetControlRequest)
   143  	if err := x.ServerStream.RecvMsg(m); err != nil {
   144  		return nil, err
   145  	}
   146  	return m, nil
   147  }
   148  
   149  // BuiltInGadgetManager_ServiceDesc is the grpc.ServiceDesc for BuiltInGadgetManager service.
   150  // It's only intended for direct use with grpc.RegisterService,
   151  // and not to be introspected or modified (even as a copy)
   152  var BuiltInGadgetManager_ServiceDesc = grpc.ServiceDesc{
   153  	ServiceName: "api.BuiltInGadgetManager",
   154  	HandlerType: (*BuiltInGadgetManagerServer)(nil),
   155  	Methods: []grpc.MethodDesc{
   156  		{
   157  			MethodName: "GetInfo",
   158  			Handler:    _BuiltInGadgetManager_GetInfo_Handler,
   159  		},
   160  	},
   161  	Streams: []grpc.StreamDesc{
   162  		{
   163  			StreamName:    "RunBuiltInGadget",
   164  			Handler:       _BuiltInGadgetManager_RunBuiltInGadget_Handler,
   165  			ServerStreams: true,
   166  			ClientStreams: true,
   167  		},
   168  	},
   169  	Metadata: "api/api.proto",
   170  }
   171  
   172  // GadgetManagerClient is the client API for GadgetManager service.
   173  //
   174  // 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.
   175  type GadgetManagerClient interface {
   176  	GetGadgetInfo(ctx context.Context, in *GetGadgetInfoRequest, opts ...grpc.CallOption) (*GetGadgetInfoResponse, error)
   177  	RunGadget(ctx context.Context, opts ...grpc.CallOption) (GadgetManager_RunGadgetClient, error)
   178  }
   179  
   180  type gadgetManagerClient struct {
   181  	cc grpc.ClientConnInterface
   182  }
   183  
   184  func NewGadgetManagerClient(cc grpc.ClientConnInterface) GadgetManagerClient {
   185  	return &gadgetManagerClient{cc}
   186  }
   187  
   188  func (c *gadgetManagerClient) GetGadgetInfo(ctx context.Context, in *GetGadgetInfoRequest, opts ...grpc.CallOption) (*GetGadgetInfoResponse, error) {
   189  	out := new(GetGadgetInfoResponse)
   190  	err := c.cc.Invoke(ctx, "/api.GadgetManager/GetGadgetInfo", in, out, opts...)
   191  	if err != nil {
   192  		return nil, err
   193  	}
   194  	return out, nil
   195  }
   196  
   197  func (c *gadgetManagerClient) RunGadget(ctx context.Context, opts ...grpc.CallOption) (GadgetManager_RunGadgetClient, error) {
   198  	stream, err := c.cc.NewStream(ctx, &GadgetManager_ServiceDesc.Streams[0], "/api.GadgetManager/RunGadget", opts...)
   199  	if err != nil {
   200  		return nil, err
   201  	}
   202  	x := &gadgetManagerRunGadgetClient{stream}
   203  	return x, nil
   204  }
   205  
   206  type GadgetManager_RunGadgetClient interface {
   207  	Send(*GadgetControlRequest) error
   208  	Recv() (*GadgetEvent, error)
   209  	grpc.ClientStream
   210  }
   211  
   212  type gadgetManagerRunGadgetClient struct {
   213  	grpc.ClientStream
   214  }
   215  
   216  func (x *gadgetManagerRunGadgetClient) Send(m *GadgetControlRequest) error {
   217  	return x.ClientStream.SendMsg(m)
   218  }
   219  
   220  func (x *gadgetManagerRunGadgetClient) Recv() (*GadgetEvent, error) {
   221  	m := new(GadgetEvent)
   222  	if err := x.ClientStream.RecvMsg(m); err != nil {
   223  		return nil, err
   224  	}
   225  	return m, nil
   226  }
   227  
   228  // GadgetManagerServer is the server API for GadgetManager service.
   229  // All implementations must embed UnimplementedGadgetManagerServer
   230  // for forward compatibility
   231  type GadgetManagerServer interface {
   232  	GetGadgetInfo(context.Context, *GetGadgetInfoRequest) (*GetGadgetInfoResponse, error)
   233  	RunGadget(GadgetManager_RunGadgetServer) error
   234  	mustEmbedUnimplementedGadgetManagerServer()
   235  }
   236  
   237  // UnimplementedGadgetManagerServer must be embedded to have forward compatible implementations.
   238  type UnimplementedGadgetManagerServer struct {
   239  }
   240  
   241  func (UnimplementedGadgetManagerServer) GetGadgetInfo(context.Context, *GetGadgetInfoRequest) (*GetGadgetInfoResponse, error) {
   242  	return nil, status.Errorf(codes.Unimplemented, "method GetGadgetInfo not implemented")
   243  }
   244  func (UnimplementedGadgetManagerServer) RunGadget(GadgetManager_RunGadgetServer) error {
   245  	return status.Errorf(codes.Unimplemented, "method RunGadget not implemented")
   246  }
   247  func (UnimplementedGadgetManagerServer) mustEmbedUnimplementedGadgetManagerServer() {}
   248  
   249  // UnsafeGadgetManagerServer may be embedded to opt out of forward compatibility for this service.
   250  // Use of this interface is not recommended, as added methods to GadgetManagerServer will
   251  // result in compilation errors.
   252  type UnsafeGadgetManagerServer interface {
   253  	mustEmbedUnimplementedGadgetManagerServer()
   254  }
   255  
   256  func RegisterGadgetManagerServer(s grpc.ServiceRegistrar, srv GadgetManagerServer) {
   257  	s.RegisterService(&GadgetManager_ServiceDesc, srv)
   258  }
   259  
   260  func _GadgetManager_GetGadgetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   261  	in := new(GetGadgetInfoRequest)
   262  	if err := dec(in); err != nil {
   263  		return nil, err
   264  	}
   265  	if interceptor == nil {
   266  		return srv.(GadgetManagerServer).GetGadgetInfo(ctx, in)
   267  	}
   268  	info := &grpc.UnaryServerInfo{
   269  		Server:     srv,
   270  		FullMethod: "/api.GadgetManager/GetGadgetInfo",
   271  	}
   272  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   273  		return srv.(GadgetManagerServer).GetGadgetInfo(ctx, req.(*GetGadgetInfoRequest))
   274  	}
   275  	return interceptor(ctx, in, info, handler)
   276  }
   277  
   278  func _GadgetManager_RunGadget_Handler(srv interface{}, stream grpc.ServerStream) error {
   279  	return srv.(GadgetManagerServer).RunGadget(&gadgetManagerRunGadgetServer{stream})
   280  }
   281  
   282  type GadgetManager_RunGadgetServer interface {
   283  	Send(*GadgetEvent) error
   284  	Recv() (*GadgetControlRequest, error)
   285  	grpc.ServerStream
   286  }
   287  
   288  type gadgetManagerRunGadgetServer struct {
   289  	grpc.ServerStream
   290  }
   291  
   292  func (x *gadgetManagerRunGadgetServer) Send(m *GadgetEvent) error {
   293  	return x.ServerStream.SendMsg(m)
   294  }
   295  
   296  func (x *gadgetManagerRunGadgetServer) Recv() (*GadgetControlRequest, error) {
   297  	m := new(GadgetControlRequest)
   298  	if err := x.ServerStream.RecvMsg(m); err != nil {
   299  		return nil, err
   300  	}
   301  	return m, nil
   302  }
   303  
   304  // GadgetManager_ServiceDesc is the grpc.ServiceDesc for GadgetManager service.
   305  // It's only intended for direct use with grpc.RegisterService,
   306  // and not to be introspected or modified (even as a copy)
   307  var GadgetManager_ServiceDesc = grpc.ServiceDesc{
   308  	ServiceName: "api.GadgetManager",
   309  	HandlerType: (*GadgetManagerServer)(nil),
   310  	Methods: []grpc.MethodDesc{
   311  		{
   312  			MethodName: "GetGadgetInfo",
   313  			Handler:    _GadgetManager_GetGadgetInfo_Handler,
   314  		},
   315  	},
   316  	Streams: []grpc.StreamDesc{
   317  		{
   318  			StreamName:    "RunGadget",
   319  			Handler:       _GadgetManager_RunGadget_Handler,
   320  			ServerStreams: true,
   321  			ClientStreams: true,
   322  		},
   323  	},
   324  	Metadata: "api/api.proto",
   325  }