rpc

package
v0.0.0-...-d0b7733 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 21 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckParamBool

func CheckParamBool(r *http.Request, key string, defValue bool) bool

func CheckParamHex

func CheckParamHex(r *http.Request, key string, defv []byte) []byte

func CheckParamHexMustLen

func CheckParamHexMustLen(r *http.Request, key string, mustLen int) []byte

func CheckParamString

func CheckParamString(r *http.Request, key string, defValue string) string

func CheckParamUint64

func CheckParamUint64(r *http.Request, key string, defValue uint64) uint64

func CheckParamUint64Must

func CheckParamUint64Must(r *http.Request, w http.ResponseWriter, key string) (uint64, bool)

func ResponseCreateData

func ResponseCreateData(key string, value interface{}) map[string]interface{}

func ResponseData

func ResponseData(w http.ResponseWriter, data map[string]interface{})

func ResponseError

func ResponseError(w http.ResponseWriter, err error)

func ResponseErrorString

func ResponseErrorString(w http.ResponseWriter, errstr string)

func ResponseErrorStringWithCode

func ResponseErrorStringWithCode(w http.ResponseWriter, errcode int, errstr string)

func ResponseJSON

func ResponseJSON(w http.ResponseWriter, resobj interface{}) error

func ResponseJSONbytes

func ResponseJSONbytes(w http.ResponseWriter, content []byte) error

func ResponseList

func ResponseList(w http.ResponseWriter, data interface{})

func ResponseLocation

func ResponseLocation(w http.ResponseWriter, url string)

Types

type RpcConfig

type RpcConfig struct {
	HttpListenPort int
}

func NewEmptyRpcConfig

func NewEmptyRpcConfig() *RpcConfig

func NewRpcConfig

func NewRpcConfig(inicnf *sys.Inicnf) *RpcConfig

type RpcService

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

func NewRpcService

func NewRpcService(cnf *RpcConfig) *RpcService

func (*RpcService) RunHttpRpcService

func (api *RpcService) RunHttpRpcService(port int)

func (*RpcService) SetBackend

func (api *RpcService) SetBackend(backend interfaces.Backend)

func (*RpcService) SetTxPool

func (api *RpcService) SetTxPool(txpool interfaces.TxPool)

func (*RpcService) Start

func (api *RpcService) Start() error

Jump to

Keyboard shortcuts

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