...

Source file src/github.com/linkerd/linkerd2-proxy-api/go/outbound/outbound_grpc.pb.go

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

     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: outbound.proto
     6  
     7  package outbound
     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  	OutboundPolicies_Get_FullMethodName   = "/io.linkerd.proxy.outbound.OutboundPolicies/Get"
    23  	OutboundPolicies_Watch_FullMethodName = "/io.linkerd.proxy.outbound.OutboundPolicies/Watch"
    24  )
    25  
    26  // OutboundPoliciesClient is the client API for OutboundPolicies 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 OutboundPoliciesClient interface {
    30  	Get(ctx context.Context, in *TrafficSpec, opts ...grpc.CallOption) (*OutboundPolicy, error)
    31  	Watch(ctx context.Context, in *TrafficSpec, opts ...grpc.CallOption) (OutboundPolicies_WatchClient, error)
    32  }
    33  
    34  type outboundPoliciesClient struct {
    35  	cc grpc.ClientConnInterface
    36  }
    37  
    38  func NewOutboundPoliciesClient(cc grpc.ClientConnInterface) OutboundPoliciesClient {
    39  	return &outboundPoliciesClient{cc}
    40  }
    41  
    42  func (c *outboundPoliciesClient) Get(ctx context.Context, in *TrafficSpec, opts ...grpc.CallOption) (*OutboundPolicy, error) {
    43  	out := new(OutboundPolicy)
    44  	err := c.cc.Invoke(ctx, OutboundPolicies_Get_FullMethodName, in, out, opts...)
    45  	if err != nil {
    46  		return nil, err
    47  	}
    48  	return out, nil
    49  }
    50  
    51  func (c *outboundPoliciesClient) Watch(ctx context.Context, in *TrafficSpec, opts ...grpc.CallOption) (OutboundPolicies_WatchClient, error) {
    52  	stream, err := c.cc.NewStream(ctx, &OutboundPolicies_ServiceDesc.Streams[0], OutboundPolicies_Watch_FullMethodName, opts...)
    53  	if err != nil {
    54  		return nil, err
    55  	}
    56  	x := &outboundPoliciesWatchClient{stream}
    57  	if err := x.ClientStream.SendMsg(in); err != nil {
    58  		return nil, err
    59  	}
    60  	if err := x.ClientStream.CloseSend(); err != nil {
    61  		return nil, err
    62  	}
    63  	return x, nil
    64  }
    65  
    66  type OutboundPolicies_WatchClient interface {
    67  	Recv() (*OutboundPolicy, error)
    68  	grpc.ClientStream
    69  }
    70  
    71  type outboundPoliciesWatchClient struct {
    72  	grpc.ClientStream
    73  }
    74  
    75  func (x *outboundPoliciesWatchClient) Recv() (*OutboundPolicy, error) {
    76  	m := new(OutboundPolicy)
    77  	if err := x.ClientStream.RecvMsg(m); err != nil {
    78  		return nil, err
    79  	}
    80  	return m, nil
    81  }
    82  
    83  // OutboundPoliciesServer is the server API for OutboundPolicies service.
    84  // All implementations must embed UnimplementedOutboundPoliciesServer
    85  // for forward compatibility
    86  type OutboundPoliciesServer interface {
    87  	Get(context.Context, *TrafficSpec) (*OutboundPolicy, error)
    88  	Watch(*TrafficSpec, OutboundPolicies_WatchServer) error
    89  	mustEmbedUnimplementedOutboundPoliciesServer()
    90  }
    91  
    92  // UnimplementedOutboundPoliciesServer must be embedded to have forward compatible implementations.
    93  type UnimplementedOutboundPoliciesServer struct {
    94  }
    95  
    96  func (UnimplementedOutboundPoliciesServer) Get(context.Context, *TrafficSpec) (*OutboundPolicy, error) {
    97  	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
    98  }
    99  func (UnimplementedOutboundPoliciesServer) Watch(*TrafficSpec, OutboundPolicies_WatchServer) error {
   100  	return status.Errorf(codes.Unimplemented, "method Watch not implemented")
   101  }
   102  func (UnimplementedOutboundPoliciesServer) mustEmbedUnimplementedOutboundPoliciesServer() {}
   103  
   104  // UnsafeOutboundPoliciesServer may be embedded to opt out of forward compatibility for this service.
   105  // Use of this interface is not recommended, as added methods to OutboundPoliciesServer will
   106  // result in compilation errors.
   107  type UnsafeOutboundPoliciesServer interface {
   108  	mustEmbedUnimplementedOutboundPoliciesServer()
   109  }
   110  
   111  func RegisterOutboundPoliciesServer(s grpc.ServiceRegistrar, srv OutboundPoliciesServer) {
   112  	s.RegisterService(&OutboundPolicies_ServiceDesc, srv)
   113  }
   114  
   115  func _OutboundPolicies_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   116  	in := new(TrafficSpec)
   117  	if err := dec(in); err != nil {
   118  		return nil, err
   119  	}
   120  	if interceptor == nil {
   121  		return srv.(OutboundPoliciesServer).Get(ctx, in)
   122  	}
   123  	info := &grpc.UnaryServerInfo{
   124  		Server:     srv,
   125  		FullMethod: OutboundPolicies_Get_FullMethodName,
   126  	}
   127  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   128  		return srv.(OutboundPoliciesServer).Get(ctx, req.(*TrafficSpec))
   129  	}
   130  	return interceptor(ctx, in, info, handler)
   131  }
   132  
   133  func _OutboundPolicies_Watch_Handler(srv interface{}, stream grpc.ServerStream) error {
   134  	m := new(TrafficSpec)
   135  	if err := stream.RecvMsg(m); err != nil {
   136  		return err
   137  	}
   138  	return srv.(OutboundPoliciesServer).Watch(m, &outboundPoliciesWatchServer{stream})
   139  }
   140  
   141  type OutboundPolicies_WatchServer interface {
   142  	Send(*OutboundPolicy) error
   143  	grpc.ServerStream
   144  }
   145  
   146  type outboundPoliciesWatchServer struct {
   147  	grpc.ServerStream
   148  }
   149  
   150  func (x *outboundPoliciesWatchServer) Send(m *OutboundPolicy) error {
   151  	return x.ServerStream.SendMsg(m)
   152  }
   153  
   154  // OutboundPolicies_ServiceDesc is the grpc.ServiceDesc for OutboundPolicies service.
   155  // It's only intended for direct use with grpc.RegisterService,
   156  // and not to be introspected or modified (even as a copy)
   157  var OutboundPolicies_ServiceDesc = grpc.ServiceDesc{
   158  	ServiceName: "io.linkerd.proxy.outbound.OutboundPolicies",
   159  	HandlerType: (*OutboundPoliciesServer)(nil),
   160  	Methods: []grpc.MethodDesc{
   161  		{
   162  			MethodName: "Get",
   163  			Handler:    _OutboundPolicies_Get_Handler,
   164  		},
   165  	},
   166  	Streams: []grpc.StreamDesc{
   167  		{
   168  			StreamName:    "Watch",
   169  			Handler:       _OutboundPolicies_Watch_Handler,
   170  			ServerStreams: true,
   171  		},
   172  	},
   173  	Metadata: "outbound.proto",
   174  }
   175  

View as plain text