jsonrpc

package
v0.0.0-...-418e995 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeParseError        int = -32700
	CodeInvalidRequest    int = -32600
	CodeMethodNotFound    int = -32601
	CodeInvalidParameters int = -32602
	CodeInternalError     int = -32603
)

Error codes generated by a JSONRPC Server

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Debug bool
	// contains filtered or unexported fields
}

func NewClient

func NewClient(addr string) (client *Client)

func (Client) Call

func (client Client) Call(method string, username string, password string,
	params interface{}, results interface{}) (err error)

type MethodInterface

type MethodInterface interface {
	Params() ParametersInterface
	Action(request *http.Request, params ParametersInterface) (response interface{}, err error)
}

type ParametersInterface

type ParametersInterface interface {
	Validate() error
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService() *Service

func (*Service) RegisterMethod

func (service *Service) RegisterMethod(name string, method MethodInterface) (err error)

func (*Service) ServeHTTP

func (service *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL