Documentation ¶
Index ¶
- Constants
- func NewErrorResponse(ctx context.Context, requestId *string, err error) common.Response
- func NewHandler(schema *proto.Schema, api *proto.Api) common.HandlerFunc
- func NewSuccessResponse(ctx context.Context, requestId string, response any, ...) common.Response
- type JsonRpcError
- type JsonRpcErrorResponse
- type JsonRpcRequest
- type JsonRpcSuccessResponse
Constants ¶
View Source
const ( // JSON-RPC spec compliant error codes JsonRpcParseErrorCode = -32700 JsonRpcInvalidRequestCode = -32600 JsonRpcMethodNotFoundCode = -32601 JsonRpcInvalidParams = -32602 JsonRpcInternalErrorCode = -32603 JsonRpcForbidden = -32003 // Not part of the official spec )
Variables ¶
This section is empty.
Functions ¶
func NewErrorResponse ¶ added in v0.368.0
func NewHandler ¶
func NewSuccessResponse ¶ added in v0.368.0
Types ¶
type JsonRpcError ¶
type JsonRpcErrorResponse ¶
type JsonRpcErrorResponse struct { JsonRpc string `json:"jsonrpc"` ID *string `json:"id"` Error JsonRpcError `json:"error"` }
type JsonRpcRequest ¶
type JsonRpcRequest struct { JsonRpc string `json:"jsonrpc"` ID string `json:"id"` Method string `json:"method"` Params map[string]any `json:"params"` }
func (JsonRpcRequest) Valid ¶
func (r JsonRpcRequest) Valid() bool
type JsonRpcSuccessResponse ¶
Click to show internal directories.
Click to hide internal directories.