server

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerFunc added in v1.2.0

type HandlerFunc func(ctx context.Context, params jsonrpc.Params) (jsonrpc.Result, error)

HandlerFunc is a handler function.

type Server

type Server interface {
	Register(method string, handler HandlerFunc)
	Invoke(ctx context.Context, body []byte) ([]byte, error)
	//
	Path() string
	Run(addr ...string) error
}

Server is a JSON-RPC server.

func New

func New(path ...string) Server

New creates a new JSON-RPC server.

Jump to

Keyboard shortcuts

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