httpjson

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCServer

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

func NewServer

func NewServer(localNode node.ILocalNode, wallet *vault.Wallet) *RPCServer

NewServer will create a new RPC server instance.

func (*RPCServer) GetLocalNode

func (s *RPCServer) GetLocalNode() node.ILocalNode

func (*RPCServer) GetNetNode

func (s *RPCServer) GetNetNode() node.ILocalNode

func (*RPCServer) Handle

func (s *RPCServer) Handle(w http.ResponseWriter, r *http.Request)

Handle is the function that should be called in order to answer an rpc call should be registered like "http.HandleFunc("/", httpjsonrpc.Handle)"

func (*RPCServer) HandleFunc

func (s *RPCServer) HandleFunc(pattern string, handler common.Handler)

function to register functions to be called for specific rpc calls

func (*RPCServer) SetDefaultFunc

func (s *RPCServer) SetDefaultFunc(def func(http.ResponseWriter, *http.Request))

function to be called if the request is not a HTTP JSON RPC call

func (*RPCServer) SetLocalNode

func (s *RPCServer) SetLocalNode(ln node.ILocalNode)

func (*RPCServer) Start

func (s *RPCServer) Start(httpsCertReady chan struct{})

type ServeMux

type ServeMux struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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