Documentation ¶
Index ¶
- Constants
- func NewSyncRPCService(hostName string, broker broker.GatewayRPCBroker) (protos.SyncRPCServiceServer, error)
- func NewTestSyncRPCServer(hostName string, broker broker.GatewayRPCBroker) (*testSyncRPCServer, error)
- func RecvWithContext(ctx context.Context, f func() (*protos.SyncRPCResponse, error)) (*protos.SyncRPCResponse, error)
- type SyncRPCService
- type WrappedSyncResponse
Constants ¶
View Source
const TestSyncRPCAgHwId = "Test-AGW-Hw-Id"
Variables ¶
This section is empty.
Functions ¶
func NewSyncRPCService ¶
func NewSyncRPCService(hostName string, broker broker.GatewayRPCBroker) (protos.SyncRPCServiceServer, error)
func NewTestSyncRPCServer ¶
func NewTestSyncRPCServer(hostName string, broker broker.GatewayRPCBroker) (*testSyncRPCServer, error)
func RecvWithContext ¶
func RecvWithContext(ctx context.Context, f func() (*protos.SyncRPCResponse, error)) (*protos.SyncRPCResponse, error)
RecvWithContext runs f and returns its error. If the context is cancelled or times out first, it returns the context's error instead. See https://github.com/grpc/grpc-go/issues/1229#issuecomment-300938770
Types ¶
type SyncRPCService ¶
type SyncRPCService struct {
// contains filtered or unexported fields
}
func (*SyncRPCService) EstablishSyncRPCStream ¶
func (srv *SyncRPCService) EstablishSyncRPCStream(stream protos.SyncRPCService_EstablishSyncRPCStreamServer) error
EstablishSyncRPCStream is the RPC call that will be called by gateways. It establishes a bidirectional stream between the gateway and the cloud, and the streams will close if it returns.
Every active connection will run this function in its own goroutine.
func (*SyncRPCService) SyncRPC
deprecated
func (srv *SyncRPCService) SyncRPC(stream protos.SyncRPCService_SyncRPCServer) error
SyncRPC exists for backwards compatibility.
Deprecated: Use EstablishSyncRPCStream instead.
type WrappedSyncResponse ¶
type WrappedSyncResponse struct { Resp *protos.SyncRPCResponse Err error }
Click to show internal directories.
Click to hide internal directories.