api

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountGet

func AccountGet(w http.ResponseWriter, r *http.Request)

AccountGet get account of the address on the chain

func BlockInfoGet

func BlockInfoGet(w http.ResponseWriter, r *http.Request)

BlockInfoGet get block info

func BlockMinePost

func BlockMinePost(w http.ResponseWriter, r *http.Request)

BlockMinePost mine

func BlockRollback

func BlockRollback(w http.ResponseWriter, r *http.Request)

BlockRollback rollback

func ChainNew

func ChainNew(w http.ResponseWriter, r *http.Request)

ChainNew new chain

func CryptoCheck added in v0.3.2

func CryptoCheck(w http.ResponseWriter, r *http.Request)

CryptoCheck Crypto:check the sign

func CryptoSign added in v0.3.2

func CryptoSign(w http.ResponseWriter, r *http.Request)

CryptoSign crypto:sign message

func DataGet added in v0.3.2

func DataGet(w http.ResponseWriter, r *http.Request)

DataGet read data

func DataNextKeyGet added in v0.3.2

func DataNextKeyGet(w http.ResponseWriter, r *http.Request)

DataNextKeyGet get next key

func DataPost added in v0.3.9

func DataPost(w http.ResponseWriter, r *http.Request)

DataPost post data

func EventPost

func EventPost(w http.ResponseWriter, r *http.Request)

EventPost mine

func HashPowerGet added in v0.4.1

func HashPowerGet(w http.ResponseWriter, r *http.Request)

HashPowerGet get hashpower info

func HistoryInGet

func HistoryInGet(w http.ResponseWriter, r *http.Request)

HistoryInGet get transaction history of recieve

func HistoryOutGet

func HistoryOutGet(w http.ResponseWriter, r *http.Request)

HistoryOutGet get transaction history of send

func Index

func Index(w http.ResponseWriter, r *http.Request)

Index api接口的默认的处理函数

func Logger

func Logger(inner http.Handler, name string) http.Handler

Logger print log

func NewRouter

func NewRouter() *mux.Router

NewRouter 创建http路由

func NodePost

func NodePost(w http.ResponseWriter, r *http.Request)

NodePost add new node

func NodesGet

func NodesGet(w http.ResponseWriter, r *http.Request)

NodesGet get nodes

func TransactionAppInfoGet

func TransactionAppInfoGet(w http.ResponseWriter, r *http.Request)

TransactionAppInfoGet get app info

func TransactionAppLifePost

func TransactionAppLifePost(w http.ResponseWriter, r *http.Request)

TransactionAppLifePost update app life

func TransactionInfoGet

func TransactionInfoGet(w http.ResponseWriter, r *http.Request)

TransactionInfoGet get transaction info

func TransactionMinerGet

func TransactionMinerGet(w http.ResponseWriter, r *http.Request)

TransactionMinerGet get miner info

func TransactionMinerPost

func TransactionMinerPost(w http.ResponseWriter, r *http.Request)

TransactionMinerPost register miner

func TransactionMovePost

func TransactionMovePost(w http.ResponseWriter, r *http.Request)

TransactionMovePost move cost to other chain

func TransactionNew added in v0.3.5

func TransactionNew(w http.ResponseWriter, r *http.Request)

TransactionNew new transaction

func TransactionNewAppPost

func TransactionNewAppPost(w http.ResponseWriter, r *http.Request)

TransactionNewAppPost new app

func TransactionRunAppPost

func TransactionRunAppPost(w http.ResponseWriter, r *http.Request)

TransactionRunAppPost run app

func TransactionTransferPost added in v0.3.9

func TransactionTransferPost(w http.ResponseWriter, r *http.Request)

TransactionTransferPost transfer

func VersionGet

func VersionGet(w http.ResponseWriter, r *http.Request)

VersionGet get software version

Types

type Account

type Account struct {
	Chain   uint64 `json:"chain,omitempty"`
	Address string `json:"address,omitempty"`
	Cost    uint64 `json:"cost,omitempty"`
}

Account account

type AppLife

type AppLife struct {
	Energy   uint64 `json:"energy,omitempty"`
	AppName  string `json:"app_name,omitempty"`
	Life     uint64 `json:"life,omitempty"`
	TransKey string `json:"trans_key,omitempty"`
}

