restful

package
v0.0.0-...-67b0b38 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Api_Getconnectioncount  = "/api/v1/node/connectioncount"
	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_GetTotalIssued      = "/api/v1/totalissued/:assetid"
	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_GetLockedAsset      = "/api/v1/asset/locked/:addr/:assetid"
	Api_GetUTXObyAsset      = "/api/v1/asset/utxo/:addr/:assetid"
	Api_GetUTXObyAddr       = "/api/v1/asset/utxos/:addr"
	Api_SendRawTx           = "/api/v1/transaction"
	Api_SendRcdTxByTrans    = "/api/v1/custom/transaction/record"
	Api_GetStateUpdate      = "/api/v1/stateupdate/:namespace/:key"
	Api_OauthServerUrl      = "/api/v1/config/oauthserver/url"
	Api_NoticeServerUrl     = "/api/v1/config/noticeserver/url"
	Api_NoticeServerState   = "/api/v1/config/noticeserver/state"
	Api_WebsocketState      = "/api/v1/config/websocket/state"
	Api_Restart             = "/api/v1/restart"
	Api_GetContract         = "/api/v1/contract/:hash"
	Api_GetRecordByHash     = "/api/v1/custom/record/:hash"
	Api_GetRecordByFileHash = "/api/v1/custom/file/:hash"
	Api_SendToAddress       = "/api/v1/sendtoaddress"
	Api_GetNewAddress       = "/api/v1/getnewaddress"
	Api_SendToManyAddress   = "/api/v1/sendtomanyaddress"
)

Variables

This section is empty.

Functions

func InitRestServer

func InitRestServer(checkAccessToken func(string, string) (string, errors.ErrCode, interface{})) ApiServer

Types

type Action

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

type Params

type Params map[string]string

type Route

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

type Router

type Router struct {
	Routes []*Route
}

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 (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