Documentation
¶
Index ¶
Constants ¶
View Source
const ( ErrorCodeParseError = -32700 ErrorCodeInvalidRequest = -32600 ErrorCodeMethodNotFound = -32601 ErrorCodeInvalidParams = -32602 ErrorCodeInternalError = -32603 )
Standard JSON-RPC error codes.
View Source
const Version = "2.0"
Version is the JSON-RPC 2.0 version identifier.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine handles JSON-RPC 2.0 request processing.
func (*Engine) GetRegisteredMethods ¶
GetRegisteredMethods returns a sorted list of registered method names.
func (*Engine) ProcessRequest ¶
ProcessRequest processes a JSON-RPC request payload and returns a response payload.
func (*Engine) ProcessRequestDirect ¶
ProcessRequestDirect processes a JSON-RPC request object and returns the response object.
func (*Engine) RegisterMethod ¶
func (engine *Engine) RegisterMethod(name string, handler MethodHandler)
RegisterMethod registers a method handler with the JSON-RPC engine.
type ErrorDetails ¶
type ErrorDetails struct {
Code int `json:"code"`
Message string `json:"message"`
Data any `json:"data,omitempty"`
}
ErrorDetails represents a JSON-RPC 2.0 error object.
type MethodHandler ¶
MethodHandler defines the signature for JSON-RPC method handlers.
Click to show internal directories.
Click to hide internal directories.