Versions in this module Expand all Collapse all v0 v0.0.2 Aug 7, 2022 v0.0.1 Apr 18, 2022 Changes in this version + const CodeInternalError + const CodeInvalidParams + const CodeInvalidRequest + const CodeMethodNotFound + const CodeParseError + const CodeServerOverloaded + const CodeUnknownError + const Receive + const Send + type Conn struct + func NewConn(s Stream) *Conn + func (c *Conn) AddHandler(handler Handler) + func (c *Conn) Call(ctx context.Context, method string, params, result interface{}) (err error) + func (c *Conn) Cancel(id ID) + func (c *Conn) Notify(ctx context.Context, method string, params interface{}) (err error) + func (c *Conn) Run(runCtx context.Context) error + type Direction bool + func (d Direction) String() string + type EmptyHandler struct + func (EmptyHandler) Cancel(ctx context.Context, conn *Conn, id ID, cancelled bool) bool + func (EmptyHandler) Deliver(ctx context.Context, r *Request, delivered bool) bool + func (EmptyHandler) Done(ctx context.Context, err error) + func (EmptyHandler) Error(ctx context.Context, err error) + func (EmptyHandler) Read(ctx context.Context, bytes int64) context.Context + func (EmptyHandler) Request(ctx context.Context, conn *Conn, direction Direction, r *WireRequest) context.Context + func (EmptyHandler) Response(ctx context.Context, conn *Conn, direction Direction, r *WireResponse) context.Context + func (EmptyHandler) Wrote(ctx context.Context, bytes int64) context.Context + type Error struct + Code int64 + Data *json.RawMessage + Message string + func NewErrorf(code int64, format string, args ...interface{}) *Error + func (err *Error) Error() string + type Handler interface + Cancel func(ctx context.Context, conn *Conn, id ID, cancelled bool) bool + Deliver func(ctx context.Context, r *Request, delivered bool) bool + Done func(ctx context.Context, err error) + Error func(ctx context.Context, err error) + Read func(ctx context.Context, bytes int64) context.Context + Request func(ctx context.Context, conn *Conn, direction Direction, r *WireRequest) context.Context + Response func(ctx context.Context, conn *Conn, direction Direction, r *WireResponse) context.Context + Wrote func(ctx context.Context, bytes int64) context.Context + type ID struct + Name string + Number int64 + func (id *ID) MarshalJSON() ([]byte, error) + func (id *ID) String() string + func (id *ID) UnmarshalJSON(data []byte) error + type Request struct + func (r *Request) Conn() *Conn + func (r *Request) IsNotify() bool + func (r *Request) Parallel() + func (r *Request) Reply(ctx context.Context, result interface{}, err error) error + type Stream interface + Read func(context.Context) ([]byte, int64, error) + Write func(context.Context, []byte) (int64, error) + func NewHeaderStream(in io.Reader, out io.Writer) Stream + func NewStream(in io.Reader, out io.Writer) Stream + type VersionTag struct + func (VersionTag) MarshalJSON() ([]byte, error) + func (VersionTag) UnmarshalJSON(data []byte) error + type WireRequest struct + ID *ID + Method string + Params *json.RawMessage + VersionTag VersionTag + type WireResponse struct + Error *Error + ID *ID + Result *json.RawMessage + VersionTag VersionTag