Documentation
¶
Index ¶
- type Base
- type Client
- type Config
- type CryptocurrencyV1API
- type CryptocurrencyV2API
- type ExchangeV1API
- type FiatV1API
- type GlobalMetricsV1API
- type OptionHandler
- func WithApiKey(apiKey string) OptionHandler
- func WithBaseApi(baseApi string) OptionHandler
- func WithDebugMode(flag bool) OptionHandler
- func WithProxyUrl(proxyUrl string) OptionHandler
- func WithRequestPerMinute(m int) OptionHandler
- func WithRestyClient(client *resty.Client) OptionHandler
- func WithSandBox(flag bool) OptionHandler
- func WithTimeout(duration time.Duration) OptionHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { CryptocurrencyV1 CryptocurrencyV1API CryptocurrencyV2 CryptocurrencyV2API ExchangeV1 ExchangeV1API FiatV1 FiatV1API GlobalMetricsV1 GlobalMetricsV1API // contains filtered or unexported fields }
type Config ¶
type Config struct { BaseApi string // coinmarketcap OpenAPI Server Domain RestyClient *resty.Client ApiKey string // coinmarketcap ApiKey IsDebug bool // debug mode IsSandBox bool Timeout time.Duration // resty client request timeout ProxyUrl string // 国内访问不了设置下代理 RequestPerMinute int }
Config coinmarketcap client configuration
type CryptocurrencyV1API ¶
type CryptocurrencyV1API interface {
GetMap(ctx context.Context, req *types.GetCryptocurrencyMapReq) (*types.GetCryptocurrencyMapResp, error)
}
币种接口
type CryptocurrencyV2API ¶
type CryptocurrencyV2API interface { GetInfo(ctx context.Context, req *types.GetCryptocurrencyInfoReq) (*types.GetCryptocurrencyInfoResp, error) GetQuotesLatest(ctx context.Context, req *types.GetCryptocurrencyQuotesReq) (*types.GetCryptocurrencyQuoteResp, error) GetPricePerformanceStatsLatest(ctx context.Context, req *types.GetCryptocurrencyPricePerformanceStatsReq) (*types.GetCryptocurrencyPricePerformanceStatsResp, error) GetMarketPairLatest(ctx context.Context, req *types.GetCryptocurrencyMarketPairReq) (*types.GetCryptocurrencyMarketPairResp, error) }
币种接口
type ExchangeV1API ¶
type ExchangeV1API interface { GetMap(ctx context.Context, req *types.GetExchangeMapReq) (*types.GetExchangeMapResp, error) GetInfo(ctx context.Context, req *types.GetExchangeInfoReq) (*types.GetExchangeInfoResp, error) GetQuotesLatest(ctx context.Context, req *types.GetExchangeQuotesReq) (*types.GetExchangeQuotesResp, error) GetMarketPairLatest(ctx context.Context, req *types.GetExchangeMarketPairReq) (*types.GetExchangeMarketPairResp, error) }
交易所接口
type FiatV1API ¶
type FiatV1API interface {
GetMap(ctx context.Context, req *types.GetFiatMapReq) (*types.GetFiatResp, error)
}
type GlobalMetricsV1API ¶
type GlobalMetricsV1API interface {
GetQuotesLatest(ctx context.Context, req *types.GetGlobalMetricsQuotesReq) (*types.GetGlobalMetricsQuotesResp, error)
}
type OptionHandler ¶
func WithApiKey ¶
func WithApiKey(apiKey string) OptionHandler
WithApiKey Customize DoDoBot Api base host
func WithBaseApi ¶
func WithBaseApi(baseApi string) OptionHandler
WithBaseApi Customize DoDoBot Api base host
func WithProxyUrl ¶
func WithProxyUrl(proxyUrl string) OptionHandler
func WithRequestPerMinute ¶
func WithRequestPerMinute(m int) OptionHandler
WithDebugMode Toggle debug mode
func WithRestyClient ¶
func WithRestyClient(client *resty.Client) OptionHandler
func WithTimeout ¶
func WithTimeout(duration time.Duration) OptionHandler
WithTimeout Customize RestyClient request timeout
Click to show internal directories.
Click to hide internal directories.