Пример #1
0
func newAccount() *Account {
	account := &Account{}
	util.ProjectName = "gotrade"
	err := util.YamlFileDecode(util.GetBasePath()+"/config/trade.yaml", account)
	if err != nil {
		panic(err)
	}
	account.Login()
	return account
}
Пример #2
0
func New(configPath string) (subscriber *Subscriber) {
	config := &Configuration{}
	err := util.YamlFileDecode(configPath, config)
	if err != nil {
		panic(err)
	}
	subscriber = &Subscriber{}
	subscriber.codeList = []string{}
	subscriber.strategyMap = make(map[string][]string)
	subscriber.quotationChanMap = make(map[string]chan *Quotation)
	subscriber.IP = config.IP
	subscriber.logger = util.NewLogger("subscriber")
	return
}