Documentation
¶
Index ¶
Constants ¶
View Source
const ( TWSE_url = "https://isin.twse.com.tw/isin/C_public.jsp?strMode=2" TPEx_url = "https://isin.twse.com.tw/isin/C_public.jsp?strMode=4" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Alphavantage ¶
type Alphavantage struct {
Service *alphavantage.Service
// contains filtered or unexported fields
}
Alphavantage stocker
func NewAlphavantage ¶
func NewAlphavantage(apikey string) (*Alphavantage, error)
NewAlphavantage 建立 alphavantage Service
func (*Alphavantage) PriceAdjHistory ¶
PriceAdjHistory 得到股票歷史 Adj 價格
func (*Alphavantage) PriceHistory ¶
PriceHistory 得到股票歷史價格
type DatePrice ¶
type DatePrice struct {
Date Time `json:"Date"`
Open float64 `json:"Open"`
High float64 `json:"High"`
Low float64 `json:"Low"`
Close float64 `json:"Close"`
CloseAdj float64 `json:"CloseAdj"`
Volume float64 `json:"Volume"`
}
DatePrice price with date
type ErrorFatal ¶
type ErrorFatal struct {
Message string
}
ErrorFatal fatal error
func (ErrorFatal) Error ¶
func (e ErrorFatal) Error() string
type ErrorNoFound ¶
type ErrorNoFound struct {
Message string
}
ErrorNoFound no found
func (ErrorNoFound) Error ¶
func (e ErrorNoFound) Error() string
type ErrorNoSupport ¶
type ErrorNoSupport struct {
Message string
}
ErrorNoSupport no support
func (ErrorNoSupport) Error ¶
func (e ErrorNoSupport) Error() string
type Stocker ¶
type Stocker interface {
// 得到股票價格
Quote(ctx context.Context, symbol string) (float64, error)
// 得到股票歷史價格
PriceHistory(ctx context.Context, symbol string) ([]*DatePrice, error)
// 得到股票歷史 Adj 價格
PriceAdjHistory(ctx context.Context, symbol string) ([]*DatePrice, error)
}
Stocker get stock infomation
type TDAmeritrade ¶
TDAmeritrade stocker
func NewTDAmeritrade ¶
func NewTDAmeritrade(clientsecretPath, tokenFile string) (*TDAmeritrade, error)
NewTDAmeritrade 建立 gotd Service
func NewTDAmeritradeTLS ¶
func NewTDAmeritradeTLS(clientsecretPath, tokenFile, TLSCertPath, TLSKeyPath string) (*TDAmeritrade, error)
NewTDAmeritradeTLS 建立 gotd Service
func (*TDAmeritrade) PriceAdjHistory ¶
PriceAdjHistory 得到股票歷史 Adj 價格
func (*TDAmeritrade) PriceHistory ¶
PriceHistory 得到股票歷史價格
type TWSE ¶
TWSE stocker
func (*TWSE) PriceAdjHistory ¶
PriceAdjHistory 得到股票歷史 Adj 價格
func (*TWSE) PriceHistory ¶
PriceHistory 得到股票歷史價格
type Time ¶
Time redefine time.Time for JSON
func (Time) MarshalJSON ¶
MarshalJSON 輸出 json string 格式,兩邊加上雙引號
func (*Time) UnmarshalJSON ¶
UnmarshalJSON 輸入 json string 格式,兩邊有雙引號
type YahooFinance ¶
YahooFinance stocker
func NewYahooFinance ¶
func NewYahooFinance() (*YahooFinance, error)
NewYahooFinance 建立 yahoofinance Service
func (*YahooFinance) PriceAdjHistory ¶
PriceAdjHistory 得到股票歷史 Adj 價格
func (*YahooFinance) PriceHistory ¶
PriceHistory 得到股票歷史價格
Click to show internal directories.
Click to hide internal directories.