Documentation ¶
Index ¶
- Variables
- func Main(configFilePath string)
- func RunCronJob()
- type APIError
- type APIResponse
- type ConfigData
- type HTTPRequestHandle
- type SubPoolCoinbase
- type SubPoolUpdate
- type SubPoolUpdateAck
- type SubPoolUpdateAckInner
- type SwitchMultiUserRequest
- type SwitchUserCoins
- type UserCoinMapData
- type UserCoinMapResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // APIErrPunameIsEmpty puname is empty APIErrPunameIsEmpty = NewAPIError(101, "puname is empty") // APIErrPunameInvalid puname is illegal APIErrPunameInvalid = NewAPIError(102, "puname invalid") // APIErrCoinIsEmpty coin is empty APIErrCoinIsEmpty = NewAPIError(103, "coin is empty") // APIErrCoinIsInexistent coin is empty APIErrCoinIsInexistent = NewAPIError(104, "coin is inexistent") // APIErrReadRecordFailed Failed to read record APIErrReadRecordFailed = NewAPIError(105, "read record failed") // APIErrWriteRecordFailed Failed to write record APIErrWriteRecordFailed = NewAPIError(107, "write record failed") // APIErrUserCoinsEmpty User currency array is empty APIErrUserCoinsEmpty = NewAPIError(108, "usercoins is empty") )
Functions ¶
Types ¶
type APIResponse ¶
type APIResponse struct { ErrNo int `json:"err_no"` ErrMsg string `json:"err_msg"` Success bool `json:"success"` }
APIResponse API response data structure
type ConfigData ¶
type ConfigData struct { // Whether to enable API Server EnableAPIServer bool // API username APIUser string // API password APIPassword string // API Server The listening IP:port ListenAddr string // AvailableCoins Available currencies, like {"btc", "bcc", ...} AvailableCoins []string // Zookeeper cluster IP:port list ZKBroker []string // ZKSwitcherWatchDir Zookeeper path monitored by Switcher, ending with a slash ZKSwitcherWatchDir string // Whether to enable scheduled detection tasks EnableCronJob bool // Timing detection interval time CronIntervalSeconds int // User: URL of currency correspondence table UserCoinMapURL string // The mining server is not case sensitive to the sub-account name, in this case, it will always write the sub-account name in lowercase StratumServerCaseInsensitive bool //The zookeeper root directory for sub-pool updates (note that the currency and sub-pool name should not be included), ending with a slash ZKSubPoolUpdateBaseDir string // The response timeout time of the jobmaker when the subpool is updated. If the jobmaker does not respond within this time, the API returns an error ZKSubPoolUpdateAckTimeout int }
ConfigData Configuration Data
type HTTPRequestHandle ¶
type HTTPRequestHandle func(http.ResponseWriter, *http.Request)
HTTPRequestHandle HTTP request handler
type SubPoolCoinbase ¶
type SubPoolCoinbase struct { Success bool `json:"success"` ErrNo int `json:"err_no"` ErrMsg string `json:"err_msg"` SubPoolName string `json:"subpool_name"` Old struct { CoinbaseInfo string `json:"coinbase_info"` PayoutAddr string `json:"payout_addr"` } `json:"old"` }
SubPoolCoinbase Subpool Coinbase Information
type SubPoolUpdate ¶
type SubPoolUpdate struct { Coin string `json:"coin"` SubPoolName string `json:"subpool_name"` CoinbaseInfo string `json:"coinbase_info"` PayoutAddr string `json:"payout_addr"` }
SubPoolUpdate Subpool update information
type SubPoolUpdateAck ¶
type SubPoolUpdateAck struct { SubPoolCoinbase New struct { CoinbaseInfo string `json:"coinbase_info"` PayoutAddr string `json:"payout_addr"` } `json:"new"` }
SubPoolUpdateAck Subpool update response
type SubPoolUpdateAckInner ¶
type SubPoolUpdateAckInner struct { SubPoolUpdateAck Host struct { HostName string `json:"hostname"` } `json:"host"` }
SubPoolUpdateAckInner Subpool update response (non-public)
type SwitchMultiUserRequest ¶
type SwitchMultiUserRequest struct {
UserCoins []SwitchUserCoins `json:"usercoins"`
}
SwitchMultiUserRequest Multi-user handover request data structure
type SwitchUserCoins ¶
SwitchUserCoins User and currency to switch
type UserCoinMapData ¶
type UserCoinMapData struct { UserCoin map[string]string `json:"user_coin"` NowDate int64 `json:"now_date"` }
UserCoinMapData The data field data structure of the user currency list interface response
type UserCoinMapResponse ¶
type UserCoinMapResponse struct { ErrNo int `json:"err_no"` ErrMsg string `json:"err_msg"` Data UserCoinMapData `json:"data"` }
UserCoinMapResponse The data structure of the user currency list interface response
Click to show internal directories.
Click to hide internal directories.