Versions in this module Expand all Collapse all v0 v0.0.2 Apr 25, 2026 v0.0.1 Apr 11, 2026 Changes in this version + const CodeInternalError + const CodeInvalidParams + const CodeInvalidRequest + const CodeMethodNotFound + const CodeParseError + var ErrInvalidContentLength = errors.New("jsonrpc: invalid content length") + var ErrInvalidHeader = errors.New("jsonrpc: invalid header") + var ErrInvalidJSONRPCVersion = errors.New("invalid JSON-RPC version") + var ErrNoContentLength = errors.New("jsonrpc: no content length") + type ID struct + func NewID(rawValue IntegerOrString) *ID + func NewIDInt(i int32) *ID + func NewIDString(str string) *ID + func (id *ID) MarshalJSON() ([]byte, error) + func (id *ID) MustInt() int32 + func (id *ID) String() string + func (id *ID) TryInt() (int32, bool) + func (id *ID) UnmarshalJSON(data []byte) error + type IntegerOrString struct + Integer *int32 + String *string + type JSONRPCVersion struct + func (*JSONRPCVersion) UnmarshalJSON(data []byte) error + func (JSONRPCVersion) MarshalJSON() ([]byte, error) + type Message struct + Error *ResponseError + ID *ID + JSONRPC JSONRPCVersion + Method string + Params json.Value + Result json.Value + func (m *Message) IsNotification() bool + func (m *Message) IsRequest() bool + func (m *Message) IsResponse() bool + func (m *Message) Kind() MessageKind + type MessageKind int + const MessageKindNotification + const MessageKindRequest + const MessageKindResponse + type Reader struct + func NewReader(r io.Reader) *Reader + func (r *Reader) Read() ([]byte, error) + type RequestMessage struct + ID *ID + JSONRPC JSONRPCVersion + Method string + Params any + type ResponseError struct + Code int32 + Data any + Message string + func (r *ResponseError) Error() string + func (r *ResponseError) String() string + type ResponseMessage struct + Error *ResponseError + ID *ID + JSONRPC JSONRPCVersion + Result any + type Writer struct + func NewWriter(w io.Writer) *Writer + func (w *Writer) Write(data []byte) error