Documentation ¶
Index ¶
- Variables
- func GetSafetyPeriod() int64
- func GetUserUpdateTime(puname string, coin string) int64
- func HTTPPost(api AutoRegAPIConfig, data interface{}) (response []byte, err error)
- func InitUserCoin(coin string, url string)
- func Main(configFilePath string)
- func RunUserAutoReg(config *ConfigData)
- type APIError
- type AutoRegAPIConfig
- type ConfigData
- type HTTPRequestHandle
- type UserIDMapEmptyResponse
- type UserIDMapResponse
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") // APIErrRecordExists record already exists APIErrRecordExists = NewAPIError(108, "record exists, skip") )
Functions ¶
func GetSafetyPeriod ¶
func GetSafetyPeriod() int64
GetSafetyPeriod Get the security period of the user update (during the security period, the sub-account may not have entered the sserver's cache)
func GetUserUpdateTime ¶
GetUserUpdateTime Get the user's update time (i.e. when the list was entered)
func HTTPPost ¶
func HTTPPost(api AutoRegAPIConfig, data interface{}) (response []byte, err error)
HTTPPost Call the HTTP Post method
func InitUserCoin ¶
InitUserCoin Pull the user id list to initialize the user currency record
func RunUserAutoReg ¶
func RunUserAutoReg(config *ConfigData)
RunUserAutoReg Run the auto-registration task
Types ¶
type AutoRegAPIConfig ¶
type AutoRegAPIConfig struct { IntervalSeconds time.Duration URL string User string Password string DefaultCoin string PostData map[string]string }
AutoRegAPIConfig User auto-registration API definition
type ConfigData ¶
type ConfigData struct { // UserListAPI The list of users corresponding to the currency, in the form of {"btc":"url", "bcc":"url"} UserListAPI map[string]string // IntervalSeconds The time between each pull IntervalSeconds uint // Zookeeper cluster IP:port list ZKBroker []string // ZKSwitcherWatchDir Zookeeper path monitored by Switcher, ending with a slash ZKSwitcherWatchDir string // EnableUserAutoReg Enable user auto-registration EnableUserAutoReg bool // ZKAutoRegWatchDir The zookeeper monitoring address automatically registered by the user, ending with a slash ZKAutoRegWatchDir string // UserAutoRegAPI User auto-registration API UserAutoRegAPI AutoRegAPIConfig // StratumServerCaseInsensitive 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 // ZKUserCaseInsensitiveIndex Case-insensitive subaccount index //(Nullable, only if StratumServerCaseInsensitive == false used) ZKUserCaseInsensitiveIndex string // Whether to enable API Server EnableAPIServer bool // API Server The listening IP:port ListenAddr string }
ConfigData Configuration Data
type HTTPRequestHandle ¶
type HTTPRequestHandle func(http.ResponseWriter, *http.Request)
HTTPRequestHandle HTTP request handler
type UserIDMapEmptyResponse ¶
type UserIDMapEmptyResponse struct { ErrNo int `json:"err_no"` ErrMsg string `json:"err_msg"` Data []interface{} `json:"data"` }
UserIDMapEmptyResponse The response of the user id list interface when the number of users is 0
Click to show internal directories.
Click to hide internal directories.