# Functions
AsyncHandler returns a handler that processes each request goes in its own goroutine.
CancelHandler returns a handler that supports cancellation, and a function that can be used to trigger canceling in progress requests.
DecodeMessage decodes data to Message.
Errorf builds a Error struct for the suppied code, format and args.
HandlerServer returns a StreamServer that handles incoming streams using the provided handler.
ListenAndServe starts an jsonrpc2 server on the given address.
MethodNotFoundHandler is a Handler that replies to all call requests with the standard method not found response.
NewCall constructs a new Call message for the supplied ID, method and parameters.
NewConn creates a new connection object around the supplied stream.
NewError builds a Error struct for the suppied code and message.
NewNotification constructs a new Notification message for the supplied method and parameters.
NewNumberID returns a new number request ID.
NewRawStream returns a Stream built on top of a io.ReadWriteCloser.
NewResponse constructs a new Response message that is a reply to the supplied.
NewStream returns a Stream built on top of a io.ReadWriteCloser.
NewStringID returns a new string request ID.
ReplyHandler creates a Handler that panics if the wrapped handler does not call Reply for every request that it is passed.
Serve accepts incoming connections from the network, and handles them using the provided server.
# Constants
CodeServerErrorEnd reserved for implementation-defined server-errors.
CodeServerErrorStart reserved for implementation-defined server-errors.
ErrIdleTimeout is returned when serving timed out waiting for new connections.
HdrContentLength is the HTTP header name of the length of the content part in bytes.
HeaderContentSeparator is the header and content part separator.
HeaderContentType is the mime type of the content part.
InternalError is the internal JSON-RPC error.
InvalidParams is the invalid method parameter(s).
InvalidRequest is the JSON sent is not a valid Request object.
JSONRPCReservedErrorRangeEnd is the start range of JSON RPC reserved error codes.
JSONRPCReservedErrorRangeStart is the start range of JSON RPC reserved error codes.
MethodNotFound is the method does not exist / is not available.
ParseError is the invalid JSON was received by the server.
ServerNotInitialized is the error of server not initialized.
UnknownError should be used for all non coded errors.
Version represents a JSON-RPC version.
# Variables
ErrInternal is not currently returned but defined for completeness.
ErrInvalidParams should be returned by the handler when method parameter(s) were invalid.
ErrInvalidRequest is used when the JSON sent is not a valid Request object.
ErrMethodNotFound should be returned by the handler when the method does not exist / is not available.
ErrParse is used when invalid JSON was received by the server.
ErrUnknown should be used for all non coded errors.
# Structs
Call is a request that expects a response.
Error represents a JSON-RPC error.
ID is a Request identifier.
Notification is a request for which a response cannot occur, and as such it has not ID.
Response is a reply to a Request.
# Interfaces
Conn is the common interface to jsonrpc clients and servers.
Message is the interface to all JSON-RPC message types.
Request is the shared interface to jsonrpc2 messages that request a method be invoked.
Stream abstracts the transport mechanics from the JSON RPC protocol.
StreamServer is used to serve incoming jsonrpc2 clients communicating over a newly created connection.
# Type aliases
Code is an error code as defined in the JSON-RPC spec.
Framer wraps a network connection up into a Stream.
Handler is invoked to handle incoming requests.
Replier is passed to handlers to allow them to reply to the request.
ServerFunc is an adapter that implements the StreamServer interface using an ordinary function.