Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClientCodec ¶
func NewClientCodec(rwc io.ReadWriteCloser) rpc.ClientCodec
NewClientCodec returns a new rpc.Client.
A ClientCodec implements writing of RPC requests and reading of RPC responses for the client side of an RPC session. The client calls WriteRequest to write a request to the connection and calls ReadResponseHeader and ReadResponseBody in pairs to read responses. The client calls Close when finished with the connection. ReadResponseBody may be called with a nil argument to force the body of the response to be read and then discarded.
Types ¶
type DecodeReader ¶
type DecodeReader interface {
io.ByteReader
io.Reader
}
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
A Decoder manages the receipt of type and data information read from the remote side of a connection.
func NewDecoder ¶
func NewDecoder(r DecodeReader) *Decoder
NewDecoder returns a new decoder that reads from the io.Reader.
func (*Decoder) Decode ¶
Decode reads the next value from the input stream and stores it in the data represented by the empty interface value. If m is nil, the value will be discarded. Otherwise, the value underlying m must be a pointer to the correct type for the next data item received.
func (*Decoder) DecodeBytes ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
An Encoder manages the transmission of type and data information to the other side of a connection.
func NewEncoder ¶
NewEncoder returns a new encoder that will transmit on the io.Writer.