Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFetchGraphData = errors.New("graph data fetch error")

    ErrFetchGraphData is the error for when fetching graph data fails

    View Source
    var ErrPingFailed = errors.New("failed to ping")

      ErrPingFailed is the error for when pinging the API fails

      View Source
      var ErrQuoteNotFound = errors.New("quote not found")

        ErrQuoteNotFound is the error for when a quote is not found

        Functions

        This section is empty.

        Types

        type Service

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

          Service service

          func NewCMC

          func NewCMC(apiKey string) *Service

            NewCMC new service

            func (s *Service) CoinLink(name string) string

              CoinLink returns the URL link for the coin

              func (*Service) GetAllCoinData

              func (s *Service) GetAllCoinData(convert string, ch chan []apitypes.Coin) error

                GetAllCoinData gets all coin data. Need to paginate through all pages

                func (*Service) GetCoinData

                func (s *Service) GetCoinData(name string, convert string) (apitypes.Coin, error)

                  GetCoinData gets all data of a coin.

                  func (*Service) GetCoinDataBatch

                  func (s *Service) GetCoinDataBatch(names []string, convert string) ([]apitypes.Coin, error)

                    GetCoinDataBatch gets all data of specified coins.

                    func (*Service) GetCoinGraphData

                    func (s *Service) GetCoinGraphData(convert, symbol string, name string, start int64, end int64) (apitypes.CoinGraph, error)

                      GetCoinGraphData gets coin graph data

                      func (*Service) GetGlobalMarketData

                      func (s *Service) GetGlobalMarketData(convert string) (apitypes.GlobalMarketData, error)

                        GetGlobalMarketData gets global market data

                        func (*Service) GetGlobalMarketGraphData

                        func (s *Service) GetGlobalMarketGraphData(convert string, start int64, end int64) (apitypes.MarketGraph, error)

                          GetGlobalMarketGraphData gets global market graph data

                          func (*Service) Ping

                          func (s *Service) Ping() error

                            Ping ping API

                            func (*Service) Price

                            func (s *Service) Price(name string, convert string) (float64, error)

                              Price returns the current price of the coin

                              func (*Service) SupportedCurrencies

                              func (s *Service) SupportedCurrencies() []string

                                SupportedCurrencies returns a list of supported currencies

                                Source Files