coinmarketcap

package
v0.0.0-...-9901557 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	// contains filtered or unexported fields
}

func NewApi

func NewApi(settings *config.Config) (*Api, error)

func (*Api) KeyCheck

func (a *Api) KeyCheck() error

func (*Api) Listings

func (a *Api) Listings() ([]CryptoItemStatistic, error)

func (*Api) Map

func (a *Api) Map() ([]CryptoItem, error)

func (*Api) OHLCV

func (a *Api) OHLCV() error

type CryptoItem

type CryptoItem struct {
	Id       int32  `json:"id"`
	Name     string `json:"name"`
	Symbol   string `json:"symbol"`
	IsActive int    `json:"is_active"`
}

type CryptoItemStatistic

type CryptoItemStatistic struct {
	Id                int32                `json:"id"`
	Symbol            string               `json:"symbol"`
	CmcRank           int                  `json:"cmc_rank"`
	MaxSupply         float32              `json:"max_supply"`
	CirculatingSupply float32              `json:"circulating_supply"`
	TotalSupply       float32              `json:"total_supply"`
	Quote             map[string]QuoteInfo `json:"quote"`
}

type ListingsResponse

type ListingsResponse struct {
	Data   []CryptoItemStatistic `json:"data"`
	Status Status                `json:"status"`
}

type MapResponse

type MapResponse struct {
	Data   []CryptoItem `json:"data"`
	Status Status       `json:"status"`
}

type QuoteInfo

type QuoteInfo struct {
	Price       float64 `json:"price"`
	Volume24h   float64 `json:"volume_24h"`
	MarketCap   float64 `json:"market_cap"`
	LastUpdated string  `json:"last_updated"`
}

type Response

type Response struct {
	Data   interface{} `json:"data"`
	Status Status      `json:"status"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(zLog *zap.Logger, settings *config.Config, rService *redis.Service) (*Service, error)

func (*Service) CacheCryptoMap

func (s *Service) CacheCryptoMap() error

func (*Service) GetCryptoList

func (s *Service) GetCryptoList() []CryptoItem

func (*Service) ProceedCryptoListings

func (s *Service) ProceedCryptoListings()

type Status

type Status struct {
	Timestamp    string `json:"timestamp"`
	ErrorCode    int    `json:"error_code"`
	ErrorMessage string `json:"error_message"`
	Elapsed      int32  `json:"elapsed"`
	CreditCount  int32  `json:"credit_count"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL