-
Notifications
You must be signed in to change notification settings - Fork 0
/
stock.go
70 lines (61 loc) · 2.98 KB
/
stock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package domains
type AutoCompleteResponse struct {
Quotes []QuotesResponse `json:"quotes"`
}
type QuotesResponse struct {
Longname string `json:"longname"`
Symbol string `json:"symbol"`
Sector string `json:"sector"`
}
type Stock struct {
Price StockPrice `json:"price,omitempty"`
SummaryDetail StockSummaryDetail `json:"summaryDetail,omitempty"`
Symbol string `json:"symbol,omitempty"`
}
type StockPrice struct {
MarketOpen PriceMarketTmp `json:"regularMarketOpen,omitempty"`
MarketVariation PriceMarketTmp `json:"regularMarketChange,omitempty"`
MarketPreviousClose PriceMarketTmp `json:"regularMarketPreviousClose,omitempty"`
MarketLow PriceMarketTmp `json:"regularMarketDayLow,omitempty"`
MarketHigh PriceMarketTmp `json:"regularMarketDayHigh,omitempty"`
MarketPrice PriceMarketTmp `json:"regularMarketPrice,omitempty"`
MarketVariationPercentage PriceMarketTmp `json:"regularMarketChangePercent,omitempty"`
Symbol string `json:"symbol,omitempty"`
LongName string `json:"longName,omitempty"`
ShortName string `json:"shortName,omitempty"`
Currency string `json:"currency,omitempty"`
}
type StockSummaryDetail struct {
MarketPreviousClose PriceMarketTmp `json:"previousClose,omitempty"`
MarketOpen PriceMarketTmp `json:"open,omitempty"`
TwoHundredDayAverage PriceMarketTmp `json:"twoHundredDayAverage,omitempty"`
AnnualDY PriceMarketTmp `json:"trailingAnnualDividendYield,omitempty"`
PayoutRatio PriceMarketTmp `json:"payoutRatio,omitempty"`
MarketHigh PriceMarketTmp `json:"dayHigh,omitempty"`
FiftyDayAverage PriceMarketTmp `json:"fiftyDayAverage,omitempty"`
MarketLow PriceMarketTmp `json:"dayLow,omitempty"`
}
type MarketQuotesResponse struct {
QuoteResponse MarketQuotes `json:"quoteResponse"`
}
type MarketQuotes struct {
Result []MarketResult `json:"result"`
}
type MarketResult struct {
MarketPrice float64 `json:"regularMarketPrice,omitempty"`
MarketHigh float64 `json:"regularMarketDayHigh,omitempty"`
MarketDayRange string `json:"regularMarketDayRange,omitempty"`
MarketLow float64 `json:"regularMarketDayLow,omitempty"`
MarketPreviousClose float64 `json:"regularMarketPreviousClose,omitempty"`
MarketVariation float64 `json:"regularMarketChange,omitempty"`
MarketVariationPercentage float64 `json:"regularMarketChangePercent,omitempty"`
MarketOpen float64 `json:"regularMarketOpen,omitempty"`
Symbol string `json:"symbol,omitempty"`
LongName string `json:"longName,omitempty"`
ShortName string `json:"shortName,omitempty"`
Currency string `json:"currency,omitempty"`
}
type PriceMarketTmp struct {
Raw float64 `json:"raw"`
Fmt string `json:"fmt"`
}