github.com/cloudwan/edgelq-sdk@v1.15.4/proxies/client/v1alpha2/broker/broker_service.pb.client.go (about)

     1  // Code generated by protoc-gen-goten-client
     2  // API: BrokerService
     3  // DO NOT EDIT!!!
     4  
     5  package broker_client
     6  
     7  import (
     8  	"context"
     9  
    10  	"google.golang.org/grpc"
    11  	"google.golang.org/protobuf/runtime/protoimpl"
    12  )
    13  
    14  // proto imports
    15  import (
    16  	project "github.com/cloudwan/edgelq-sdk/proxies/resources/v1alpha2/project"
    17  )
    18  
    19  // Reference imports to suppress errors if they are not otherwise used.
    20  var (
    21  	_ = protoimpl.DescBuilder{}
    22  	_ = new(context.Context)
    23  	_ = grpc.ClientConn{}
    24  )
    25  
    26  // make sure we're using proto imports
    27  var (
    28  	_ = &project.Project{}
    29  )
    30  
    31  // This is a compile-time assertion to ensure that this generated file
    32  // is compatible with the proto package it is being compiled against.
    33  // A compilation error at this line likely means your copy of the
    34  // proto package needs to be updated.
    35  const (
    36  	// Verify that this generated code is sufficiently up-to-date.
    37  	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
    38  	// Verify that runtime/protoimpl is sufficiently up-to-date.
    39  	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
    40  )
    41  
    42  // This is a compile-time assertion to ensure that this generated file
    43  // is compatible with the grpc package it is being compiled against.
    44  const _ = grpc.SupportPackageIsVersion6
    45  
    46  // BrokerServiceClient is the client API for BrokerService.
    47  //
    48  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
    49  type BrokerServiceClient interface {
    50  	Connect(ctx context.Context, opts ...grpc.CallOption) (ConnectClientStream, error)
    51  	Listen(ctx context.Context, opts ...grpc.CallOption) (ListenClientStream, error)
    52  	Accept(ctx context.Context, opts ...grpc.CallOption) (AcceptClientStream, error)
    53  }
    54  
    55  type client struct {
    56  	cc grpc.ClientConnInterface
    57  }
    58  
    59  func NewBrokerServiceClient(cc grpc.ClientConnInterface) BrokerServiceClient {
    60  	return &client{cc}
    61  }
    62  
    63  func (c *client) Connect(ctx context.Context, opts ...grpc.CallOption) (ConnectClientStream, error) {
    64  	stream, err := c.cc.NewStream(ctx,
    65  		&grpc.StreamDesc{
    66  			StreamName:    "Connect",
    67  			ServerStreams: true,
    68  			ClientStreams: true,
    69  		},
    70  		"/ntt.proxies.v1alpha2.BrokerService/Connect", opts...)
    71  	if err != nil {
    72  		return nil, err
    73  	}
    74  	x := &connectConnectClient{stream}
    75  	return x, nil
    76  }
    77  
    78  type ConnectClientStream interface {
    79  	Send(*ConnectRequest) error
    80  	Recv() (*ConnectResponse, error)
    81  	grpc.ClientStream
    82  }
    83  
    84  type connectConnectClient struct {
    85  	grpc.ClientStream
    86  }
    87  
    88  func (x *connectConnectClient) Send(m *ConnectRequest) error {
    89  	return x.ClientStream.SendMsg(m)
    90  }
    91  
    92  func (x *connectConnectClient) Recv() (*ConnectResponse, error) {
    93  	m := new(ConnectResponse)
    94  	if err := x.ClientStream.RecvMsg(m); err != nil {
    95  		return nil, err
    96  	}
    97  	return m, nil
    98  }
    99  
   100  func (c *client) Listen(ctx context.Context, opts ...grpc.CallOption) (ListenClientStream, error) {
   101  	stream, err := c.cc.NewStream(ctx,
   102  		&grpc.StreamDesc{
   103  			StreamName:    "Listen",
   104  			ServerStreams: true,
   105  			ClientStreams: true,
   106  		},
   107  		"/ntt.proxies.v1alpha2.BrokerService/Listen", opts...)
   108  	if err != nil {
   109  		return nil, err
   110  	}
   111  	x := &listenListenClient{stream}
   112  	return x, nil
   113  }
   114  
   115  type ListenClientStream interface {
   116  	Send(*ListenRequest) error
   117  	Recv() (*ListenResponse, error)
   118  	grpc.ClientStream
   119  }
   120  
   121  type listenListenClient struct {
   122  	grpc.ClientStream
   123  }
   124  
   125  func (x *listenListenClient) Send(m *ListenRequest) error {
   126  	return x.ClientStream.SendMsg(m)
   127  }
   128  
   129  func (x *listenListenClient) Recv() (*ListenResponse, error) {
   130  	m := new(ListenResponse)
   131  	if err := x.ClientStream.RecvMsg(m); err != nil {
   132  		return nil, err
   133  	}
   134  	return m, nil
   135  }
   136  
   137  func (c *client) Accept(ctx context.Context, opts ...grpc.CallOption) (AcceptClientStream, error) {
   138  	stream, err := c.cc.NewStream(ctx,
   139  		&grpc.StreamDesc{
   140  			StreamName:    "Accept",
   141  			ServerStreams: true,
   142  			ClientStreams: true,
   143  		},
   144  		"/ntt.proxies.v1alpha2.BrokerService/Accept", opts...)
   145  	if err != nil {
   146  		return nil, err
   147  	}
   148  	x := &acceptAcceptClient{stream}
   149  	return x, nil
   150  }
   151  
   152  type AcceptClientStream interface {
   153  	Send(*AcceptRequest) error
   154  	Recv() (*AcceptResponse, error)
   155  	grpc.ClientStream
   156  }
   157  
   158  type acceptAcceptClient struct {
   159  	grpc.ClientStream
   160  }
   161  
   162  func (x *acceptAcceptClient) Send(m *AcceptRequest) error {
   163  	return x.ClientStream.SendMsg(m)
   164  }
   165  
   166  func (x *acceptAcceptClient) Recv() (*AcceptResponse, error) {
   167  	m := new(AcceptResponse)
   168  	if err := x.ClientStream.RecvMsg(m); err != nil {
   169  		return nil, err
   170  	}
   171  	return m, nil
   172  }