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 }
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 }