Versions in this module Expand all Collapse all v1 v1.0.0 Jun 24, 2023 Changes in this version + var ErrConnClosing = &closeError + var ErrStreamClosing = &closeError + func Invoke(ctx context.Context, method string, args, reply interface{}, conn *Conn) error + func Sync(s ...Stream) (err error) + type Codec interface + ReadResponse func(*Response) error + WriteRequest func(*Request) error + type Conn struct + func Dial(target string, opts ...DialOption) (*Conn, error) + func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *Conn, err error) + func (c *Conn) Close() error + func (c *Conn) Context() context.Context + func (c *Conn) SetCompressionLevel(level int) error + type DialOption func(*dialOptions) + func WithCodec(f func(conn io.ReadWriter) Codec) DialOption + func WithCompression() DialOption + func WithDialer(f func(ctx context.Context, addr string) (io.ReadWriteCloser, error)) DialOption + func WithTLSClientConfig(c *tls.Config) DialOption + func WithWriteBufferSize(n int) DialOption + type Request struct + Args interface{} + ID uint64 + Method string + Version string + type Response struct + Args json.RawMessage + Error *ResponseError + ID uint64 + Method string + Result json.RawMessage + func (r *Response) String() string + type ResponseError struct + Code int64 + Data string + Message string + func (e *ResponseError) Error() string + type Stream interface + Close func() error + Ready func() <-chan struct{} + RecvMsg func(m interface{}) error + func NewStream(ctx context.Context, method string, conn *Conn) (Stream, error)