restful

package
v0.0.0-...-8377674 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GET_EXPLORER_INFO    = "/api/v1/getexplorerinfo"
	GET_CROSSTX          = "/api/v1/getcrosstx"
	GET_CROSSTX_LIST     = "/api/v1/getcrosstxlist"
	GET_TOKENTX_LIST     = "/api/v1/gettokentxlist"
	GET_ADDRESSTX_LIST   = "/api/v1/getaddresstxlist"
	GET_LATEST_VALIDATOR = "/api/v1/getlatestvalidator"
)
View Source
const MAX_REQUEST_BODY_SIZE = 1 << 20
View Source
const TLS_PORT int = 443

Variables

This section is empty.

Functions

func GetAddressTxList

func GetAddressTxList(cmd map[string]interface{}) map[string]interface{}

func GetCrossTx

func GetCrossTx(cmd map[string]interface{}) map[string]interface{}

func GetCrossTxList

func GetCrossTxList(cmd map[string]interface{}) map[string]interface{}

func GetExplorerInfo

func GetExplorerInfo(cmd map[string]interface{}) map[string]interface{}

func GetLatestValidator

func GetLatestValidator(cmd map[string]interface{}) map[string]interface{}

func GetTokenTxList

func GetTokenTxList(cmd map[string]interface{}) map[string]interface{}

func InitInterface

func InitInterface()

func ResponsePack

func ResponsePack(code int64) map[string]interface{}

func StartMonitorService

func StartMonitorService(context *ctx.Context)

func StopService

func StopService()

Types

type Action

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

type RestServer

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

func InitRestServer

func InitRestServer(context *ctx.Context) *RestServer

init restful server

func (*RestServer) Restart

func (this *RestServer) Restart(context *ctx.Context, cmd map[string]interface{}) map[string]interface{}

restart server

func (*RestServer) Start

func (this *RestServer) Start() error

start server

func (*RestServer) Stop

func (this *RestServer) Stop(context *ctx.Context)

stop restful server

type Route

type Route struct {
	Method  string
	Path    *regexp.Regexp
	Params  []string
	Handler http.HandlerFunc
}

http router

type Router

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

func NewRouter

func NewRouter() *Router

func (*Router) Connect

func (r *Router) Connect(path string, handler http.HandlerFunc)

func (*Router) Delete

func (r *Router) Delete(path string, handler http.HandlerFunc)

func (*Router) Get

func (r *Router) Get(path string, handler http.HandlerFunc)

func (*Router) Head

func (r *Router) Head(path string, handler http.HandlerFunc)

func (*Router) Options

func (r *Router) Options(path string, handler http.HandlerFunc)

func (*Router) Post

func (r *Router) Post(path string, handler http.HandlerFunc)

func (*Router) Put

func (r *Router) Put(path string, handler http.HandlerFunc)

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Router) Try

func (this *Router) Try(path string, method string) (http.HandlerFunc, paramsMap, error)

Jump to

Keyboard shortcuts

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