constant

package
v0.0.0-...-61197bd Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

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

View Source
const AccountOne = "jjjjjjjjjjjjjjjjjjjjBZbvri"

AccountOne AccountOne

View Source
const AccountPrefix uint8 = 0

AccountPrefix AccountPrefix

View Source
const CommandAccountCurrencies = "account_currencies"

CommandAccountCurrencies 获得账号可接收和发送的货币

View Source
const CommandAccountInfo = "account_info"

CommandAccountInfo 获取账号信息

View Source
const CommandAccountLines = "account_lines"

CommandAccountLines CommandAccountLines

View Source
const CommandAccountOffers = "account_offers"

CommandAccountOffers 获得账号挂单

View Source
const CommandAccountRelation = "account_relation"

CommandAccountRelation CommandAccountRelation

View Source
const CommandAccountTX = "account_tx"

CommandAccountTX 获得账号交易列表

View Source
const CommandBookOffers = "book_offers"

CommandBookOffers 获得市场挂单列表

View Source
const CommandDisconnect = "server_disconnect"

CommandDisconnect 服务关闭命令,用于底层链接断开后终止消息监听线程

View Source
const CommandLedger = "ledger"

CommandLedger 获取某一账本命令

View Source
const CommandLedgerClosed = "ledger_closed"

CommandLedgerClosed 获取最新账本命令

View Source
const CommandServerInfo = "server_info"

CommandServerInfo CommandServerInfo

View Source
const CommandSubmit = "submit"

CommandSubmit 提交命令

View Source
const CommandSubscribe = "subscribe"

CommandSubscribe 订阅事件

View Source
const CommandTX = "tx"

CommandTX 查询某一交易信息命令

View Source
const CommandUnSubscribe = "unsubscribe"

CommandUnSubscribe 退订事件

View Source
const EventLedgerClosed = "ledger_closed"

EventLedgerClosed 账本事件

View Source
const EventPathFind = "path_find"

EventPathFind 支付路径事件

View Source
const EventServerStatus = "server_status"

EventServerStatus 服务状态事件

View Source
const EventTX = "transactions"

EventTX 交易事件

View Source
const RegexCurrency = "^([a-zA-Z0-9]{3,6}|[A-F0-9]{40})$"

RegexCurrency RegexCurrency

View Source
const SeedPrefix uint8 = 33

SeedPrefix SeedPrefix

View Source
const TxJSONErrorKey = "Error"

TxJSONErrorKey TxJSONErrorKey

Variables

View Source
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.")
)
View Source
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 Integer

type Integer struct {
	// contains filtered or unexported fields
}

Integer int 包装结构。

func NewInteger

func NewInteger(intv int) *Integer

NewInteger 创建int的包装类型

func (*Integer) IntValue

func (integer *Integer) IntValue() int

IntValue 基本类型int

func (*Integer) String

func (integer *Integer) String() string

type KeyValuePair

type KeyValuePair struct {
	Key   int
	Value int
}

KeyValuePair 字典映射

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 区块连网络响应数据结构。

Jump to

Keyboard shortcuts

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