Documentation

Index

Constants

This section is empty.

Variables

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

    ErrNotFound is the error when the target is not found

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

      ErrPingFailed is the error for when pinging the API fails

      Functions

      This section is empty.

      Types

      type Service

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

        Service service

        func NewCoinGecko

        func NewCoinGecko() *Service

          NewCoinGecko 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, name string, start, 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