Documentation ¶
Index ¶
- Variables
- func CCGetAll(proxy string, timeout time.Duration) ([]fintypes2.Asset, error)
- func CCGetKline(symbol string, since *time.Time, proxy string) (*fintypes2.CandleSticks, error)
- func Convert(r *ecbrates.Rates, value float64, from, to ecbrates.Currency) (float64, error)
- func NewTestKlineMaotai() (*fintypes.CandleSticks, error)
- func StockExchangeList(exchange fintypes.Platform) ([]fintypes.PairP, error)
- func StockListAll() (stocks []fintypes.PairP, indexes []fintypes.PairP, err error)
- type APIEnvelope
- type APIError
- type APIMessage
- type AssetDataSource
- type AssetDetail
- func (c *AssetDetail) AppendSocialMedia(newurls ...string)
- func (c *AssetDetail) GetSocialMediaContains(contain string) []string
- func (c *AssetDetail) Github() string
- func (c *AssetDetail) String() string
- func (c *AssetDetail) TechDoc() string
- func (c *AssetDetail) Update(newinfo AssetDetail)
- func (c *AssetDetail) Website() string
- type CC
- type CgkClient
- type CmcClient
- type Ecb
- type GoldMonthlyPrice
- type Ico
- type StockDetail
- type YFAPI
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Supply TagDynamicSupply = "DynamicSupply" // Stable Coin TagFiatAnchored = "FiatAnchored" // Main net TagNative = "native" TagERC20 = "erc20" // Ethereum ERC20 token TagWRC20 = "wrc20" // WanChain WRC20 token TagDapp = "dapp" // Industry TagCrossChain = "CrossChain" TagPublicChain = "PublicChain" TagSideChain = "SideChain" TagCloudCompute = "CloudCompute" TagOS = "OS" TagIoT = "IoT" TagIM = "IM" TagBigData = "BigData" TagAI = "AI" TagCopyright = "Copyright" TagStorage = "Storage" TagAnonymous = "Anonymous" TagContent = "Content" TagExchange = "Exchange" TagGame = "Game" TagSmartContract = "SmartContract" TagNotary = "Notary" // 公证防伪 ErrNotIncludedYet = gerrors.New("Not included yet") ErrTryAgainLater = gerrors.New("Try again later, wait network download done") ErrNameNotFound = gerrors.New("UniqueName not found") // 由于平台上某些币的登记名字差别、有没有登记的差别,导致找不到对应页面 ErrDDosProtection = gerrors.New("DDos Protection") // http access too frequently ErrNoHistoryData = gerrors.New("No history data") // 在CMC上某些币有概况,但是历史数据没有登记,比如fcoin-token ErrNoIcoInfo = gerrors.New("No ICO info") // feixiaohao上有些币的ICO信息未收录 )
View Source
var BTC_USDT_1min_spot_binance = `` /* 1173076-byte string literal not displayed */
View Source
var (
DowJonesOpenDate, _ = gtime.NewDate(1896, 5, 26)
)
View Source
var MaoTaiKline = `` /* 30737-byte string literal not displayed */
this data is from tushare python library
Functions ¶
func CCGetKline ¶
func NewTestKlineMaotai ¶
func NewTestKlineMaotai() (*fintypes.CandleSticks, error)
Types ¶
type APIEnvelope ¶
type APIEnvelope map[string]APIMessage
APIEnvelope is the wrapping envelope around a Yahoo Finance API response
type APIError ¶
type APIError struct { Code string `json:"code"` // "argument-error" Description string `json:"description"` // "Missing value for the \"symbols\" argument" }
APIError represents an error response
type APIMessage ¶
type APIMessage struct {
Error *APIError `json:"error,omitempty"`
}
APIMessage represents a standard API response
type AssetDataSource ¶
type AssetDataSource interface {
GetDetails() ([]AssetDetail, error)
}
func NewAssetDataSource ¶
func NewAssetDataSource(platform fintypes.Platform, apiKey, proxy string) (AssetDataSource, error)
type AssetDetail ¶
type AssetDetail struct { Asset fintypes.Asset `json:"Asset" bson:"_id"` MaxSupply float64 `json:"MaxSupply,omitempty" bson:"MaxSupply,omitempty"` TotalSupply float64 `json:"TotalSupply,omitempty" bson:"TotalSupply,omitempty"` CirculatingSupply float64 `json:"CirculatingSupply,omitempty" bson:"CirculatingSupply,omitempty"` ContractAddress string `json:"ContractAddress,omitempty" bson:"ContractAddress,omitempty"` // not useful for now Tags []string `json:"Tags,omitempty" bson:"Tags,omitempty"` ListedExchanges map[string][]string `json:"ListedExchanges,omitempty" bson:"ListedExchanges,omitempty"` // links Logo string `json:"Logo,omitempty" bson:"Logo,omitempty"` Websites []string `json:"Websites,omitempty" bson:"Websites,omitempty"` Explorers []string `json:"Explorers,omitempty" bson:"Explorers,omitempty"` TechDocs []string `json:"TechDocs,omitempty" bson:"TechDocs,omitempty"` SocialMedia []string `json:"SocialMedia,omitempty" bson:"SocialMedia,omitempty"` Exchanges []string `json:"Exchanges,omitempty" bson:"Exchanges,omitempty"` }
func (*AssetDetail) AppendSocialMedia ¶
func (c *AssetDetail) AppendSocialMedia(newurls ...string)
func (*AssetDetail) GetSocialMediaContains ¶
func (c *AssetDetail) GetSocialMediaContains(contain string) []string
func (*AssetDetail) Github ¶
func (c *AssetDetail) Github() string
func (*AssetDetail) String ¶
func (c *AssetDetail) String() string
func (*AssetDetail) TechDoc ¶
func (c *AssetDetail) TechDoc() string
func (*AssetDetail) Update ¶
func (c *AssetDetail) Update(newinfo AssetDetail)
func (*AssetDetail) Website ¶
func (c *AssetDetail) Website() string
type CC ¶
type CC struct {
// contains filtered or unexported fields
}
func NewCryptoCompare ¶
func (*CC) GetKlineEx ¶
func (*CC) GetKlineProviderInfo ¶
func (cc *CC) GetKlineProviderInfo() (*fintypes2.KlineProviderInfo, error)
type CgkClient ¶
type CgkClient struct {
// contains filtered or unexported fields
}
type CmcClient ¶
type CmcClient struct {
// contains filtered or unexported fields
}
func (*CmcClient) GetDetails ¶
func (c *CmcClient) GetDetails() ([]AssetDetail, error)
type GoldMonthlyPrice ¶
func GetGoldKline ¶
func GetGoldKline() ([]GoldMonthlyPrice, *fintypes.CandleSticks, error)
type StockDetail ¶
type YFAPI ¶
type YFAPI struct {
// contains filtered or unexported fields
}
APIError represents an error response
func NewYahooFinance ¶
func (*YFAPI) GetKlineEx ¶
func (yf *YFAPI) GetKlineEx(platform fintypes2.Platform, market fintypes2.Market, target fintypes2.Pair, period fintypes2.Period, since *time.Time) (*fintypes2.CandleSticks, error)
index Pair samples: DJI/USD@open, SHH/CNY@open
func (*YFAPI) GetKlineProviderInfo ¶
func (yf *YFAPI) GetKlineProviderInfo() (*fintypes2.KlineProviderInfo, error)
Click to show internal directories.
Click to hide internal directories.