Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONFileManager ¶ added in v4.1.16
type JSONFileManager struct {
// contains filtered or unexported fields
}
JSONFileManager is a symbol manager that reads a json file to get the list of symbols.
func NewJSONFileManager ¶ added in v4.1.16
func NewJSONFileManager(hc *http.Client, stocksJSONURL, stocksJSONBasicAuth string) *JSONFileManager
NewJSONFileManager initializes the SymbolManager object with the specified parameters.
func (*JSONFileManager) GetAllSymbols ¶ added in v4.1.16
func (m *JSONFileManager) GetAllSymbols() []string
GetAllSymbols returns symbols for all the target exchanges.
func (*JSONFileManager) UpdateSymbols ¶ added in v4.1.16
func (m *JSONFileManager) UpdateSymbols()
UpdateSymbols gets a remote json file, store the symbols in the file to the symbols map.
type Manager ¶
type Manager interface { GetAllSymbols() []string UpdateSymbols() }
Manager manages symbols in the target stock exchanges. symbol(s) can be newly registered / removed from the exchange, so target symbols should be updated periodically.
type ManagerImpl ¶
type ManagerImpl struct { APIClient APIClient // Key: exchange(e.g. "NYSE") TargetExchanges map[configs.Exchange]struct{} Symbols []string }
ManagerImpl is an implementation of the Manager.
func NewManager ¶
func NewManager(apiClient APIClient, targetExchanges []configs.Exchange) *ManagerImpl
NewManager initializes the SymbolManager object with the specified parameters.
func (*ManagerImpl) GetAllSymbols ¶
func (m *ManagerImpl) GetAllSymbols() []string
GetAllSymbols returns Symbols for all the target exchanges.
func (*ManagerImpl) UpdateSymbols ¶
func (m *ManagerImpl) UpdateSymbols()
UpdateSymbols calls the ListSymbols endpoint, convert the symbols to the Symbols and store them to the Symbols map.