Documentation ¶
Overview ¶
Package protobuf implements a ClientCodec and ServerCodec for the network package.
Index ¶
- func Dial(network, address string) (*network.Client, error)
- func NewClient(conn io.ReadWriteCloser) *network.Client
- func NewClientCodec(conn io.ReadWriteCloser) network.ClientCodec
- func NewServerCodec(conn io.ReadWriteCloser) network.ServerCodec
- func ServeConn(server *network.Server, conn io.ReadWriteCloser)
- type Decoder
- type Encoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(conn io.ReadWriteCloser) *network.Client
NewClient returns a new network.Client to handle requests to the set of services at the other end of the connection.
func NewClientCodec ¶
func NewClientCodec(conn io.ReadWriteCloser) network.ClientCodec
NewClientCodec returns a new network.ClientCodec using ProtoBuf on conn.
func NewServerCodec ¶
func NewServerCodec(conn io.ReadWriteCloser) network.ServerCodec
NewServerCodec returns a new network.ServerCodec using Protobuf on conn.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
A Decoder reads and decodes Proto Buffer values from an input stream.
func NewDecoder ¶
func NewDecoder(r *network.ConnReader) *Decoder
NewDecoder returns a new decoder that reads from r.
The decoder introduces its own buffering and may read data from r beyond the Proto Buffer values requested.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
An Encoder writes Proto Buffer values to an output stream.
func NewEncoder ¶
func NewEncoder(w *network.ConnWriter) *Encoder
NewEncoder returns a new encoder that writes to w.