| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
- // versions:
- // - protoc-gen-go-grpc v1.6.2
- // - protoc v3.12.4
- // source: plugin.proto
- package pluginv1
- 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.64.0 or later.
- const _ = grpc.SupportPackageIsVersion9
- const (
- TransportPlugin_GetInfo_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/GetInfo"
- TransportPlugin_Health_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/Health"
- TransportPlugin_ValidateConfig_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/ValidateConfig"
- TransportPlugin_ApplyConfig_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/ApplyConfig"
- TransportPlugin_TestConfig_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/TestConfig"
- TransportPlugin_Forward_FullMethodName = "/sub2api.plugin.v1.TransportPlugin/Forward"
- )
- // TransportPluginClient is the client API for TransportPlugin 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 TransportPluginClient interface {
- GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error)
- Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error)
- ValidateConfig(ctx context.Context, in *ValidateConfigRequest, opts ...grpc.CallOption) (*ValidateConfigResponse, error)
- ApplyConfig(ctx context.Context, in *ApplyConfigRequest, opts ...grpc.CallOption) (*ApplyConfigResponse, error)
- TestConfig(ctx context.Context, in *TestConfigRequest, opts ...grpc.CallOption) (*TestConfigResponse, error)
- Forward(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ForwardRequest, ForwardResponse], error)
- }
- type transportPluginClient struct {
- cc grpc.ClientConnInterface
- }
- func NewTransportPluginClient(cc grpc.ClientConnInterface) TransportPluginClient {
- return &transportPluginClient{cc}
- }
- func (c *transportPluginClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(GetInfoResponse)
- err := c.cc.Invoke(ctx, TransportPlugin_GetInfo_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *transportPluginClient) Health(ctx context.Context, in *HealthRequest, opts ...grpc.CallOption) (*HealthResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(HealthResponse)
- err := c.cc.Invoke(ctx, TransportPlugin_Health_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *transportPluginClient) ValidateConfig(ctx context.Context, in *ValidateConfigRequest, opts ...grpc.CallOption) (*ValidateConfigResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(ValidateConfigResponse)
- err := c.cc.Invoke(ctx, TransportPlugin_ValidateConfig_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *transportPluginClient) ApplyConfig(ctx context.Context, in *ApplyConfigRequest, opts ...grpc.CallOption) (*ApplyConfigResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(ApplyConfigResponse)
- err := c.cc.Invoke(ctx, TransportPlugin_ApplyConfig_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *transportPluginClient) TestConfig(ctx context.Context, in *TestConfigRequest, opts ...grpc.CallOption) (*TestConfigResponse, error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- out := new(TestConfigResponse)
- err := c.cc.Invoke(ctx, TransportPlugin_TestConfig_FullMethodName, in, out, cOpts...)
- if err != nil {
- return nil, err
- }
- return out, nil
- }
- func (c *transportPluginClient) Forward(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ForwardRequest, ForwardResponse], error) {
- cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
- stream, err := c.cc.NewStream(ctx, &TransportPlugin_ServiceDesc.Streams[0], TransportPlugin_Forward_FullMethodName, cOpts...)
- if err != nil {
- return nil, err
- }
- x := &grpc.GenericClientStream[ForwardRequest, ForwardResponse]{ClientStream: stream}
- return x, nil
- }
- // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
- type TransportPlugin_ForwardClient = grpc.BidiStreamingClient[ForwardRequest, ForwardResponse]
- // TransportPluginServer is the server API for TransportPlugin service.
- // All implementations must embed UnimplementedTransportPluginServer
- // for forward compatibility.
- type TransportPluginServer interface {
- GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
- Health(context.Context, *HealthRequest) (*HealthResponse, error)
- ValidateConfig(context.Context, *ValidateConfigRequest) (*ValidateConfigResponse, error)
- ApplyConfig(context.Context, *ApplyConfigRequest) (*ApplyConfigResponse, error)
- TestConfig(context.Context, *TestConfigRequest) (*TestConfigResponse, error)
- Forward(grpc.BidiStreamingServer[ForwardRequest, ForwardResponse]) error
- mustEmbedUnimplementedTransportPluginServer()
- }
- // UnimplementedTransportPluginServer must be embedded to have
- // forward compatible implementations.
- //
- // NOTE: this should be embedded by value instead of pointer to avoid a nil
- // pointer dereference when methods are called.
- type UnimplementedTransportPluginServer struct{}
- func (UnimplementedTransportPluginServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) {
- return nil, status.Error(codes.Unimplemented, "method GetInfo not implemented")
- }
- func (UnimplementedTransportPluginServer) Health(context.Context, *HealthRequest) (*HealthResponse, error) {
- return nil, status.Error(codes.Unimplemented, "method Health not implemented")
- }
- func (UnimplementedTransportPluginServer) ValidateConfig(context.Context, *ValidateConfigRequest) (*ValidateConfigResponse, error) {
- return nil, status.Error(codes.Unimplemented, "method ValidateConfig not implemented")
- }
- func (UnimplementedTransportPluginServer) ApplyConfig(context.Context, *ApplyConfigRequest) (*ApplyConfigResponse, error) {
- return nil, status.Error(codes.Unimplemented, "method ApplyConfig not implemented")
- }
- func (UnimplementedTransportPluginServer) TestConfig(context.Context, *TestConfigRequest) (*TestConfigResponse, error) {
- return nil, status.Error(codes.Unimplemented, "method TestConfig not implemented")
- }
- func (UnimplementedTransportPluginServer) Forward(grpc.BidiStreamingServer[ForwardRequest, ForwardResponse]) error {
- return status.Error(codes.Unimplemented, "method Forward not implemented")
- }
- func (UnimplementedTransportPluginServer) mustEmbedUnimplementedTransportPluginServer() {}
- func (UnimplementedTransportPluginServer) testEmbeddedByValue() {}
- // UnsafeTransportPluginServer may be embedded to opt out of forward compatibility for this service.
- // Use of this interface is not recommended, as added methods to TransportPluginServer will
- // result in compilation errors.
- type UnsafeTransportPluginServer interface {
- mustEmbedUnimplementedTransportPluginServer()
- }
- func RegisterTransportPluginServer(s grpc.ServiceRegistrar, srv TransportPluginServer) {
- // If the following call panics, it indicates UnimplementedTransportPluginServer was
- // embedded by pointer and is nil. This will cause panics if an
- // unimplemented method is ever invoked, so we test this at initialization
- // time to prevent it from happening at runtime later due to I/O.
- if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
- t.testEmbeddedByValue()
- }
- s.RegisterService(&TransportPlugin_ServiceDesc, srv)
- }
- func _TransportPlugin_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetInfoRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TransportPluginServer).GetInfo(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: TransportPlugin_GetInfo_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TransportPluginServer).GetInfo(ctx, req.(*GetInfoRequest))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _TransportPlugin_Health_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(HealthRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TransportPluginServer).Health(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: TransportPlugin_Health_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TransportPluginServer).Health(ctx, req.(*HealthRequest))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _TransportPlugin_ValidateConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ValidateConfigRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TransportPluginServer).ValidateConfig(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: TransportPlugin_ValidateConfig_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TransportPluginServer).ValidateConfig(ctx, req.(*ValidateConfigRequest))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _TransportPlugin_ApplyConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(ApplyConfigRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TransportPluginServer).ApplyConfig(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: TransportPlugin_ApplyConfig_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TransportPluginServer).ApplyConfig(ctx, req.(*ApplyConfigRequest))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _TransportPlugin_TestConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(TestConfigRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(TransportPluginServer).TestConfig(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: TransportPlugin_TestConfig_FullMethodName,
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(TransportPluginServer).TestConfig(ctx, req.(*TestConfigRequest))
- }
- return interceptor(ctx, in, info, handler)
- }
- func _TransportPlugin_Forward_Handler(srv interface{}, stream grpc.ServerStream) error {
- return srv.(TransportPluginServer).Forward(&grpc.GenericServerStream[ForwardRequest, ForwardResponse]{ServerStream: stream})
- }
- // This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
- type TransportPlugin_ForwardServer = grpc.BidiStreamingServer[ForwardRequest, ForwardResponse]
- // TransportPlugin_ServiceDesc is the grpc.ServiceDesc for TransportPlugin service.
- // It's only intended for direct use with grpc.RegisterService,
- // and not to be introspected or modified (even as a copy)
- var TransportPlugin_ServiceDesc = grpc.ServiceDesc{
- ServiceName: "sub2api.plugin.v1.TransportPlugin",
- HandlerType: (*TransportPluginServer)(nil),
- Methods: []grpc.MethodDesc{
- {
- MethodName: "GetInfo",
- Handler: _TransportPlugin_GetInfo_Handler,
- },
- {
- MethodName: "Health",
- Handler: _TransportPlugin_Health_Handler,
- },
- {
- MethodName: "ValidateConfig",
- Handler: _TransportPlugin_ValidateConfig_Handler,
- },
- {
- MethodName: "ApplyConfig",
- Handler: _TransportPlugin_ApplyConfig_Handler,
- },
- {
- MethodName: "TestConfig",
- Handler: _TransportPlugin_TestConfig_Handler,
- },
- },
- Streams: []grpc.StreamDesc{
- {
- StreamName: "Forward",
- Handler: _TransportPlugin_Forward_Handler,
- ServerStreams: true,
- ClientStreams: true,
- },
- },
- Metadata: "plugin.proto",
- }
|