github.com/cloudwan/edgelq-sdk@v1.15.4/devices/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 device "github.com/cloudwan/edgelq-sdk/devices/resources/v1alpha2/device" 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 _ = &device.Device{} 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 ListenForConnections(ctx context.Context, opts ...grpc.CallOption) (ListenForConnectionsClientStream, error) 51 OpenConnectionChannelSocket(ctx context.Context, opts ...grpc.CallOption) (OpenConnectionChannelSocketClientStream, error) 52 ConnectToDevice(ctx context.Context, opts ...grpc.CallOption) (ConnectToDeviceClientStream, 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) ListenForConnections(ctx context.Context, opts ...grpc.CallOption) (ListenForConnectionsClientStream, error) { 64 stream, err := c.cc.NewStream(ctx, 65 &grpc.StreamDesc{ 66 StreamName: "ListenForConnections", 67 ServerStreams: true, 68 ClientStreams: true, 69 }, 70 "/ntt.devices.v1alpha2.BrokerService/ListenForConnections", opts...) 71 if err != nil { 72 return nil, err 73 } 74 x := &listenForConnectionsListenForConnectionsClient{stream} 75 return x, nil 76 } 77 78 type ListenForConnectionsClientStream interface { 79 Send(*ListenForConnectionsRequest) error 80 Recv() (*ListenForConnectionsResponse, error) 81 grpc.ClientStream 82 } 83 84 type listenForConnectionsListenForConnectionsClient struct { 85 grpc.ClientStream 86 } 87 88 func (x *listenForConnectionsListenForConnectionsClient) Send(m *ListenForConnectionsRequest) error { 89 return x.ClientStream.SendMsg(m) 90 } 91 92 func (x *listenForConnectionsListenForConnectionsClient) Recv() (*ListenForConnectionsResponse, error) { 93 m := new(ListenForConnectionsResponse) 94 if err := x.ClientStream.RecvMsg(m); err != nil { 95 return nil, err 96 } 97 return m, nil 98 } 99 100 func (c *client) OpenConnectionChannelSocket(ctx context.Context, opts ...grpc.CallOption) (OpenConnectionChannelSocketClientStream, error) { 101 stream, err := c.cc.NewStream(ctx, 102 &grpc.StreamDesc{ 103 StreamName: "OpenConnectionChannelSocket", 104 ServerStreams: true, 105 ClientStreams: true, 106 }, 107 "/ntt.devices.v1alpha2.BrokerService/OpenConnectionChannelSocket", opts...) 108 if err != nil { 109 return nil, err 110 } 111 x := &openConnectionChannelSocketOpenConnectionChannelSocketClient{stream} 112 return x, nil 113 } 114 115 type OpenConnectionChannelSocketClientStream interface { 116 Send(*OpenConnectionChannelSocketRequest) error 117 Recv() (*OpenConnectionChannelSocketResponse, error) 118 grpc.ClientStream 119 } 120 121 type openConnectionChannelSocketOpenConnectionChannelSocketClient struct { 122 grpc.ClientStream 123 } 124 125 func (x *openConnectionChannelSocketOpenConnectionChannelSocketClient) Send(m *OpenConnectionChannelSocketRequest) error { 126 return x.ClientStream.SendMsg(m) 127 } 128 129 func (x *openConnectionChannelSocketOpenConnectionChannelSocketClient) Recv() (*OpenConnectionChannelSocketResponse, error) { 130 m := new(OpenConnectionChannelSocketResponse) 131 if err := x.ClientStream.RecvMsg(m); err != nil { 132 return nil, err 133 } 134 return m, nil 135 } 136 137 func (c *client) ConnectToDevice(ctx context.Context, opts ...grpc.CallOption) (ConnectToDeviceClientStream, error) { 138 stream, err := c.cc.NewStream(ctx, 139 &grpc.StreamDesc{ 140 StreamName: "ConnectToDevice", 141 ServerStreams: true, 142 ClientStreams: true, 143 }, 144 "/ntt.devices.v1alpha2.BrokerService/ConnectToDevice", opts...) 145 if err != nil { 146 return nil, err 147 } 148 x := &connectToDeviceConnectToDeviceClient{stream} 149 return x, nil 150 } 151 152 type ConnectToDeviceClientStream interface { 153 Send(*ConnectToDeviceRequest) error 154 Recv() (*ConnectToDeviceResponse, error) 155 grpc.ClientStream 156 } 157 158 type connectToDeviceConnectToDeviceClient struct { 159 grpc.ClientStream 160 } 161 162 func (x *connectToDeviceConnectToDeviceClient) Send(m *ConnectToDeviceRequest) error { 163 return x.ClientStream.SendMsg(m) 164 } 165 166 func (x *connectToDeviceConnectToDeviceClient) Recv() (*ConnectToDeviceResponse, error) { 167 m := new(ConnectToDeviceResponse) 168 if err := x.ClientStream.RecvMsg(m); err != nil { 169 return nil, err 170 } 171 return m, nil 172 }