httprestful

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApiGetConnectionCount  = "/api/v1/node/connectioncount"
	ApiGetNodeState        = "/api/v1/node/state"
	ApiGetBlockTxsByHeight = "/api/v1/block/transactions/height/:height"
	ApiGetBlockByHeight    = "/api/v1/block/details/height/:height"
	ApiGetBlockByHash      = "/api/v1/block/details/hash/:hash"
	ApiGetConfirmByHeight  = "/api/v1/confirm/details/height/:height"
	ApiGetConfirmByHash    = "/api/v1/confirm/details/hash/:hash"
	ApiGetBlockHeight      = "/api/v1/block/height"
	ApiGetBlockHash        = "/api/v1/block/hash/:height"
	ApiGetTransaction      = "/api/v1/transaction/:hash"
	ApiGetAsset            = "/api/v1/asset/:hash"
	ApiGetBalanceByAddr    = "/api/v1/asset/balances/:addr"
	ApiGetBalanceByAsset   = "/api/v1/asset/balance/:addr/:assetid"
	ApiGetUTXOByAsset      = "/api/v1/asset/utxo/:addr/:assetid"
	ApiGetUTXOByAddr       = "/api/v1/asset/utxos/:addr"
	ApiSendRawTransaction  = "/api/v1/transaction"
	ApiGetTransactionPool  = "/api/v1/transactionpool"
	ApiRestart             = "/api/v1/restart"
)

Variables

This section is empty.

Functions

func StartServer

func StartServer()

Types

type Action

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

type ApiServer

type ApiServer interface {
	Start()
	Stop()
}

func InitRestServer

func InitRestServer() ApiServer

type Route

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

type Router

type Router struct {
	Routes []*Route
}

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 (r *Router) Try(path string, method string) (http.HandlerFunc, Params, error)

Jump to

Keyboard shortcuts

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