httprestful

package
v0.2.1-80ce Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: MIT Imports: 15 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 (
	Api_Getconnectioncount  = "/api/v1/node/connectioncount"
	Api_GetNodeState        = "/api/v1/node/state"
	Api_GetblockTxsByHeight = "/api/v1/block/transactions/height/:height"
	Api_Getblockbyheight    = "/api/v1/block/details/height/:height"
	Api_Getblockbyhash      = "/api/v1/block/details/hash/:hash"
	Api_Getblockheight      = "/api/v1/block/height"
	Api_Getblockhash        = "/api/v1/block/hash/:height"
	Api_Gettransaction      = "/api/v1/transaction/:hash"
	Api_Getasset            = "/api/v1/asset/:hash"
	Api_GetBalanceByAddr    = "/api/v1/asset/balances/:addr"
	Api_GetBalancebyAsset   = "/api/v1/asset/balance/:addr/:assetid"
	Api_GetUTXObyAsset      = "/api/v1/asset/utxo/:addr/:assetid"
	Api_GetUTXObyAddr       = "/api/v1/asset/utxos/:addr"
	Api_SendRawTransaction  = "/api/v1/transaction"
	Api_GetTransactionPool  = "/api/v1/transactionpool"
	Api_Restart             = "/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