Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

Commit

Permalink
fix indent for beautiful godoc
Browse files Browse the repository at this point in the history
  • Loading branch information
hexoul committed Nov 8, 2018
1 parent 58d7fea commit cdefe7b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 34 deletions.
5 changes: 1 addition & 4 deletions coinmarketcap.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package coinmarketcap

import (
"encoding/json"
"errors"
"fmt"
"net/http"
"os"
Expand All @@ -29,7 +28,7 @@ type Interface interface {
ExchangeMarketQuotesLatest(options *types.Options) (*types.ExchangeMarketQuotes, error)
}

// Client the CoinMarketCap client
// Client for CoinMarketCap API
type Client struct {
proAPIKey string
}
Expand All @@ -38,8 +37,6 @@ var (
instance *Client
once sync.Once
apiKey string
// ErrCouldNotCast could not cast error
ErrCouldNotCast = errors.New("could not cast")
)

const (
Expand Down
30 changes: 15 additions & 15 deletions cryptocurrency.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
)

// CryptoInfo returns all static metadata for one or more cryptocurrencies
// arg: id, symbol
// src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/info
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyInfo
// arg: id, symbol
// src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/info
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyInfo
func (s *Client) CryptoInfo(options *types.Options) (*types.CryptoInfoMap, error) {
url := fmt.Sprintf("%s/cryptocurrency/info?%s", baseURL, strings.Join(util.ParseOptions(options), "&"))

Expand All @@ -29,9 +29,9 @@ func (s *Client) CryptoInfo(options *types.Options) (*types.CryptoInfoMap, error
}

// CryptoMap returns a paginated list of all cryptocurrencies by CoinMarketCap ID
// arg: symbol, start, limit, listing_status
// src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/map
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyMap
// arg: symbol, start, limit, listing_status
// src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/map
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyMap
func (s *Client) CryptoMap(options *types.Options) (*types.CryptoMapList, error) {
url := fmt.Sprintf("%s/cryptocurrency/map?%s", baseURL, strings.Join(util.ParseOptions(options), "&"))

Expand All @@ -48,9 +48,9 @@ func (s *Client) CryptoMap(options *types.Options) (*types.CryptoMapList, error)
}

// CryptoListingsLatest gets a paginated list of all cryptocurrencies with latest market data.
// arg: start, limit, convert, sort, sort_dir, cryptocurrency_type
// src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyListingsLatest
// arg: start, limit, convert, sort, sort_dir, cryptocurrency_type
// src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyListingsLatest
func (s *Client) CryptoListingsLatest(options *types.Options) (*types.CryptoMarketList, error) {
url := fmt.Sprintf("%s/cryptocurrency/listings/latest?%s", baseURL, strings.Join(util.ParseOptions(options), "&"))

Expand All @@ -67,9 +67,9 @@ func (s *Client) CryptoListingsLatest(options *types.Options) (*types.CryptoMark
}

// CryptoMarketPairsLatest lists all market pairs for the specified cryptocurrency with associated stats.
// arg: id, symbol, start, limit, convert
// src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/market-pairs/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyMarketpairsLatest
// arg: id, symbol, start, limit, convert
// src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/market-pairs/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyMarketpairsLatest
func (s *Client) CryptoMarketPairsLatest(options *types.Options) (*types.MarketPairs, error) {
url := fmt.Sprintf("%s/cryptocurrency/market-pairs/latest?%s", baseURL, strings.Join(util.ParseOptions(options), "&"))

Expand All @@ -90,9 +90,9 @@ func (s *Client) CryptoMarketPairsLatest(options *types.Options) (*types.MarketP
}

// CryptoMarketQuotesLatest gets the latest market quote for 1 or more cryptocurrencies.
// arg: id, symbol, convert
// src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyQuotesLatest
// arg: id, symbol, convert
// src: https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1CryptocurrencyQuotesLatest
func (s *Client) CryptoMarketQuotesLatest(options *types.Options) (*types.CryptoMarketMap, error) {
url := fmt.Sprintf("%s/cryptocurrency/quotes/latest?%s", baseURL, strings.Join(util.ParseOptions(options), "&"))

Expand Down
30 changes: 15 additions & 15 deletions exchange.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
)

// ExchangeInfo returns all static metadata for one or more exchanges including logo and homepage URL.
// arg: id, slug
// src: https://pro-api.coinmarketcap.com/v1/exchange/info
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeInfo
// arg: id, slug
// src: https://pro-api.coinmarketcap.com/v1/exchange/info
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeInfo
func (s *Client) ExchangeInfo(options *types.Options) (*types.ExchangeInfoMap, error) {
url := fmt.Sprintf("%s/exchange/info?%s", baseURL, strings.Join(util.ParseOptions(options), "&"))

Expand All @@ -29,9 +29,9 @@ func (s *Client) ExchangeInfo(options *types.Options) (*types.ExchangeInfoMap, e
}

// ExchangeMap returns a paginated list of all cryptocurrency exchanges by CoinMarketCap ID.
// arg: slug, start, limit, listing_status
// src: https://pro-api.coinmarketcap.com/v1/exchange/map
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeMap
// arg: slug, start, limit, listing_status
// src: https://pro-api.coinmarketcap.com/v1/exchange/map
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeMap
func (s *Client) ExchangeMap(options *types.Options) (*types.ExchangeMapList, error) {
url := fmt.Sprintf("%s/exchange/map?%s", baseURL, strings.Join(util.ParseOptions(options), "&"))

Expand All @@ -48,9 +48,9 @@ func (s *Client) ExchangeMap(options *types.Options) (*types.ExchangeMapList, er
}

// ExchangeListingsLatest gets a paginated list of all cryptocurrency exchanges including the latest aggregate market data for each exchange.
// arg: start, limit, sort, sort_dir, market_type, convert
// src: https://pro-api.coinmarketcap.com/v1/exchange/listings/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeListingsLatest
// arg: start, limit, sort, sort_dir, market_type, convert
// src: https://pro-api.coinmarketcap.com/v1/exchange/listings/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeListingsLatest
func (s *Client) ExchangeListingsLatest(options *types.Options) (*types.ExchangeMarketList, error) {
url := fmt.Sprintf("%s/exchange/listings/latest?%s", baseURL, strings.Join(util.ParseOptions(options), "&"))

Expand All @@ -67,9 +67,9 @@ func (s *Client) ExchangeListingsLatest(options *types.Options) (*types.Exchange
}

// ExchangeMarketPairsLatest get a list of active market pairs for an exchange.
// arg: id, slug, start, limit, convert
// src: https://pro-api.coinmarketcap.com/v1/exchange/market-pairs/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeMarketpairsLatest
// arg: id, slug, start, limit, convert
// src: https://pro-api.coinmarketcap.com/v1/exchange/market-pairs/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeMarketpairsLatest
func (s *Client) ExchangeMarketPairsLatest(options *types.Options) (*types.MarketPairs, error) {
url := fmt.Sprintf("%s/exchange/market-pairs/latest?%s", baseURL, strings.Join(util.ParseOptions(options), "&"))

Expand All @@ -90,9 +90,9 @@ func (s *Client) ExchangeMarketPairsLatest(options *types.Options) (*types.Marke
}

// ExchangeMarketQuotesLatest gets the latest aggregate market data for 1 or more exchanges.
// arg: id, slug, convert
// src: https://pro-api.coinmarketcap.com/v1/exchange/quotes/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeQuotesLatest
// arg: id, slug, convert
// src: https://pro-api.coinmarketcap.com/v1/exchange/quotes/latest
// doc: https://pro.coinmarketcap.com/api/v1#operation/getV1ExchangeQuotesLatest
func (s *Client) ExchangeMarketQuotesLatest(options *types.Options) (*types.ExchangeMarketQuotes, error) {
url := fmt.Sprintf("%s/exchange/quotes/latest?%s", baseURL, strings.Join(util.ParseOptions(options), "&"))

Expand Down

0 comments on commit cdefe7b

Please sign in to comment.