func newAccount() *Account { account := &Account{} err := util.YamlFileDecode(util.GetBasePath()+"/config/account.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 }