Documentation ¶
Index ¶
- Constants
- type BinanceTicker
- type Cache
- type Collector
- type CollectorImpl
- type Exchange
- type ExchangeImpl
- type ExchangeType
- type GlobalMarket
- func (g *GlobalMarket) GetGlobalMarketTicker(symbol string) (trend []GlobalMarketTicker, err error)
- func (g *GlobalMarket) GetGlobalMarketTickerCache(token string) (tickers map[string][]GlobalMarketTicker, err error)
- func (g *GlobalMarket) GetGlobalTicker(token string) (ticker GlobalTicker, err error)
- func (g *GlobalMarket) GetGlobalTickerCache(token string) (tickers map[string]GlobalTicker, err error)
- func (g *GlobalMarket) GetGlobalTrend(token string) (trend []GlobalTrend, err error)
- func (g *GlobalMarket) GetGlobalTrendCache(token string) (trends map[string][]GlobalTrend, err error)
- func (g *GlobalMarket) Sign(param interface{}) (urlParam string, err error)
- func (g *GlobalMarket) Start()
- type GlobalMarketTicker
- type GlobalMarketTickerReq
- type GlobalMarketTickerResp
- type GlobalTicker
- type GlobalTickerReq
- type GlobalTickerResp
- type GlobalTrend
- type GlobalTrendReq
- type GlobalTrendResp
- type HuobiInnerTicker
- type HuobiTicker
- type MyTokenConfig
- type MyTokenResp
- type OkexFullTicker
- type OkexInnerTicker
- type OkexTicker
- type OkexTickerElem
- type Ticker
- func GetAllTickerFromBinance() (tickers []Ticker, err error)
- func GetAllTickerFromOkex() (tickers []Ticker, err error)
- func GetTickerFromBinance(market string) (ticker Ticker, err error)
- func GetTickerFromHuobi(market string) (ticker Ticker, err error)
- func GetTickerFromOkex(market string) (ticker Ticker, err error)
- type TickerField
- type Trend
- type TrendManager
- func (t *TrendManager) GetTicker() (tickers []Ticker, err error)
- func (t *TrendManager) GetTickerByMarket(mkt string) (ticker Ticker, err error)
- func (t *TrendManager) GetTrends(market, interval string) (trends []Trend, err error)
- func (t *TrendManager) HandleOrderFilled(input eventemitter.EventData) (err error)
- func (t *TrendManager) LoadCache()
- func (t *TrendManager) ProofRead()
- func (t *TrendManager) ScheduleUpdate()
- type TrendUpdateMsg
Constants ¶
View Source
const ( OneHour = "1Hr" TwoHour = "2Hr" FourHour = "4Hr" OneDay = "1Day" OneWeek = "1Week" )
View Source
const GMCLock = "globalMarketZkLock"
View Source
const GlobalMarketTickerKey = "GMTKPK"
View Source
const GlobalTickerKey = "GTKPK"
View Source
const GlobalTrendKey = "GTDPK"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinanceTicker ¶
type BinanceTicker struct { Symbol string `json:"symbol"` Change string `json:"priceChangePercent"` Close string `json:"prevClosePrice"` Open string `json:"openPrice"` High string `json:"highPrice"` Low string `json:"lowPrice"` LastPrice string `json:"lastPrice"` Amount string `json:"volume"` Vol string `json:"quoteVolume"` Ask string `json:"askPrice"` Bid string `json:"bidPrice"` }
type CollectorImpl ¶
type CollectorImpl struct {
// contains filtered or unexported fields
}
func NewCollector ¶
func NewCollector() *CollectorImpl
func (*CollectorImpl) GetTickers ¶
func (c *CollectorImpl) GetTickers(market string) ([]Ticker, error)
func (*CollectorImpl) Start ¶
func (c *CollectorImpl) Start()
type ExchangeImpl ¶
type ExchangeImpl struct {
// contains filtered or unexported fields
}
func NewExchange ¶
func NewExchange(name, tickerUrl string) ExchangeImpl
type ExchangeType ¶
type ExchangeType string
type GlobalMarket ¶
type GlobalMarket struct {
// contains filtered or unexported fields
}
var GM *GlobalMarket
func NewGlobalMarket ¶
func NewGlobalMarket(config MyTokenConfig) GlobalMarket
func (*GlobalMarket) GetGlobalMarketTicker ¶
func (g *GlobalMarket) GetGlobalMarketTicker(symbol string) (trend []GlobalMarketTicker, err error)
func (*GlobalMarket) GetGlobalMarketTickerCache ¶
func (g *GlobalMarket) GetGlobalMarketTickerCache(token string) (tickers map[string][]GlobalMarketTicker, err error)
func (*GlobalMarket) GetGlobalTicker ¶
func (g *GlobalMarket) GetGlobalTicker(token string) (ticker GlobalTicker, err error)
func (*GlobalMarket) GetGlobalTickerCache ¶
func (g *GlobalMarket) GetGlobalTickerCache(token string) (tickers map[string]GlobalTicker, err error)
func (*GlobalMarket) GetGlobalTrend ¶
func (g *GlobalMarket) GetGlobalTrend(token string) (trend []GlobalTrend, err error)
func (*GlobalMarket) GetGlobalTrendCache ¶
func (g *GlobalMarket) GetGlobalTrendCache(token string) (trends map[string][]GlobalTrend, err error)
func (*GlobalMarket) Sign ¶
func (g *GlobalMarket) Sign(param interface{}) (urlParam string, err error)
func (*GlobalMarket) Start ¶
func (g *GlobalMarket) Start()
type GlobalMarketTicker ¶
type GlobalMarketTicker struct { MarketName string `json:"market_name"` Symbol string `json:"symbol"` Anchor string `json:"anchor"` Pair string `json:"pair"` Price string `json:"price"` PriceUsd string `json:"price_usd"` PriceCny string `json:"price_cny"` Volume24hUsd string `json:"volume_24h_usd"` Volume24h string `json:"volume_24h"` Volume24hFrom string `json:"volume_24h_from"` PercentChangeUtc0 string `json:"percent_change_utc0"` Alias string `json:"alias"` }
type GlobalMarketTickerReq ¶
type GlobalMarketTickerResp ¶
type GlobalMarketTickerResp struct { MyTokenResp Data map[string][]GlobalMarketTicker `json:"data"` }
type GlobalTicker ¶
type GlobalTicker struct { Symbol string `json:"symbol"` Price string `json:"price"` PriceUsd string `json:"price_usd"` PriceCnyUtc0 string `json:"price_cny_utc0"` PriceCny string `json:"price_cny"` Volume24hUsd string `json:"volume_24h_usd"` Volume24h string `json:"volume_24h"` Volume24hFrom string `json:"volume_24h_from"` PercentChangeUtc0 string `json:"percent_change_utc0"` Alias string `json:"alias"` PriceUpdatedAt string `json:"price_updated_at"` }
type GlobalTickerReq ¶
type GlobalTickerReq struct {
NameId string `json:"name_id"`
}
type GlobalTickerResp ¶
type GlobalTickerResp struct { MyTokenResp Data GlobalTicker `json:"data"` }
type GlobalTrend ¶
type GlobalTrendReq ¶
type GlobalTrendResp ¶
type GlobalTrendResp struct { MyTokenResp Data map[string][]GlobalTrend `json:"data"` }
type HuobiInnerTicker ¶
type HuobiTicker ¶
type HuobiTicker struct { Timestamp int64 `json:"ts"` ErrorCode string `json:"err-code"` Status string `json:"status"` Tick HuobiInnerTicker `json:"tick"` }
type MyTokenConfig ¶
type MyTokenResp ¶
type OkexFullTicker ¶
type OkexFullTicker struct { Code int `json:"code"` Data []OkexTickerElem `json:"data"` Msg string `json:"msg"` }
type OkexInnerTicker ¶
type OkexTicker ¶
type OkexTicker struct { Date string `json:"date"` Ticker OkexInnerTicker `json:"ticker"` }
type OkexTickerElem ¶
type Ticker ¶
type Ticker struct { Market string `json:"market"` Exchange string `json:"exchange"` Intervals string `json:"interval"` Amount float64 `json:"amount"` Vol float64 `json:"vol"` Open float64 `json:"open"` Close float64 `json:"close"` High float64 `json:"high"` Low float64 `json:"low"` Last float64 `json:"last"` Buy float64 `json:"buy"` Sell float64 `json:"sell"` Change string `json:"change"` }
func GetAllTickerFromBinance ¶
func GetAllTickerFromOkex ¶
func GetTickerFromBinance ¶
func GetTickerFromHuobi ¶
func GetTickerFromOkex ¶
type TickerField ¶
type TickerField struct {
// contains filtered or unexported fields
}
type Trend ¶
type Trend struct { Intervals string `json:"intervals"` Market string `json:"market"` Vol float64 `json:"vol"` Amount float64 `json:"amount"` CreateTime int64 `json:"createTime"` Open float64 `json:"open"` Close float64 `json:"close"` High float64 `json:"high"` Low float64 `json:"low"` Start int64 `json:"start"` End int64 `json:"end"` }
type TrendManager ¶
type TrendManager struct {
// contains filtered or unexported fields
}
func NewTrendManager ¶
func NewTrendManager(dao *dao.RdsService) TrendManager
func (*TrendManager) GetTicker ¶
func (t *TrendManager) GetTicker() (tickers []Ticker, err error)
func (*TrendManager) GetTickerByMarket ¶
func (t *TrendManager) GetTickerByMarket(mkt string) (ticker Ticker, err error)
func (*TrendManager) GetTrends ¶
func (t *TrendManager) GetTrends(market, interval string) (trends []Trend, err error)
func (*TrendManager) HandleOrderFilled ¶
func (t *TrendManager) HandleOrderFilled(input eventemitter.EventData) (err error)
func (*TrendManager) LoadCache ¶
func (t *TrendManager) LoadCache()
func (*TrendManager) ProofRead ¶
func (t *TrendManager) ProofRead()
func (*TrendManager) ScheduleUpdate ¶
func (t *TrendManager) ScheduleUpdate()
type TrendUpdateMsg ¶
Click to show internal directories.
Click to hide internal directories.