Skip to content

Commit

Permalink
update: go path to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianToledano committed Dec 30, 2024
1 parent 387a332 commit 2c363df
Show file tree
Hide file tree
Showing 39 changed files with 53 additions and 49 deletions.
2 changes: 1 addition & 1 deletion assetPlatforms.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"net/url"

"github.com/JulianToledano/goingecko/assetPlatforms"
"github.com/JulianToledano/goingecko/v2/assetPlatforms"
)

func (c *Client) AssetPlatforms(ctx context.Context, filter string) (*assetPlatforms.AssetPlatforms, error) {
Expand Down
2 changes: 1 addition & 1 deletion categories.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"net/url"

"github.com/JulianToledano/goingecko/categories"
"github.com/JulianToledano/goingecko/v2/categories"
)

// CategoriesList List all categories
Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"io"
"net/http"

"github.com/JulianToledano/goingecko/ping"
"github.com/JulianToledano/goingecko/v2/ping"
)

const apiHeader = "x-cg-demo-api-key"
Expand Down
4 changes: 2 additions & 2 deletions coins.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"strconv"
"strings"

"github.com/JulianToledano/goingecko/coins"
"github.com/JulianToledano/goingecko/types"
"github.com/JulianToledano/goingecko/v2/coins"
"github.com/JulianToledano/goingecko/v2/types"
)

