...

Source file src/github.com/linkerd/linkerd2-proxy-api/go/destination/destination_grpc.pb.go

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

     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: destination.proto
     6  
     7  package destination
     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  	Destination_Get_FullMethodName        = "/io.linkerd.proxy.destination.Destination/Get"
    23  	Destination_GetProfile_FullMethodName = "/io.linkerd.proxy.destination.Destination/GetProfile"
    24  )
    25  
    26  // DestinationClient is the client API for Destination 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 DestinationClient interface {
    30  	// Given a destination, return all addresses in that destination as a long-
    31  	// running stream of updates.
    32  	Get(ctx context.Context, in *GetDestination, opts ...grpc.CallOption) (Destination_GetClient, error)
    33  	// Given a destination, return that destination's profile and send an update
    34  	// whenever it changes.
    35  	GetProfile(ctx context.Context, in *GetDestination, opts ...grpc.CallOption) (Destination_GetProfileClient, error)
    36  }
    37  
    38  type destinationClient struct {
    39  	cc grpc.ClientConnInterface
    40  }
    41  
    42  func NewDestinationClient(cc grpc.ClientConnInterface) DestinationClient {
    43  	return &destinationClient{cc}
    44  }
    45  
    46  func (c *destinationClient) Get(ctx context.Context, in *GetDestination, opts ...grpc.CallOption) (Destination_GetClient, error) {
    47  	stream, err := c.cc.NewStream(ctx, &Destination_ServiceDesc.Streams[0], Destination_Get_FullMethodName, opts...)
    48  	if err != nil {
    49  		return nil, err
    50  	}
    51  	x := &destinationGetClient{stream}
    52  	if err := x.ClientStream.SendMsg(in); err != nil {
    53  		return nil, err
    54  	}
    55  	if err := x.ClientStream.CloseSend(); err != nil {
    56  		return nil, err
    57  	}
    58  	return x, nil
    59  }
    60  
    61  type Destination_GetClient interface {
    62  	Recv() (*Update, error)
    63  	grpc.ClientStream
    64  }
    65  
    66  type destinationGetClient struct {
    67  	grpc.ClientStream
    68  }
    69  
    70  func (x *destinationGetClient) Recv() (*Update, error) {
    71  	m := new(Update)
    72  	if err := x.ClientStream.RecvMsg(m); err != nil {
    73  		return nil, err
    74  	}
    75  	return m, nil
    76  }
    77  
    78  func (c *destinationClient) GetProfile(ctx context.Context, in *GetDestination, opts ...grpc.CallOption) (Destination_GetProfileClient, error) {
    79  	stream, err := c.cc.NewStream(ctx, &Destination_ServiceDesc.Streams[1], Destination_GetProfile_FullMethodName, opts...)
    80  	if err != nil {
    81  		return nil, err
    82  	}
    83  	x := &destinationGetProfileClient{stream}
    84  	if err := x.ClientStream.SendMsg(in); err != nil {
    85  		return nil, err
    86  	}
    87  	if err := x.ClientStream.CloseSend(); err != nil {
    88  		return nil, err
    89  	}
    90  	return x, nil
    91  }
    92  
    93  type Destination_GetProfileClient interface {
    94  	Recv() (*DestinationProfile, error)
    95  	grpc.ClientStream
    96  }
    97  
    98  type destinationGetProfileClient struct {
    99  	grpc.ClientStream
   100  }
   101  
   102  func (x *destinationGetProfileClient) Recv() (*DestinationProfile, error) {
   103  	m := new(DestinationProfile)
   104  	if err := x.ClientStream.RecvMsg(m); err != nil {
   105  		return nil, err
   106  	}
   107  	return m, nil
   108  }
   109  
   110  // DestinationServer is the server API for Destination service.
   111  // All implementations must embed UnimplementedDestinationServer
   112  // for forward compatibility
   113  type DestinationServer interface {
   114  	// Given a destination, return all addresses in that destination as a long-
   115  	// running stream of updates.
   116  	Get(*GetDestination, Destination_GetServer) error
   117  	// Given a destination, return that destination's profile and send an update
   118  	// whenever it changes.
   119  	GetProfile(*GetDestination, Destination_GetProfileServer) error
   120  	mustEmbedUnimplementedDestinationServer()
   121  }
   122  
   123  // UnimplementedDestinationServer must be embedded to have forward compatible implementations.
   124  type UnimplementedDestinationServer struct {
   125  }
   126  
   127  func (UnimplementedDestinationServer) Get(*GetDestination, Destination_GetServer) error {
   128  	return status.Errorf(codes.Unimplemented, "method Get not implemented")
   129  }
   130  func (UnimplementedDestinationServer) GetProfile(*GetDestination, Destination_GetProfileServer) error {
   131  	return status.Errorf(codes.Unimplemented, "method GetProfile not implemented")
   132  }
   133  func (UnimplementedDestinationServer) mustEmbedUnimplementedDestinationServer() {}
   134  
   135  // UnsafeDestinationServer may be embedded to opt out of forward compatibility for this service.
   136  // Use of this interface is not recommended, as added methods to DestinationServer will
   137  // result in compilation errors.
   138  type UnsafeDestinationServer interface {
   139  	mustEmbedUnimplementedDestinationServer()
   140  }
   141  
   142  func RegisterDestinationServer(s grpc.ServiceRegistrar, srv DestinationServer) {
   143  	s.RegisterService(&Destination_ServiceDesc, srv)
   144  }
   145  
   146  func _Destination_Get_Handler(srv interface{}, stream grpc.ServerStream) error {
   147  	m := new(GetDestination)
   148  	if err := stream.RecvMsg(m); err != nil {
   149  		return err
   150  	}
   151  	return srv.(DestinationServer).Get(m, &destinationGetServer{stream})
   152  }
   153  
   154  type Destination_GetServer interface {
   155  	Send(*Update) error
   156  	grpc.ServerStream
   157  }
   158  
   159  type destinationGetServer struct {
   160  	grpc.ServerStream
   161  }
   162  
   163  func (x *destinationGetServer) Send(m *Update) error {
   164  	return x.ServerStream.SendMsg(m)
   165  }
   166  
   167  func _Destination_GetProfile_Handler(srv interface{}, stream grpc.ServerStream) error {
   168  	m := new(GetDestination)
   169  	if err := stream.RecvMsg(m); err != nil {
   170  		return err
   171  	}
   172  	return srv.(DestinationServer).GetProfile(m, &destinationGetProfileServer{stream})
   173  }
   174  
   175  type Destination_GetProfileServer interface {
   176  	Send(*DestinationProfile) error
   177  	grpc.ServerStream
   178  }
   179  
   180  type destinationGetProfileServer struct {
   181  	grpc.ServerStream
   182  }
   183  
   184  func (x *destinationGetProfileServer) Send(m *DestinationProfile) error {
   185  	return x.ServerStream.SendMsg(m)
   186  }
   187  
   188  // Destination_ServiceDesc is the grpc.ServiceDesc for Destination service.
   189  // It's only intended for direct use with grpc.RegisterService,
   190  // and not to be introspected or modified (even as a copy)
   191  var Destination_ServiceDesc = grpc.ServiceDesc{
   192  	ServiceName: "io.linkerd.proxy.destination.Destination",
   193  	HandlerType: (*DestinationServer)(nil),
   194  	Methods:     []grpc.MethodDesc{},
   195  	Streams: []grpc.StreamDesc{
   196  		{
   197  			StreamName:    "Get",
   198  			Handler:       _Destination_Get_Handler,
   199  			ServerStreams: true,
   200  		},
   201  		{
   202  			StreamName:    "GetProfile",
   203  			Handler:       _Destination_GetProfile_Handler,
   204  			ServerStreams: true,
   205  		},
   206  	},
   207  	Metadata: "destination.proto",
   208  }
   209  

View as plain text