AppLife app life

type ChainNewInfo

type ChainNewInfo struct {
	DstChain uint64 `json:"dst_chain,omitempty"`
	Cost     uint64 `json:"cost,omitempty"`
	Energy   uint64 `json:"energy,omitempty"`
	TransKey string `json:"trans_key,omitempty"`
}

ChainNewInfo info of new chain

type CryptoInfo added in v0.3.2

type CryptoInfo struct {
	Owner   string
	Sign    string
	Message string
	HexMsg  bool
}

CryptoInfo crypto info

type DataInfo added in v0.3.2

type DataInfo struct {
	AppName    string `json:"app_name,omitempty"`
	StructName string `json:"struct_name,omitempty"`
	IsDBData   bool   `json:"is_db_data,omitempty"`
	Key        string `json:"key,omitempty"`
	Value      string `json:"value,omitempty"`
	Life       uint64 `json:"life,omitempty"`
}

DataInfo data info

type DataNextKey added in v0.3.2

type DataNextKey struct {
	AppName    string `json:"app_name,omitempty"`
	StructName string `json:"struct_name,omitempty"`
	PreKey     string `json:"pre_key,omitempty"`
	IsDBData   bool   `json:"is_db_data,omitempty"`
	Key        string `json:"key,omitempty"`
}

DataNextKey the next key of data

type EventInfo

type EventInfo struct {
	Who   string
	Event string
	Param string
}

EventInfo event

type Miner

type Miner struct {
	TagetChain uint64 `json:"taget_chain,omitempty"`
	Index      uint64 `json:"index,omitempty"`
	Cost       uint64 `json:"cost,omitempty"`
	Energy     uint64 `json:"energy,omitempty"`
	TransKey   string `json:"trans_key,omitempty"`
}

Miner miner info

type MinerInfo

type MinerInfo struct {
	Index uint64 `json:"index,omitempty"`
	core.Miner
}

MinerInfo miner info of get

type NewApp

type NewApp struct {
	Cost         uint64 `json:"cost,omitempty"`
	Energy       uint64 `json:"energy,omitempty"`
	CodePath     string `json:"code_path,omitempty"`
	IsPrivate    bool   `json:"is_private,omitempty"`
	EnableRun    bool   `json:"enable_run,omitempty"`
	EnableImport bool   `json:"enable_import,omitempty"`
	AppName      string `json:"app_name,omitempty"`
	TransKey     string `json:"trans_key,omitempty"`
}

NewApp new app

type RespOfNewTrans added in v0.3.2

type RespOfNewTrans struct {
	Chain    uint64 `json:"chain,omitempty"`
	TransKey string `json:"trans_key,omitempty"`
}

RespOfNewTrans the response of New Transaction

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

Route 单个http路由信息的结构体

type Routes

type Routes []Route

Routes 路由列表

type RunApp

type RunApp struct {
	Cost      uint64      `json:"cost,omitempty"`
	Energy    uint64      `json:"energy,omitempty"`
	AppName   string      `json:"app_name,omitempty"`
	Param     string      `json:"param,omitempty"`
	ParamType string      `json:"param_type,omitempty"`
	JSONParam interface{} `json:"json_param,omitempty"`
}

RunApp run app

type TransInfo

type TransInfo struct {
	core.TransactionHead
	Key    []byte
	Size   int
	Others interface{}
}

TransInfo transaction info

type TransMoveInfo

type TransMoveInfo struct {
	DstChain uint64 `json:"dst_chain,omitempty"`
	Cost     uint64 `json:"cost,omitempty"`
	Energy   uint64 `json:"energy,omitempty"`
	TransKey string `json:"trans_key,omitempty"`
}

TransMoveInfo move info

type TransferInfo added in v0.3.9

type TransferInfo struct {
	Peer     string `json:"peer,omitempty"`
	Cost     uint64 `json:"cost,omitempty"`
	Energy   uint64 `json:"energy,omitempty"`
	TransKey string `json:"trans_key,omitempty"`
}

TransferInfo transfer info

type VersionInfo

type VersionInfo struct {
	Version   string
	BuildTime string
	GitHead   string
}

VersionInfo version info

Jump to

Keyboard shortcuts

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