coingecko

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

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 added in v1.5.2

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

GetCoinData gets all data of a coin.

func (*Service) GetCoinDataBatch added in v1.5.2

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

Jump to

Keyboard shortcuts

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