Documentation ¶
Index ¶
Constants ¶
View Source
const ErrorNoUserInfo string = "No information returned with the given address"
ErrorNoUserInfo indicates no information returned with successful state code
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mongo ¶
type Mongo interface { PutUserHistory(doc *UserHistory) error GetUserHistory(addr string) (*UserHistory, error) }
Mongo deals with mongo database stuffs
type Unspent ¶
type Unspent struct { Transaction string VOutIdx uint64 ScriptPubKey string Amount uint64 BlockTime uint64 }
Unspent is used for the store of User's unspent transaction information, kept in UserHistory
type UserHistory ¶
type UserHistory struct { Address string `json:"a"` Timestamp time.Time `json:"t"` Subtotal int64 `json:"sbtl"` Spents map[string]bool `json:"spts"` UnspentAmts map[string]uint64 `json:"usptsams"` Unspents []Unspent `json:"uspts"` Shadowspents []string `json:"sdspts"` Transactions []string `json:"txs"` Skipped uint64 `json:"skd"` }
UserHistory keeps all revelant information about balance, transaction history, unspent... Note that it can also be used for the struct of user data in redis, well implemented in json representation as bytes array
Click to show internal directories.
Click to hide internal directories.