func (c *Client) CoinsList(ctx context.Context) ([]*coins.CoinInfo, error) {
Expand Down
2 changes: 1 addition & 1 deletion coins/history.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package coins

import "github.com/JulianToledano/goingecko/types"
import "github.com/JulianToledano/goingecko/v2/types"

type History struct {
ID string `json:"id"`
Expand Down
2 changes: 1 addition & 1 deletion coins/id.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package coins

import "github.com/JulianToledano/goingecko/types"
import "github.com/JulianToledano/goingecko/v2/types"

type CoinID struct {
ID string `json:"id"`
Expand Down
2 changes: 1 addition & 1 deletion coins/markets.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package coins

import "github.com/JulianToledano/goingecko/types"
import "github.com/JulianToledano/goingecko/v2/types"

type Market struct {
ID string `json:"ID"`
Expand Down
2 changes: 1 addition & 1 deletion coins/statusUpdates.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package coins

import "github.com/JulianToledano/goingecko/types"
import "github.com/JulianToledano/goingecko/v2/types"

type StatusUpdates struct {
StatusUpdates []Status `json:"status_updates"`
Expand Down
2 changes: 1 addition & 1 deletion coins/tickers.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package coins

import "github.com/JulianToledano/goingecko/types"
import "github.com/JulianToledano/goingecko/v2/types"

type Tickers struct {
Name string `json:"name"`
Expand Down
2 changes: 1 addition & 1 deletion companies.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"

"github.com/JulianToledano/goingecko/companies"
"github.com/JulianToledano/goingecko/v2/companies"
)

func (c *Client) PublicTreasuryCoinId(ctx context.Context, id string) (*companies.Treasury, error) {
Expand Down
4 changes: 2 additions & 2 deletions contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"fmt"
"net/url"

"github.com/JulianToledano/goingecko/contract"
"github.com/JulianToledano/goingecko/types"
"github.com/JulianToledano/goingecko/v2/contract"
"github.com/JulianToledano/goingecko/v2/types"
)

func (c *Client) ContractInfo(ctx context.Context, id, contractAddress string) (*contract.ContractAddressInfo, error) {
Expand Down
2 changes: 1 addition & 1 deletion contract/contractAddress.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package contract

import "github.com/JulianToledano/goingecko/types"
import "github.com/JulianToledano/goingecko/v2/types"

// TODO: missing a lot of info
type ContractAddressInfo struct {
Expand Down
2 changes: 1 addition & 1 deletion derivatives.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"net/url"

"github.com/JulianToledano/goingecko/derivatives"
"github.com/JulianToledano/goingecko/v2/derivatives"
)

// Derivatives List all derivative tickers.
Expand Down
5 changes: 3 additions & 2 deletions examples/bitcoinPrice.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package main

import (
"context"
"fmt"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func main() {
cgClient := goingecko.NewClient(nil, "")
defer cgClient.Close()

data, err := cgClient.CoinsId("bitcoin", true, true, true, false, false, false)
data, err := cgClient.CoinsId(context.Background(), "bitcoin", true, true, true, false, false, false)
if err != nil {
fmt.Print("Somethig went wrong...")
return
Expand Down
5 changes: 3 additions & 2 deletions examples/checkTrending.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
"context"
"fmt"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func main() {
Expand All @@ -16,7 +17,7 @@ func main() {
return
}
for _, coin := range treding.Coins {
coinData, err := cgClient.CoinsId(coin.Item.ID, false, false, true, false, false, false)
coinData, err := cgClient.CoinsId(context.Background(), coin.Item.ID, false, false, true, false, false, false)
if err != nil {
fmt.Printf("Error: %v", err)
}
Expand Down
5 changes: 3 additions & 2 deletions examples/pro.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package main

import (
"context"
"fmt"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func main() {
cgClient := goingecko.NewClient(nil, "pro api key", true)
defer cgClient.Close()

data, err := cgClient.CoinsId("bitcoin", true, true, true, false, false, false)
data, err := cgClient.CoinsId(context.Background(), "bitcoin", true, true, true, false, false, false)
if err != nil {
fmt.Print("Somethig went wrong...")
return
Expand Down
2 changes: 1 addition & 1 deletion exchangeRates.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"

"github.com/JulianToledano/goingecko/exchangeRates"
"github.com/JulianToledano/goingecko/v2/exchangeRates"
)

func (c *Client) ExchangeRates(ctx context.Context) (*exchangeRates.Rates, error) {
Expand Down
2 changes: 1 addition & 1 deletion exchanges.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"net/url"

"github.com/JulianToledano/goingecko/exchanges"
"github.com/JulianToledano/goingecko/v2/exchanges"
)

// Exchanges List all exchanges
Expand Down
2 changes: 1 addition & 1 deletion global.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"

"github.com/JulianToledano/goingecko/global"
"github.com/JulianToledano/goingecko/v2/global"
)

func (c *Client) Global(ctx context.Context) (*global.Global, error) {
Expand Down
2 changes: 1 addition & 1 deletion global/global.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package global

import "github.com/JulianToledano/goingecko/types"
import "github.com/JulianToledano/goingecko/v2/types"

type Global struct {
Data data `json:"data"`
Expand Down
7 changes: 1 addition & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
module github.com/JulianToledano/goingecko
module github.com/JulianToledano/goingecko/v2

go 1.21

retract (
v1.0.0 // Published accidentally.
v1.0.1 // Published accidentally.
)
2 changes: 1 addition & 1 deletion nfts.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"net/url"

"github.com/JulianToledano/goingecko/nfts"
"github.com/JulianToledano/goingecko/v2/nfts"
)

// NftsList Use this to obtain all the NFT ids in order to make API calls, paginated to 100 items.
Expand Down
2 changes: 1 addition & 1 deletion search.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"net/url"

"github.com/JulianToledano/goingecko/search"
"github.com/JulianToledano/goingecko/v2/search"
)

// Search for coins, categories and markets listed on CoinGecko ordered by largest Market Cap first.
Expand Down
2 changes: 1 addition & 1 deletion simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/url"
"strconv"

"github.com/JulianToledano/goingecko/simple"
"github.com/JulianToledano/goingecko/v2/simple"
)

func (c *Client) SimplePrice(ctx context.Context, ids, vsCurrencies string, includeMarketCap, includeDayVolume, includeDayChange, includeLastTimeUpdated bool) (simple.Price, error) {
Expand Down
3 changes: 2 additions & 1 deletion test/assetPlatforms_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package test

import (
"context"
"github.com/JulianToledano/goingecko"
"testing"

"github.com/JulianToledano/goingecko/v2"
)

func TestAssetPlatforms(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion test/categories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package test

import (
"context"
"github.com/JulianToledano/goingecko"
"testing"

"github.com/JulianToledano/goingecko/v2"
)

func TestCategoriesList(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/coins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func TestCoinsList(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion test/companies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package test

import (
"context"
"github.com/JulianToledano/goingecko"
"testing"

"github.com/JulianToledano/goingecko/v2"
)

func TestPublicTreasuryCoinId(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func TestContractInfo(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/derivatives_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func TestDerivatives(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/exchangeRates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func TestExchangeRates(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion test/exchanges_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package test

import (
"context"
"github.com/JulianToledano/goingecko"
"testing"

"github.com/JulianToledano/goingecko/v2"
)

func TestExchanges(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/global_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func TestGlobal(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/goingecko_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"testing"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func TestCoins(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion test/nfts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package test

import (
"context"
"github.com/JulianToledano/goingecko"
"testing"

"github.com/JulianToledano/goingecko/v2"
)

func TestNftsList(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion test/search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package test

import (
"context"
"github.com/JulianToledano/goingecko"
"testing"

"github.com/JulianToledano/goingecko/v2"
)

func TestSearch(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func TestSimplePrice(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion test/trending_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"testing"

"github.com/JulianToledano/goingecko"
"github.com/JulianToledano/goingecko/v2"
)

func TestTrending(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion trending.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"

"github.com/JulianToledano/goingecko/trending"
"github.com/JulianToledano/goingecko/v2/trending"
)

func (c *Client) Trending(ctx context.Context) (*trending.Trending, error) {
Expand Down

0 comments on commit 2c363df

Please sign in to comment.