...

Source file src/github.com/linkerd/linkerd2-proxy-api/go/inbound/inbound_grpc.pb.go

Documentation: github.com/linkerd/linkerd2-proxy-api/go/inbound

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.3.0
     4  // - protoc             v3.20.3
     5  // source: inbound.proto
     6  
     7  package inbound
     8  
     9  import (
    10  	context "context"
    11  	grpc "google.golang.org/grpc"
    12  	codes "google.golang.org/grpc/codes"
    13  	status "google.golang.org/grpc/status"
    14  )
    15  
    16  // This is a compile-time assertion to ensure that this generated file
    17  // is compatible with the grpc package it is being compiled against.
    18  // Requires gRPC-Go v1.32.0 or later.
    19  const _ = grpc.SupportPackageIsVersion7
    20  
    21  const (
    22  	InboundServerPolicies_GetPort_FullMethodName   = "/io.linkerd.proxy.inbound.InboundServerPolicies/GetPort"
    23  	InboundServerPolicies_WatchPort_FullMethodName = "/io.linkerd.proxy.inbound.InboundServerPolicies/WatchPort"
    24  )
    25  
    26  // InboundServerPoliciesClient is the client API for InboundServerPolicies service.
    27  //
    28  // 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.
    29  type InboundServerPoliciesClient interface {
    30  	// / Gets the inbound server policy for a given workload port.
    31  	GetPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (*Server, error)
    32  	// / Watches the inbound server policy for a given workload port.
    33  	WatchPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (InboundServerPolicies_WatchPortClient, error)
    34  }
    35  
    36  type inboundServerPoliciesClient struct {
    37  	cc grpc.ClientConnInterface
    38  }
    39  
    40  func NewInboundServerPoliciesClient(cc grpc.ClientConnInterface) InboundServerPoliciesClient {
    41  	return &inboundServerPoliciesClient{cc}
    42  }
    43  
    44  func (c *inboundServerPoliciesClient) GetPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (*Server, error) {
    45  	out := new(Server)
    46  	err := c.cc.Invoke(ctx, InboundServerPolicies_GetPort_FullMethodName, in, out, opts...)
    47  	if err != nil {
    48  		return nil, err
    49  	}
    50  	return out, nil
    51  }
    52  
    53  func (c *inboundServerPoliciesClient) WatchPort(ctx context.Context, in *PortSpec, opts ...grpc.CallOption) (InboundServerPolicies_WatchPortClient, error) {
    54  	stream, err := c.cc.NewStream(ctx, &InboundServerPolicies_ServiceDesc.Streams[0], InboundServerPolicies_WatchPort_FullMethodName, opts...)
    55  	if err != nil {
    56  		return nil, err
    57  	}
    58  	x := &inboundServerPoliciesWatchPortClient{stream}
    59  	if err := x.ClientStream.SendMsg(in); err != nil {
    60  		return nil, err
    61  	}
    62  	if err := x.ClientStream.CloseSend(); err != nil {
    63  		return nil, err
    64  	}
    65  	return x, nil
    66  }
    67  
    68  type InboundServerPolicies_WatchPortClient interface {
    69  	Recv() (*Server, error)
    70  	grpc.ClientStream
    71  }
    72  
    73  type inboundServerPoliciesWatchPortClient struct {
    74  	grpc.ClientStream
    75  }
    76  
    77  func (x *inboundServerPoliciesWatchPortClient) Recv() (*Server, error) {
    78  	m := new(Server)
    79  	if err := x.ClientStream.RecvMsg(m); err != nil {
    80  		return nil, err
    81  	}
    82  	return m, nil
    83  }
    84  
    85  // InboundServerPoliciesServer is the server API for InboundServerPolicies service.
    86  // All implementations must embed UnimplementedInboundServerPoliciesServer
    87  // for forward compatibility
    88  type InboundServerPoliciesServer interface {
    89  	// / Gets the inbound server policy for a given workload port.
    90  	GetPort(context.Context, *PortSpec) (*Server, error)
    91  	// / Watches the inbound server policy for a given workload port.
    92  	WatchPort(*PortSpec, InboundServerPolicies_WatchPortServer) error
    93  	mustEmbedUnimplementedInboundServerPoliciesServer()
    94  }
    95  
    96  // UnimplementedInboundServerPoliciesServer must be embedded to have forward compatible implementations.
    97  type UnimplementedInboundServerPoliciesServer struct {
    98  }
    99  
   100  func (UnimplementedInboundServerPoliciesServer) GetPort(context.Context, *PortSpec) (*Server, error) {
   101  	return nil, status.Errorf(codes.Unimplemented, "method GetPort not implemented")
   102  }
   103  func (UnimplementedInboundServerPoliciesServer) WatchPort(*PortSpec, InboundServerPolicies_WatchPortServer) error {
   104  	return status.Errorf(codes.Unimplemented, "method WatchPort not implemented")
   105  }
   106  func (UnimplementedInboundServerPoliciesServer) mustEmbedUnimplementedInboundServerPoliciesServer() {}
   107  
   108  // UnsafeInboundServerPoliciesServer may be embedded to opt out of forward compatibility for this service.
   109  // Use of this interface is not recommended, as added methods to InboundServerPoliciesServer will
   110  // result in compilation errors.
   111  type UnsafeInboundServerPoliciesServer interface {
   112  	mustEmbedUnimplementedInboundServerPoliciesServer()
   113  }
   114  
   115  func RegisterInboundServerPoliciesServer(s grpc.ServiceRegistrar, srv InboundServerPoliciesServer) {
   116  	s.RegisterService(&InboundServerPolicies_ServiceDesc, srv)
   117  }
   118  
   119  func _InboundServerPolicies_GetPort_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   120  	in := new(PortSpec)
   121  	if err := dec(in); err != nil {
   122  		return nil, err
   123  	}
   124  	if interceptor == nil {
   125  		return srv.(InboundServerPoliciesServer).GetPort(ctx, in)
   126  	}
   127  	info := &grpc.UnaryServerInfo{
   128  		Server:     srv,
   129  		FullMethod: InboundServerPolicies_GetPort_FullMethodName,
   130  	}
   131  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   132  		return srv.(InboundServerPoliciesServer).GetPort(ctx, req.(*PortSpec))
   133  	}
   134  	return interceptor(ctx, in, info, handler)
   135  }
   136  
   137  func _InboundServerPolicies_WatchPort_Handler(srv interface{}, stream grpc.ServerStream) error {
   138  	m := new(PortSpec)
   139  	if err := stream.RecvMsg(m); err != nil {
   140  		return err
   141  	}
   142  	return srv.(InboundServerPoliciesServer).WatchPort(m, &inboundServerPoliciesWatchPortServer{stream})
   143  }
   144  
   145  type InboundServerPolicies_WatchPortServer interface {
   146  	Send(*Server) error
   147  	grpc.ServerStream
   148  }
   149  
   150  type inboundServerPoliciesWatchPortServer struct {
   151  	grpc.ServerStream
   152  }
   153  
   154  func (x *inboundServerPoliciesWatchPortServer) Send(m *Server) error {
   155  	return x.ServerStream.SendMsg(m)
   156  }
   157  
   158  // InboundServerPolicies_ServiceDesc is the grpc.ServiceDesc for InboundServerPolicies service.
   159  // It's only intended for direct use with grpc.RegisterService,
   160  // and not to be introspected or modified (even as a copy)
   161  var InboundServerPolicies_ServiceDesc = grpc.ServiceDesc{
   162  	ServiceName: "io.linkerd.proxy.inbound.InboundServerPolicies",
   163  	HandlerType: (*InboundServerPoliciesServer)(nil),
   164  	Methods: []grpc.MethodDesc{
   165  		{
   166  			MethodName: "GetPort",
   167  			Handler:    _InboundServerPolicies_GetPort_Handler,
   168  		},
   169  	},
   170  	Streams: []grpc.StreamDesc{
   171  		{
   172  			StreamName:    "WatchPort",
   173  			Handler:       _InboundServerPolicies_WatchPort_Handler,
   174  			ServerStreams: true,
   175  		},
   176  	},
   177  	Metadata: "inbound.proto",
   178  }
   179  

View as plain text