-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetExchangeCodes is missing from the library #286
Comments
@gcatlin I am happy to take this one over if that is ok :) |
Absolutely. Thanks @brendisurfs! |
Rad! Just to confirm, any new structs/types would go in entities.go, correct? And there could be a solid middle ground between the two ideas too, perhaps a map[ExchangeCode]ExchangeName? Where both the keys and values are typed (using structs as enum-like). That way, you still get the concept of having Name and Code fields, while still being flexible as a map for various use cases. |
That's right.
I'm not sure what you mean by "using structs as enum-like". Were you thinking of something like this? type ExchangeCode string
type ExchangeName string
func (c *Client) GetExchangeCodes() (map[ExchangeCode]ExchangeName, error) { ... } If so, that's equivalent to what I was suggesting for |
Yup, seems like we are on the same page! |
https://docs.alpaca.markets/reference/stockmetaexchanges-1
Need to add a new
marketdata.Client
method.Two potential approaches:
GetExchanges
and return[]Exchange
(requires a newExchange
entity with e.g.Code
andName
fields)GetExchangeCodes
and returnmap[string]string
(with the code as the key and the name as the value)I prefer
GetExchanges
butGetExchangeCodes
might fit better with the library.@gnvk what do you prefer?
Example API response body:
The text was updated successfully, but these errors were encountered: