# README
RPC Stream
This package implements running a RPC service on top of another.
The "host" service has a signature like:
syntax = "proto3";
package mypackage;
import "github.com/aperturerobotics/starpc/rpcstream/rpcstream.proto";
// HostService proxies RPC calls to a target Mux.
service HostService {
// MyRpc opens a stream to proxy a RPC call.
rpc MyRpc(stream .rpcstream.RpcStreamPacket) returns (stream .rpcstream.RpcStreamPacket);
}
NewRpcStreamOpenStream(componentID, hostService.MyRpc)
will construct a new
OpenStreamFunc
which starts a RPC call to MyRpc
and forwards the starpc
packets over the two-way stream.
The component ID can be used to determine which Mux the client should access.
# Functions
HandleProxyRpcStream handles an incoming RPC stream proxying to a ReadWriteCloser.
HandleRawRpcStream handles an incoming RPC stream proxying to a ReadWriteCloser.
HandleRpcStream handles an incoming RPC stream (remote is the initiator).
NewRpcStreamClient constructs a Client which opens streams with a RpcStream.
NewRpcStreamOpenStream constructs an OpenStream function with a RpcStream.
NewRpcStreamReadWriter constructs a new read/writer.
NewRpcStreamWriter constructs a new rpc stream writer.
OpenRpcStream opens a RPC stream with a remote.
ReadPump executes the read pump in a goroutine.
ReadToHandler reads data to the given handler.
# Variables
ErrNoServerForComponent is returned if the getter returns nil.
ErrUnexpectedPacket is returned if the packet was unexpected.
# Structs
RpcAck is the ack message in a RPC stream.
RpcStreamInit is the first message in a RPC stream.
RpcStreamPacket is a packet encapsulating data for a RPC stream.
No description provided by the author
No description provided by the author
No description provided by the author
RpcStreamReadWriter reads and writes a buffered RpcStream.
RpcStreamWriter implements the Writer only.
# Interfaces
RpcStream implements a RPC call stream over a RPC call.
# Type aliases
RpcProxyGetter returns a remote rpcstream call to proxy to.
RpcRawGetter returns a read/write/closer to proxy data to/from.
RpcStreamCaller is a function which starts the RpcStream call.
RpcStreamGetter returns the Mux for the component ID from the remote.