Documentation ¶
Overview ¶
Package proto provides a client that can be used on a *uds.Client or *uds.Conn to send streaming binary proto values. This package uses chunk underneath and therefore expects the other side to understand its data format.
This is for decoding a single proto message type.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a wrapper around an *uds.Client or *uds.Server that can send and receive JSON messages.
func New ¶
func New(rwc io.ReadWriteCloser, options ...Option) (*Client, error)
New is the constructor for Client. rwc must be a *uds.Client or *uds.Conn.
type Option ¶
type Option func(c *Client)
Option is an optional argument to New.
func MaxSize ¶
MaxSize is the maximum size a read message is allowed to be. If a message is larger than this, Next() will fail and the underlying connection will be closed.
func SharedPool ¶
SharedPool allows the use of a shared pool of buffers between Client instead of a pool per client. This is useful when clients are short lived and have similar message sizes. Client will panic if the pool does not return a *[]byte object.