Versions in this module Expand all Collapse all v0 v0.0.20 Oct 28, 2025 v0.0.19 Jul 25, 2025 v0.0.18 Jun 13, 2025 v0.0.17 Jun 11, 2025 v0.0.16 Apr 7, 2025 Changes in this version + var ErrInternal = NewError(-32603, "JSON RPC internal error") + var ErrInvalidParams = NewError(-32602, "JSON RPC invalid params") + var ErrInvalidRequest = NewError(-32600, "JSON RPC invalid request") + var ErrMethodNotFound = NewError(-32601, "JSON RPC method not found") + var ErrParse = NewError(-32700, "JSON RPC parse error") + var ErrUnknown = NewError(-32001, "JSON RPC unknown error") + type ChanObjStream struct + func NewChanObjStream(in <-chan Message, out chan<- Message) *ChanObjStream + func (c *ChanObjStream) Close() error + func (c *ChanObjStream) ReadMessage() (Message, error) + func (c *ChanObjStream) WriteMessage(obj Message) error + type Conn struct + func NewConn(objStream MessageStream, handlers ...Handler) *Conn + func (c *Conn) Wait() error + func (s *Conn) Close() + func (s *Conn) SendNotification(method string, params any) error + func (s *Conn) SendRequest(method string, params any) (json.RawMessage, *ResponseError) + type Handler struct + func NewNotificationHandler[Params any](method string, strategy HandlingStrategy, ...) Handler + func NewRequestHandler[Params any](method string, strategy HandlingStrategy, ...) Handler + type HandlingStrategy uint8 + const AsyncHandling + const SyncHandling + type ID interface + func NewIntId(value int64) ID + func NewStringId(value string) ID + type Message interface + func UnmarshalMessage(data []byte) (Message, error) + type MessageStream interface + ReadMessage func() (Message, error) + WriteMessage func(obj Message) error + type Request struct + ID ID + Method string + Params json.RawMessage + func (r Request) IsNotification() bool + func (r Request) MarshalJSON() ([]byte, error) + type Response struct + Error *ResponseError + ID ID + Result json.RawMessage + func (r Response) MarshalJSON() ([]byte, error) + type ResponseError struct + Code int64 + Data json.RawMessage + Message string + func NewError(code int64, message string) ResponseError