restful

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2018 License: LGPL-3.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	GET_GEN_BLK_TIME      = "/api/v1/node/generateblocktime"
	GET_CONN_COUNT        = "/api/v1/node/connectioncount"
	GET_BLK_TXS_BY_HEIGHT = "/api/v1/block/transactions/height/:height"
	GET_BLK_BY_HEIGHT     = "/api/v1/block/details/height/:height"
	GET_BLK_BY_HASH       = "/api/v1/block/details/hash/:hash"
	GET_BLK_HEIGHT        = "/api/v1/block/height"
	GET_BLK_HASH          = "/api/v1/block/hash/:height"
	GET_TX                = "/api/v1/transaction/:hash"
	GET_STORAGE           = "/api/v1/storage/:hash/:key"
	GET_BALANCE           = "/api/v1/balance/:addr"
	GET_CONTRACT_STATE    = "/api/v1/contract/:hash"
	GET_SMTCOCE_EVT_TXS   = "/api/v1/smartcode/event/transactions/:height"
	GET_SMTCOCE_EVTS      = "/api/v1/smartcode/event/txhash/:hash"
	GET_BLK_HGT_BY_TXHASH = "/api/v1/block/height/txhash/:hash"
	GET_MERKLE_PROOF      = "/api/v1/merkleproof/:hash"
	GET_GAS_PRICE         = "/api/v1/gasprice"
	GET_ALLOWANCE         = "/api/v1/allowance/:asset/:from/:to"
	GET_UNBOUNDONG        = "/api/v1/unboundong/:addr"
	GET_MEMPOOL_TXCOUNT   = "/api/v1/mempool/txcount"
	GET_MEMPOOL_TXSTATE   = "/api/v1/mempool/txstate/:hash"
	GET_VERSION           = "/api/v1/version"

	POST_RAW_TX = "/api/v1/transaction"
)

Variables

This section is empty.

Functions

func InitRestServer

func InitRestServer() rest.ApiServer

Types

type Action

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

type Route

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

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