Documentation ¶
Index ¶
- func CheckParamBool(r *http.Request, key string, defValue bool) bool
- func CheckParamHex(r *http.Request, key string, defv []byte) []byte
- func CheckParamHexMustLen(r *http.Request, key string, mustLen int) []byte
- func CheckParamString(r *http.Request, key string, defValue string) string
- func CheckParamUint64(r *http.Request, key string, defValue uint64) uint64
- func CheckParamUint64Must(r *http.Request, w http.ResponseWriter, key string) (uint64, bool)
- func ResponseCreateData(key string, value interface{}) map[string]interface{}
- func ResponseData(w http.ResponseWriter, data map[string]interface{})
- func ResponseError(w http.ResponseWriter, err error)
- func ResponseErrorString(w http.ResponseWriter, errstr string)
- func ResponseErrorStringWithCode(w http.ResponseWriter, errcode int, errstr string)
- func ResponseJSON(w http.ResponseWriter, resobj interface{}) error
- func ResponseJSONbytes(w http.ResponseWriter, content []byte) error
- func ResponseList(w http.ResponseWriter, data interface{})
- func ResponseLocation(w http.ResponseWriter, url string)
- type RpcConfig
- type RpcService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckParamHexMustLen ¶
func CheckParamUint64Must ¶
func ResponseCreateData ¶
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 ¶
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.