Documentation ¶
Index ¶
- Variables
- func HandleRpcStream(stream RpcStream, getter RpcStreamGetter) error
- func NewRpcStreamOpenStream(rpcCaller RpcStreamCaller, componentID string) srpc.OpenStreamFunc
- func OpenRpcStream(ctx context.Context, rpcCaller RpcStreamCaller, componentID string) (*srpc.PacketReaderWriter, error)
- type RpcAck
- func (*RpcAck) Descriptor() ([]byte, []int)deprecated
- func (this *RpcAck) EqualVT(that *RpcAck) bool
- func (x *RpcAck) GetError() string
- func (m *RpcAck) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *RpcAck) MarshalToVT(dAtA []byte) (int, error)
- func (m *RpcAck) MarshalVT() (dAtA []byte, err error)
- func (*RpcAck) ProtoMessage()
- func (x *RpcAck) ProtoReflect() protoreflect.Message
- func (x *RpcAck) Reset()
- func (m *RpcAck) SizeVT() (n int)
- func (x *RpcAck) String() string
- func (m *RpcAck) UnmarshalVT(dAtA []byte) error
- type RpcStream
- type RpcStreamCaller
- type RpcStreamGetter
- type RpcStreamInit
- func (*RpcStreamInit) Descriptor() ([]byte, []int)deprecated
- func (this *RpcStreamInit) EqualVT(that *RpcStreamInit) bool
- func (x *RpcStreamInit) GetComponentId() string
- func (m *RpcStreamInit) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *RpcStreamInit) MarshalToVT(dAtA []byte) (int, error)
- func (m *RpcStreamInit) MarshalVT() (dAtA []byte, err error)
- func (*RpcStreamInit) ProtoMessage()
- func (x *RpcStreamInit) ProtoReflect() protoreflect.Message
- func (x *RpcStreamInit) Reset()
- func (m *RpcStreamInit) SizeVT() (n int)
- func (x *RpcStreamInit) String() string
- func (m *RpcStreamInit) UnmarshalVT(dAtA []byte) error
- type RpcStreamPacket
- func (*RpcStreamPacket) Descriptor() ([]byte, []int)deprecated
- func (this *RpcStreamPacket) EqualVT(that *RpcStreamPacket) bool
- func (x *RpcStreamPacket) GetAck() *RpcAck
- func (m *RpcStreamPacket) GetBody() isRpcStreamPacket_Body
- func (x *RpcStreamPacket) GetData() []byte
- func (x *RpcStreamPacket) GetInit() *RpcStreamInit
- func (m *RpcStreamPacket) MarshalToSizedBufferVT(dAtA []byte) (int, error)
- func (m *RpcStreamPacket) MarshalToVT(dAtA []byte) (int, error)
- func (m *RpcStreamPacket) MarshalVT() (dAtA []byte, err error)
- func (*RpcStreamPacket) ProtoMessage()
- func (x *RpcStreamPacket) ProtoReflect() protoreflect.Message
- func (x *RpcStreamPacket) Reset()
- func (m *RpcStreamPacket) SizeVT() (n int)
- func (x *RpcStreamPacket) String() string
- func (m *RpcStreamPacket) UnmarshalVT(dAtA []byte) error
- type RpcStreamPacket_Ack
- type RpcStreamPacket_Data
- type RpcStreamPacket_Init
- type RpcStreamReadWriter
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflow = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") )
var File_github_com_aperturerobotics_starpc_rpcstream_rpcstream_proto protoreflect.FileDescriptor
Functions ¶
func HandleRpcStream ¶
func HandleRpcStream(stream RpcStream, getter RpcStreamGetter) error
HandleRpcStream handles an incoming RPC stream (remote is the initiator).
func NewRpcStreamOpenStream ¶
func NewRpcStreamOpenStream(rpcCaller RpcStreamCaller, componentID string) srpc.OpenStreamFunc
NewRpcStreamOpenStream constructs an OpenStream function with a RpcStream.
func OpenRpcStream ¶ added in v0.5.0
func OpenRpcStream(ctx context.Context, rpcCaller RpcStreamCaller, componentID string) (*srpc.PacketReaderWriter, error)
OpenRpcStream opens a RPC stream with a remote.
Types ¶
type RpcAck ¶ added in v0.5.0
type RpcAck struct { // Error indicates there was some error setting up the stream. Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
RpcAck is the ack message in a RPC stream.
func (*RpcAck) Descriptor
deprecated
added in
v0.5.0
func (*RpcAck) MarshalToSizedBufferVT ¶ added in v0.5.0
func (*RpcAck) ProtoMessage ¶ added in v0.5.0
func (*RpcAck) ProtoMessage()
func (*RpcAck) ProtoReflect ¶ added in v0.5.0
func (x *RpcAck) ProtoReflect() protoreflect.Message
func (*RpcAck) UnmarshalVT ¶ added in v0.5.0
type RpcStream ¶
type RpcStream interface { srpc.Stream Send(*RpcStreamPacket) error Recv() (*RpcStreamPacket, error) }
RpcStream implements a RPC call stream over a RPC call. Used to implement sub-components which have a different set of services & calls available.
type RpcStreamCaller ¶
RpcStreamCaller is a function which starts the RpcStream call.
type RpcStreamGetter ¶
RpcStreamGetter returns the Mux for the component ID from the remote.
type RpcStreamInit ¶
type RpcStreamInit struct { // ComponentId is the identifier of the component making the request. ComponentId string `protobuf:"bytes,1,opt,name=component_id,json=componentId,proto3" json:"component_id,omitempty"` // contains filtered or unexported fields }
RpcStreamInit is the first message in a RPC stream.
func (*RpcStreamInit) Descriptor
deprecated
func (*RpcStreamInit) Descriptor() ([]byte, []int)
Deprecated: Use RpcStreamInit.ProtoReflect.Descriptor instead.
func (*RpcStreamInit) EqualVT ¶
func (this *RpcStreamInit) EqualVT(that *RpcStreamInit) bool
func (*RpcStreamInit) GetComponentId ¶
func (x *RpcStreamInit) GetComponentId() string
func (*RpcStreamInit) MarshalToSizedBufferVT ¶
func (m *RpcStreamInit) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*RpcStreamInit) MarshalToVT ¶
func (m *RpcStreamInit) MarshalToVT(dAtA []byte) (int, error)
func (*RpcStreamInit) MarshalVT ¶
func (m *RpcStreamInit) MarshalVT() (dAtA []byte, err error)
func (*RpcStreamInit) ProtoMessage ¶
func (*RpcStreamInit) ProtoMessage()
func (*RpcStreamInit) ProtoReflect ¶
func (x *RpcStreamInit) ProtoReflect() protoreflect.Message
func (*RpcStreamInit) Reset ¶
func (x *RpcStreamInit) Reset()
func (*RpcStreamInit) SizeVT ¶
func (m *RpcStreamInit) SizeVT() (n int)
func (*RpcStreamInit) String ¶
func (x *RpcStreamInit) String() string
func (*RpcStreamInit) UnmarshalVT ¶
func (m *RpcStreamInit) UnmarshalVT(dAtA []byte) error
type RpcStreamPacket ¶ added in v0.4.5
type RpcStreamPacket struct { // Types that are assignable to Body: // *RpcStreamPacket_Init // *RpcStreamPacket_Ack // *RpcStreamPacket_Data Body isRpcStreamPacket_Body `protobuf_oneof:"body"` // contains filtered or unexported fields }
RpcStreamPacket is a packet encapsulating data for a RPC stream.
func (*RpcStreamPacket) Descriptor
deprecated
added in
v0.4.5
func (*RpcStreamPacket) Descriptor() ([]byte, []int)
Deprecated: Use RpcStreamPacket.ProtoReflect.Descriptor instead.
func (*RpcStreamPacket) EqualVT ¶ added in v0.4.5
func (this *RpcStreamPacket) EqualVT(that *RpcStreamPacket) bool
func (*RpcStreamPacket) GetAck ¶ added in v0.5.0
func (x *RpcStreamPacket) GetAck() *RpcAck
func (*RpcStreamPacket) GetBody ¶ added in v0.4.5
func (m *RpcStreamPacket) GetBody() isRpcStreamPacket_Body
func (*RpcStreamPacket) GetData ¶ added in v0.4.5
func (x *RpcStreamPacket) GetData() []byte
func (*RpcStreamPacket) GetInit ¶ added in v0.4.5
func (x *RpcStreamPacket) GetInit() *RpcStreamInit
func (*RpcStreamPacket) MarshalToSizedBufferVT ¶ added in v0.4.5
func (m *RpcStreamPacket) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*RpcStreamPacket) MarshalToVT ¶ added in v0.4.5
func (m *RpcStreamPacket) MarshalToVT(dAtA []byte) (int, error)
func (*RpcStreamPacket) MarshalVT ¶ added in v0.4.5
func (m *RpcStreamPacket) MarshalVT() (dAtA []byte, err error)
func (*RpcStreamPacket) ProtoMessage ¶ added in v0.4.5
func (*RpcStreamPacket) ProtoMessage()
func (*RpcStreamPacket) ProtoReflect ¶ added in v0.4.5
func (x *RpcStreamPacket) ProtoReflect() protoreflect.Message
func (*RpcStreamPacket) Reset ¶ added in v0.4.5
func (x *RpcStreamPacket) Reset()
func (*RpcStreamPacket) SizeVT ¶ added in v0.4.5
func (m *RpcStreamPacket) SizeVT() (n int)
func (*RpcStreamPacket) String ¶ added in v0.4.5
func (x *RpcStreamPacket) String() string
func (*RpcStreamPacket) UnmarshalVT ¶ added in v0.4.5
func (m *RpcStreamPacket) UnmarshalVT(dAtA []byte) error
type RpcStreamPacket_Ack ¶ added in v0.5.0
type RpcStreamPacket_Ack struct { // Ack is sent in response to Init. // Sent by the server. Ack *RpcAck `protobuf:"bytes,2,opt,name=ack,proto3,oneof"` }
func (*RpcStreamPacket_Ack) MarshalToSizedBufferVT ¶ added in v0.5.0
func (m *RpcStreamPacket_Ack) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*RpcStreamPacket_Ack) MarshalToVT ¶ added in v0.5.0
func (m *RpcStreamPacket_Ack) MarshalToVT(dAtA []byte) (int, error)
func (*RpcStreamPacket_Ack) SizeVT ¶ added in v0.5.0
func (m *RpcStreamPacket_Ack) SizeVT() (n int)
type RpcStreamPacket_Data ¶ added in v0.4.5
type RpcStreamPacket_Data struct { // Data is the encapsulated data packet. Data []byte `protobuf:"bytes,3,opt,name=data,proto3,oneof"` }
func (*RpcStreamPacket_Data) MarshalToSizedBufferVT ¶ added in v0.4.5
func (m *RpcStreamPacket_Data) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*RpcStreamPacket_Data) MarshalToVT ¶ added in v0.4.5
func (m *RpcStreamPacket_Data) MarshalToVT(dAtA []byte) (int, error)
func (*RpcStreamPacket_Data) SizeVT ¶ added in v0.4.5
func (m *RpcStreamPacket_Data) SizeVT() (n int)
type RpcStreamPacket_Init ¶ added in v0.4.5
type RpcStreamPacket_Init struct { // Init is the first packet in the stream. // Sent by the initiator. Init *RpcStreamInit `protobuf:"bytes,1,opt,name=init,proto3,oneof"` }
func (*RpcStreamPacket_Init) MarshalToSizedBufferVT ¶ added in v0.4.5
func (m *RpcStreamPacket_Init) MarshalToSizedBufferVT(dAtA []byte) (int, error)
func (*RpcStreamPacket_Init) MarshalToVT ¶ added in v0.4.5
func (m *RpcStreamPacket_Init) MarshalToVT(dAtA []byte) (int, error)
func (*RpcStreamPacket_Init) SizeVT ¶ added in v0.4.5
func (m *RpcStreamPacket_Init) SizeVT() (n int)
type RpcStreamReadWriter ¶
type RpcStreamReadWriter struct {
// contains filtered or unexported fields
}
RpcStreamReadWriter reads and writes a buffered RpcStream.
func NewRpcStreamReadWriter ¶
func NewRpcStreamReadWriter(stream RpcStream) *RpcStreamReadWriter
NewRpcStreamReadWriter constructs a new read/writer.
func (*RpcStreamReadWriter) Close ¶
func (r *RpcStreamReadWriter) Close() error
Close closes the packet rw.