Documentation ¶
Overview ¶
*
- 常量类。 *
- @FileName: errorCode.go
- @Auther : 杨雪波
- @Email : yangxuebo@yeah.net
- @CreateTime: 2018-07-26 10:44:32
- @UpdateTime: 2018-07-26 10:44:54
*
- 全局变量定义类。 *
- @FileName: global.go
- @Auther : 杨雪波
- @Email : yangxuebo@yeah.net
- @CreateTime: 2018-07-26 10:44:32
- @UpdateTime: 2018-07-26 10:44:54
Index ¶
Constants ¶
const AccountOne = "jjjjjjjjjjjjjjjjjjjjBZbvri"
AccountOne AccountOne
const AccountPrefix uint8 = 0
AccountPrefix AccountPrefix
const CommandAccountCurrencies = "account_currencies"
CommandAccountCurrencies 获得账号可接收和发送的货币
const CommandAccountInfo = "account_info"
CommandAccountInfo 获取账号信息
const CommandAccountLines = "account_lines"
CommandAccountLines CommandAccountLines
const CommandAccountOffers = "account_offers"
CommandAccountOffers 获得账号挂单
const CommandAccountRelation = "account_relation"
CommandAccountRelation CommandAccountRelation
const CommandAccountTX = "account_tx"
CommandAccountTX 获得账号交易列表
const CommandBookOffers = "book_offers"
CommandBookOffers 获得市场挂单列表
const CommandDisconnect = "server_disconnect"
CommandDisconnect 服务关闭命令,用于底层链接断开后终止消息监听线程
const CommandLedger = "ledger"
CommandLedger 获取某一账本命令
const CommandLedgerClosed = "ledger_closed"
CommandLedgerClosed 获取最新账本命令
const CommandServerInfo = "server_info"
CommandServerInfo CommandServerInfo
const CommandSubmit = "submit"
CommandSubmit 提交命令
const CommandSubscribe = "subscribe"
CommandSubscribe 订阅事件
const CommandTX = "tx"
CommandTX 查询某一交易信息命令
const CommandUnSubscribe = "unsubscribe"
CommandUnSubscribe 退订事件
const EventLedgerClosed = "ledger_closed"
EventLedgerClosed 账本事件
const EventPathFind = "path_find"
EventPathFind 支付路径事件
const EventServerStatus = "server_status"
EventServerStatus 服务状态事件
const EventTX = "transactions"
EventTX 交易事件
const RegexCurrency = "^([a-zA-Z0-9]{3,6}|[A-F0-9]{40})$"
RegexCurrency RegexCurrency
const SeedPrefix uint8 = 33
SeedPrefix SeedPrefix
const TxJSONErrorKey = "Error"
TxJSONErrorKey TxJSONErrorKey
Variables ¶
var ( //通用错误码 ERR_EMPTY_PARAM = errors.New("Parameters cannot be empty.") ERR_INVALID_PARAM = errors.New("Invalid input.") //底层通信类相关错误码 ERR_SERVER_HOST_INCORRECT = errors.New("server host incorrect.") ERR_SERVER_PORT_ERROR = errors.New("server port not a number.") ERR_SERVER_PORT_OUT_OF_RANGE = errors.New("server port out of range.") ERR_SERVER_NOT_READY = errors.New("server not ready") //支付相关错误码 ERR_PAYMENT_INVALID_SRC_ADDR = errors.New("invalid source address.") ERR_PAYMENT_INVALID_DST_ADDR = errors.New("invalid destination address.") ERR_PAYMENT_INVALID_AMOUNT = errors.New("invalid amount.") ERR_PAYMENT_OUT_OF_AMOUNT = errors.New("invalid amount: amount's maximum value is 100000000000.") ERR_PAYMENT_MEMO_EMPTY = errors.New("Memo is empty.") ERR_PAYMENT_OUT_OF_MEMO_LEN = errors.New("The length of Memo shoule be less than or equal 2048.") ERR_PAYMENT_INVALID_SECRET = errors.New("invalid secret.") )
var ( //CFGCurrency 配置货币 CFGCurrency string //LedgerStates 账本状态 LedgerStates = map[string]string{"current": "current", "closed": "closed", "validated": "validated"} //RelationTypes 关系类型 RelationTypes = map[string]string{"trust": "trust", "authorize": "authorize", "freeze": "freeze", "unfreeze": "unfreeze"} //InverseFieldsMap 反转字段映射 InverseFieldsMap = map[string]*KeyValuePair{}/* 127 elements not displayed */ )
Functions ¶
This section is empty.
Types ¶
type Amount ¶
type Amount struct { //货币种类,三到六个字母或20字节的自定义货币 Currency string `json:"currency"` //货币发行方 Issuer string `json:"issuer"` //支付数量 Value string `json:"value"` }
Amount 支付金额
type ResponseData ¶
type ResponseData struct { ID uint64 `json:"id"` Status string `json:"status"` Type string `json:"type"` Result map[string]interface{} `json:"result"` Request map[string]interface{} `json:"request"` Validated bool `json:"validated"` LedgerIndex int `json:"ledger_index"` LedgerHash string `json:"ledger_hash"` ErrorMessage string `json:"error_message"` ErrorCode int `json:"error_code"` Error string `json:"error"` Account string `json:"account"` }
ResponseData 区块连网络响应数据结构。