Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7780a891d | |||
| 06a9c87722 | |||
| aaf697a005 | |||
| 7ef9cb37e6 | |||
| 87afdc63b8 | |||
| b99d06a2de | |||
| 4b6f488f59 |
@@ -14,7 +14,7 @@ A Go client library for the IGDB (Internet Game Database) API v4. This library p
|
|||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
go get github.com/bestnite/go-igdb
|
go get git.nite07.com/nite/go-igdb
|
||||||
```
|
```
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
@@ -25,7 +25,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/bestnite/go-igdb"
|
"git.nite07.com/nite/go-igdb"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test1(c *igdb.Client) {
|
func Test1(c *igdb.Client) {
|
||||||
|
|||||||
36
client.go
36
client.go
@@ -1,20 +1,23 @@
|
|||||||
package igdb
|
package igdb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/bestnite/go-flaresolverr"
|
"git.nite07.com/nite/go-flaresolverr"
|
||||||
"github.com/bestnite/go-igdb/endpoint"
|
"git.nite07.com/nite/go-igdb/endpoint"
|
||||||
|
"golang.org/x/time/rate"
|
||||||
|
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
clientID string
|
clientID string
|
||||||
token *TwitchToken
|
token *twitchToken
|
||||||
flaresolverr *flaresolverr.Flaresolverr
|
flaresolverr *flaresolverr.Flaresolverr
|
||||||
limiter *rateLimiter
|
restyClient *resty.Client
|
||||||
|
limiter *rate.Limiter
|
||||||
|
|
||||||
AgeRatingCategories *endpoint.AgeRatingCategories
|
AgeRatingCategories *endpoint.AgeRatingCategories
|
||||||
AgeRatingContentDescriptions *endpoint.AgeRatingContentDescriptions
|
AgeRatingContentDescriptions *endpoint.AgeRatingContentDescriptions
|
||||||
@@ -92,11 +95,11 @@ type Client struct {
|
|||||||
func New(clientID, clientSecret string) *Client {
|
func New(clientID, clientSecret string) *Client {
|
||||||
c := &Client{
|
c := &Client{
|
||||||
clientID: clientID,
|
clientID: clientID,
|
||||||
limiter: newRateLimiter(4),
|
restyClient: NewRestyClient(),
|
||||||
token: NewTwitchToken(clientID, clientSecret),
|
token: newTwitchToken(clientID, clientSecret),
|
||||||
flaresolverr: nil,
|
flaresolverr: nil,
|
||||||
|
limiter: rate.NewLimiter(rate.Limit(4), 4),
|
||||||
}
|
}
|
||||||
|
|
||||||
registerAllEndpoints(c)
|
registerAllEndpoints(c)
|
||||||
|
|
||||||
return c
|
return c
|
||||||
@@ -110,23 +113,30 @@ func NewWithFlaresolverr(clientID, clientSecret string, f *flaresolverr.Flaresol
|
|||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Client) Request(method string, URL string, dataBody any) (*resty.Response, error) {
|
func (g *Client) Request(ctx context.Context, method string, requestURL string, dataBody any) (*resty.Response, error) {
|
||||||
g.limiter.wait()
|
err := g.limiter.Wait(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to get rate limiter token: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
t, err := g.token.getToken()
|
t, err := g.token.GetToken(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to get twitch token: %w", err)
|
return nil, fmt.Errorf("failed to get twitch token: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := request().SetBody(dataBody).SetHeaders(map[string]string{
|
resp, err := g.restyClient.R().SetContext(ctx).SetBody(dataBody).SetHeaders(map[string]string{
|
||||||
"Client-ID": g.clientID,
|
"Client-ID": g.clientID,
|
||||||
"Authorization": "Bearer " + t,
|
"Authorization": "Bearer " + t,
|
||||||
"User-Agent": "",
|
"User-Agent": "",
|
||||||
"Content-Type": "text/plain",
|
"Content-Type": "text/plain",
|
||||||
}).Execute(strings.ToUpper(method), URL)
|
}).Execute(strings.ToUpper(method), requestURL)
|
||||||
|
|
||||||
|
if resp.StatusCode() != 200 {
|
||||||
|
return nil, fmt.Errorf("failed to request, expected 200 but got: %v", resp.StatusCode())
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %s: %w", URL, err)
|
return nil, fmt.Errorf("failed to request: %s: %w", requestURL, err)
|
||||||
}
|
}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewAgeRatingCategories(request RequestFunc) *AgeRatingCategories {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AgeRatingCategories) Query(query string) ([]*pb.AgeRatingCategory, error) {
|
func (a *AgeRatingCategories) Query(ctx context.Context, query string) ([]*pb.AgeRatingCategory, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *AgeRatingCategories) Query(query string) ([]*pb.AgeRatingCategory, erro
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Ageratingcategories) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Ageratingcategories, nil
|
return data.Ageratingcategories, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewAgeRatingContentDescriptions(request RequestFunc) *AgeRatingContentDescr
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AgeRatingContentDescriptions) Query(query string) ([]*pb.AgeRatingContentDescription, error) {
|
func (a *AgeRatingContentDescriptions) Query(ctx context.Context, query string) ([]*pb.AgeRatingContentDescription, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *AgeRatingContentDescriptions) Query(query string) ([]*pb.AgeRatingConte
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Ageratingcontentdescriptions) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Ageratingcontentdescriptions, nil
|
return data.Ageratingcontentdescriptions, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewAgeRatingContentDescriptionsV2(request RequestFunc) *AgeRatingContentDes
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AgeRatingContentDescriptionsV2) Query(query string) ([]*pb.AgeRatingContentDescriptionV2, error) {
|
func (a *AgeRatingContentDescriptionsV2) Query(ctx context.Context, query string) ([]*pb.AgeRatingContentDescriptionV2, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *AgeRatingContentDescriptionsV2) Query(query string) ([]*pb.AgeRatingCon
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Ageratingcontentdescriptionsv2) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Ageratingcontentdescriptionsv2, nil
|
return data.Ageratingcontentdescriptionsv2, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewAgeRatingOrganizations(request RequestFunc) *AgeRatingOrganizations {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AgeRatingOrganizations) Query(query string) ([]*pb.AgeRatingOrganization, error) {
|
func (a *AgeRatingOrganizations) Query(ctx context.Context, query string) ([]*pb.AgeRatingOrganization, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *AgeRatingOrganizations) Query(query string) ([]*pb.AgeRatingOrganizatio
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Ageratingorganizations) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Ageratingorganizations, nil
|
return data.Ageratingorganizations, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewAgeRatings(request RequestFunc) *AgeRatings {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AgeRatings) Query(query string) ([]*pb.AgeRating, error) {
|
func (a *AgeRatings) Query(ctx context.Context, query string) ([]*pb.AgeRating, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *AgeRatings) Query(query string) ([]*pb.AgeRating, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Ageratings) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Ageratings, nil
|
return data.Ageratings, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewAlternativeNames(request RequestFunc) *AlternativeNames {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AlternativeNames) Query(query string) ([]*pb.AlternativeName, error) {
|
func (a *AlternativeNames) Query(ctx context.Context, query string) ([]*pb.AlternativeName, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *AlternativeNames) Query(query string) ([]*pb.AlternativeName, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Alternativenames) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Alternativenames, nil
|
return data.Alternativenames, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewArtworks(request RequestFunc) *Artworks {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Artworks) Query(query string) ([]*pb.Artwork, error) {
|
func (a *Artworks) Query(ctx context.Context, query string) ([]*pb.Artwork, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Artworks) Query(query string) ([]*pb.Artwork, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Artworks) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Artworks, nil
|
return data.Artworks, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,42 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
|
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RequestFunc func(method string, URL string, dataBody any) (*resty.Response, error)
|
type RequestFunc func(ctx context.Context, method string, URL string, dataBody any) (*resty.Response, error)
|
||||||
|
|
||||||
type BaseEndpoint[T any] struct {
|
type BaseEndpoint[T any] struct {
|
||||||
request RequestFunc
|
request RequestFunc
|
||||||
endpointName Name
|
endpointName Name
|
||||||
queryFunc func(string) ([]*T, error)
|
queryFunc func(context.Context, string) ([]*T, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) GetEndpointName() Name {
|
func (b *BaseEndpoint[T]) GetEndpointName() Name {
|
||||||
return b.endpointName
|
return b.endpointName
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) Query(query string) ([]*T, error) {
|
func (b *BaseEndpoint[T]) Query(ctx context.Context, query string) ([]*T, error) {
|
||||||
if b.queryFunc == nil {
|
if b.queryFunc == nil {
|
||||||
return nil, fmt.Errorf("query method must be implemented by specific endpoint")
|
return nil, fmt.Errorf("query method must be implemented by specific endpoint")
|
||||||
}
|
}
|
||||||
return b.queryFunc(query)
|
return b.queryFunc(ctx, query)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) GetByID(id uint64) (*T, error) {
|
func (b *BaseEndpoint[T]) GetByID(ctx context.Context, id uint64) (*T, error) {
|
||||||
res, err := b.Query(fmt.Sprintf("where id = %d; fields *;", id))
|
if id == 0 {
|
||||||
|
return nil, errors.New("id cant be 0")
|
||||||
|
}
|
||||||
|
res, err := b.Query(ctx, fmt.Sprintf("where id = %d; fields *;", id))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -41,9 +46,9 @@ func (b *BaseEndpoint[T]) GetByID(id uint64) (*T, error) {
|
|||||||
return res[0], nil
|
return res[0], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) GetByIDs(ids []uint64) ([]*T, error) {
|
func (b *BaseEndpoint[T]) GetByIDs(ctx context.Context, ids []uint64) ([]*T, error) {
|
||||||
if len(ids) == 0 {
|
if len(ids) == 0 {
|
||||||
return nil, fmt.Errorf("ids cant be empty")
|
return []*T{}, nil
|
||||||
}
|
}
|
||||||
batches := make([][]uint64, 0)
|
batches := make([][]uint64, 0)
|
||||||
for i := 0; i < len(ids); i += 500 {
|
for i := 0; i < len(ids); i += 500 {
|
||||||
@@ -59,7 +64,7 @@ func (b *BaseEndpoint[T]) GetByIDs(ids []uint64) ([]*T, error) {
|
|||||||
}
|
}
|
||||||
builder.WriteString(strconv.FormatUint(v, 10))
|
builder.WriteString(strconv.FormatUint(v, 10))
|
||||||
}
|
}
|
||||||
batchRes, err := b.Query(fmt.Sprintf("where id = (%s); fields *; limit 500;", builder.String()))
|
batchRes, err := b.Query(ctx, fmt.Sprintf("where id = (%s); fields *; limit 500;", builder.String()))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -68,8 +73,8 @@ func (b *BaseEndpoint[T]) GetByIDs(ids []uint64) ([]*T, error) {
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) Count() (uint64, error) {
|
func (b *BaseEndpoint[T]) Count(ctx context.Context) (uint64, error) {
|
||||||
resp, err := b.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s/count.pb", b.endpointName), "")
|
resp, err := b.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s/count.pb", b.endpointName), "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, fmt.Errorf("failed to request: %w", err)
|
return 0, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -79,18 +84,22 @@ func (b *BaseEndpoint[T]) Count() (uint64, error) {
|
|||||||
return 0, fmt.Errorf("failed to unmarshal: %w", err)
|
return 0, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return uint64(res.Count), nil
|
if res.Count > 0 {
|
||||||
|
return uint64(res.Count), nil
|
||||||
|
} else {
|
||||||
|
return 0, fmt.Errorf("failed to count, count should larger than 0, but got %v", res.Count)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) Paginated(offset, limit uint64) ([]*T, error) {
|
func (b *BaseEndpoint[T]) Paginated(ctx context.Context, offset, limit uint64) ([]*T, error) {
|
||||||
return b.Query(fmt.Sprintf("offset %d; limit %d; fields *; sort id asc;", offset, limit))
|
return b.Query(ctx, fmt.Sprintf("offset %d; limit %d; fields *; sort id asc;", offset, limit))
|
||||||
}
|
}
|
||||||
|
|
||||||
type EntityEndpoint[T any] interface {
|
type EntityEndpoint[T any] interface {
|
||||||
GetEndpointName() Name
|
GetEndpointName() Name
|
||||||
Query(string) ([]*T, error)
|
Query(context.Context, string) ([]*T, error)
|
||||||
GetByID(uint64) (*T, error)
|
GetByID(context.Context, uint64) (*T, error)
|
||||||
GetByIDs([]uint64) ([]*T, error)
|
GetByIDs(context.Context, []uint64) ([]*T, error)
|
||||||
Count() (uint64, error)
|
Count(context.Context) (uint64, error)
|
||||||
Paginated(uint64, uint64) ([]*T, error)
|
Paginated(context.Context, uint64, uint64) ([]*T, error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCharacterGenders(request RequestFunc) *CharacterGenders {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CharacterGenders) Query(query string) ([]*pb.CharacterGender, error) {
|
func (a *CharacterGenders) Query(ctx context.Context, query string) ([]*pb.CharacterGender, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CharacterGenders) Query(query string) ([]*pb.CharacterGender, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Charactergenders) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Charactergenders, nil
|
return data.Charactergenders, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCharacterMugShots(request RequestFunc) *CharacterMugShots {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CharacterMugShots) Query(query string) ([]*pb.CharacterMugShot, error) {
|
func (a *CharacterMugShots) Query(ctx context.Context, query string) ([]*pb.CharacterMugShot, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CharacterMugShots) Query(query string) ([]*pb.CharacterMugShot, error)
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Charactermugshots) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Charactermugshots, nil
|
return data.Charactermugshots, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCharacterSpecies(request RequestFunc) *CharacterSpecies {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CharacterSpecies) Query(query string) ([]*pb.CharacterSpecie, error) {
|
func (a *CharacterSpecies) Query(ctx context.Context, query string) ([]*pb.CharacterSpecie, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CharacterSpecies) Query(query string) ([]*pb.CharacterSpecie, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Characterspecies) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Characterspecies, nil
|
return data.Characterspecies, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCharacters(request RequestFunc) *Characters {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Characters) Query(query string) ([]*pb.Character, error) {
|
func (a *Characters) Query(ctx context.Context, query string) ([]*pb.Character, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Characters) Query(query string) ([]*pb.Character, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Characters) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Characters, nil
|
return data.Characters, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCollectionMembershipTypes(request RequestFunc) *CollectionMembershipType
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CollectionMembershipTypes) Query(query string) ([]*pb.CollectionMembershipType, error) {
|
func (a *CollectionMembershipTypes) Query(ctx context.Context, query string) ([]*pb.CollectionMembershipType, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CollectionMembershipTypes) Query(query string) ([]*pb.CollectionMembers
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collectionmembershiptypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collectionmembershiptypes, nil
|
return data.Collectionmembershiptypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCollectionMemberships(request RequestFunc) *CollectionMemberships {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CollectionMemberships) Query(query string) ([]*pb.CollectionMembership, error) {
|
func (a *CollectionMemberships) Query(ctx context.Context, query string) ([]*pb.CollectionMembership, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CollectionMemberships) Query(query string) ([]*pb.CollectionMembership,
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collectionmemberships) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collectionmemberships, nil
|
return data.Collectionmemberships, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCollectionRelationTypes(request RequestFunc) *CollectionRelationTypes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CollectionRelationTypes) Query(query string) ([]*pb.CollectionRelationType, error) {
|
func (a *CollectionRelationTypes) Query(ctx context.Context, query string) ([]*pb.CollectionRelationType, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CollectionRelationTypes) Query(query string) ([]*pb.CollectionRelationT
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collectionrelationtypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collectionrelationtypes, nil
|
return data.Collectionrelationtypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCollectionRelations(request RequestFunc) *CollectionRelations {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CollectionRelations) Query(query string) ([]*pb.CollectionRelation, error) {
|
func (a *CollectionRelations) Query(ctx context.Context, query string) ([]*pb.CollectionRelation, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CollectionRelations) Query(query string) ([]*pb.CollectionRelation, err
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collectionrelations) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collectionrelations, nil
|
return data.Collectionrelations, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCollectionTypes(request RequestFunc) *CollectionTypes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CollectionTypes) Query(query string) ([]*pb.CollectionType, error) {
|
func (a *CollectionTypes) Query(ctx context.Context, query string) ([]*pb.CollectionType, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CollectionTypes) Query(query string) ([]*pb.CollectionType, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collectiontypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collectiontypes, nil
|
return data.Collectiontypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCollections(request RequestFunc) *Collections {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Collections) Query(query string) ([]*pb.Collection, error) {
|
func (a *Collections) Query(ctx context.Context, query string) ([]*pb.Collection, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Collections) Query(query string) ([]*pb.Collection, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Collections) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Collections, nil
|
return data.Collections, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -24,8 +24,8 @@ func NewCompanies(request RequestFunc) *Companies {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Companies) Query(query string) ([]*pb.Company, error) {
|
func (a *Companies) Query(ctx context.Context, query string) ([]*pb.Company, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -35,9 +35,5 @@ func (a *Companies) Query(query string) ([]*pb.Company, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Companies) == 0 {
|
|
||||||
return nil, errors.New("no results")
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Companies, nil
|
return data.Companies, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCompanyLogos(request RequestFunc) *CompanyLogos {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CompanyLogos) Query(query string) ([]*pb.CompanyLogo, error) {
|
func (a *CompanyLogos) Query(ctx context.Context, query string) ([]*pb.CompanyLogo, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CompanyLogos) Query(query string) ([]*pb.CompanyLogo, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Companylogos) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Companylogos, nil
|
return data.Companylogos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCompanyStatuses(request RequestFunc) *CompanyStatuses {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CompanyStatuses) Query(query string) ([]*pb.CompanyStatus, error) {
|
func (a *CompanyStatuses) Query(ctx context.Context, query string) ([]*pb.CompanyStatus, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CompanyStatuses) Query(query string) ([]*pb.CompanyStatus, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Companystatuses) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Companystatuses, nil
|
return data.Companystatuses, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCompanyWebsites(request RequestFunc) *CompanyWebsites {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *CompanyWebsites) Query(query string) ([]*pb.CompanyWebsite, error) {
|
func (a *CompanyWebsites) Query(ctx context.Context, query string) ([]*pb.CompanyWebsite, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *CompanyWebsites) Query(query string) ([]*pb.CompanyWebsite, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Companywebsites) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Companywebsites, nil
|
return data.Companywebsites, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewCovers(request RequestFunc) *Covers {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Covers) Query(query string) ([]*pb.Cover, error) {
|
func (a *Covers) Query(ctx context.Context, query string) ([]*pb.Cover, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Covers) Query(query string) ([]*pb.Cover, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Covers) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Covers, nil
|
return data.Covers, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewDateFormats(request RequestFunc) *DateFormats {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *DateFormats) Query(query string) ([]*pb.DateFormat, error) {
|
func (a *DateFormats) Query(ctx context.Context, query string) ([]*pb.DateFormat, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *DateFormats) Query(query string) ([]*pb.DateFormat, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Dateformats) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Dateformats, nil
|
return data.Dateformats, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewEventLogos(request RequestFunc) *EventLogos {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *EventLogos) Query(query string) ([]*pb.EventLogo, error) {
|
func (a *EventLogos) Query(ctx context.Context, query string) ([]*pb.EventLogo, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *EventLogos) Query(query string) ([]*pb.EventLogo, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Eventlogos) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Eventlogos, nil
|
return data.Eventlogos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewEventNetworks(request RequestFunc) *EventNetworks {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *EventNetworks) Query(query string) ([]*pb.EventNetwork, error) {
|
func (a *EventNetworks) Query(ctx context.Context, query string) ([]*pb.EventNetwork, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *EventNetworks) Query(query string) ([]*pb.EventNetwork, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Eventnetworks) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Eventnetworks, nil
|
return data.Eventnetworks, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewEvents(request RequestFunc) *Events {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Events) Query(query string) ([]*pb.Event, error) {
|
func (a *Events) Query(ctx context.Context, query string) ([]*pb.Event, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Events) Query(query string) ([]*pb.Event, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Events) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Events, nil
|
return data.Events, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewExternalGameSources(request RequestFunc) *ExternalGameSources {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ExternalGameSources) Query(query string) ([]*pb.ExternalGameSource, error) {
|
func (a *ExternalGameSources) Query(ctx context.Context, query string) ([]*pb.ExternalGameSource, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *ExternalGameSources) Query(query string) ([]*pb.ExternalGameSource, err
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Externalgamesources) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Externalgamesources, nil
|
return data.Externalgamesources, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewExternalGames(request RequestFunc) *ExternalGames {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ExternalGames) Query(query string) ([]*pb.ExternalGame, error) {
|
func (a *ExternalGames) Query(ctx context.Context, query string) ([]*pb.ExternalGame, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *ExternalGames) Query(query string) ([]*pb.ExternalGame, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Externalgames) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Externalgames, nil
|
return data.Externalgames, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type Franchises struct {
|
|||||||
|
|
||||||
func NewFranchises(request RequestFunc) *Franchises {
|
func NewFranchises(request RequestFunc) *Franchises {
|
||||||
a := &Franchises{
|
a := &Franchises{
|
||||||
BaseEndpoint[pb.Franchise]{
|
BaseEndpoint: BaseEndpoint[pb.Franchise]{
|
||||||
endpointName: EPFranchises,
|
endpointName: EPFranchises,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewFranchises(request RequestFunc) *Franchises {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Franchises) Query(query string) ([]*pb.Franchise, error) {
|
func (a *Franchises) Query(ctx context.Context, query string) ([]*pb.Franchise, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Franchises) Query(query string) ([]*pb.Franchise, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Franchises) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Franchises, nil
|
return data.Franchises, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewGameEngineLogos(request RequestFunc) *GameEngineLogos {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameEngineLogos) Query(query string) ([]*pb.GameEngineLogo, error) {
|
func (a *GameEngineLogos) Query(ctx context.Context, query string) ([]*pb.GameEngineLogo, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameEngineLogos) Query(query string) ([]*pb.GameEngineLogo, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gameenginelogos) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gameenginelogos, nil
|
return data.Gameenginelogos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameEngines struct {
|
|||||||
|
|
||||||
func NewGameEngines(request RequestFunc) *GameEngines {
|
func NewGameEngines(request RequestFunc) *GameEngines {
|
||||||
a := &GameEngines{
|
a := &GameEngines{
|
||||||
BaseEndpoint[pb.GameEngine]{
|
BaseEndpoint: BaseEndpoint[pb.GameEngine]{
|
||||||
endpointName: EPGameEngines,
|
endpointName: EPGameEngines,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameEngines(request RequestFunc) *GameEngines {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameEngines) Query(query string) ([]*pb.GameEngine, error) {
|
func (a *GameEngines) Query(ctx context.Context, query string) ([]*pb.GameEngine, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameEngines) Query(query string) ([]*pb.GameEngine, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gameengines) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gameengines, nil
|
return data.Gameengines, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameLocalizations struct {
|
|||||||
|
|
||||||
func NewGameLocalizations(request RequestFunc) *GameLocalizations {
|
func NewGameLocalizations(request RequestFunc) *GameLocalizations {
|
||||||
a := &GameLocalizations{
|
a := &GameLocalizations{
|
||||||
BaseEndpoint[pb.GameLocalization]{
|
BaseEndpoint: BaseEndpoint[pb.GameLocalization]{
|
||||||
endpointName: EPGameLocalizations,
|
endpointName: EPGameLocalizations,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameLocalizations(request RequestFunc) *GameLocalizations {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameLocalizations) Query(query string) ([]*pb.GameLocalization, error) {
|
func (a *GameLocalizations) Query(ctx context.Context, query string) ([]*pb.GameLocalization, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameLocalizations) Query(query string) ([]*pb.GameLocalization, error)
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gamelocalizations) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gamelocalizations, nil
|
return data.Gamelocalizations, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameModes struct {
|
|||||||
|
|
||||||
func NewGameModes(request RequestFunc) *GameModes {
|
func NewGameModes(request RequestFunc) *GameModes {
|
||||||
a := &GameModes{
|
a := &GameModes{
|
||||||
BaseEndpoint[pb.GameMode]{
|
BaseEndpoint: BaseEndpoint[pb.GameMode]{
|
||||||
endpointName: EPGameModes,
|
endpointName: EPGameModes,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameModes(request RequestFunc) *GameModes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameModes) Query(query string) ([]*pb.GameMode, error) {
|
func (a *GameModes) Query(ctx context.Context, query string) ([]*pb.GameMode, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameModes) Query(query string) ([]*pb.GameMode, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gamemodes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gamemodes, nil
|
return data.Gamemodes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameReleaseFormats struct {
|
|||||||
|
|
||||||
func NewGameReleaseFormats(request RequestFunc) *GameReleaseFormats {
|
func NewGameReleaseFormats(request RequestFunc) *GameReleaseFormats {
|
||||||
a := &GameReleaseFormats{
|
a := &GameReleaseFormats{
|
||||||
BaseEndpoint[pb.GameReleaseFormat]{
|
BaseEndpoint: BaseEndpoint[pb.GameReleaseFormat]{
|
||||||
endpointName: EPGameReleaseFormats,
|
endpointName: EPGameReleaseFormats,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameReleaseFormats(request RequestFunc) *GameReleaseFormats {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameReleaseFormats) Query(query string) ([]*pb.GameReleaseFormat, error) {
|
func (a *GameReleaseFormats) Query(ctx context.Context, query string) ([]*pb.GameReleaseFormat, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameReleaseFormats) Query(query string) ([]*pb.GameReleaseFormat, error
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gamereleaseformats) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gamereleaseformats, nil
|
return data.Gamereleaseformats, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameStatuses struct {
|
|||||||
|
|
||||||
func NewGameStatuses(request RequestFunc) *GameStatuses {
|
func NewGameStatuses(request RequestFunc) *GameStatuses {
|
||||||
a := &GameStatuses{
|
a := &GameStatuses{
|
||||||
BaseEndpoint[pb.GameStatus]{
|
BaseEndpoint: BaseEndpoint[pb.GameStatus]{
|
||||||
endpointName: EPGameStatuses,
|
endpointName: EPGameStatuses,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameStatuses(request RequestFunc) *GameStatuses {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameStatuses) Query(query string) ([]*pb.GameStatus, error) {
|
func (a *GameStatuses) Query(ctx context.Context, query string) ([]*pb.GameStatus, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameStatuses) Query(query string) ([]*pb.GameStatus, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gamestatuses) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gamestatuses, nil
|
return data.Gamestatuses, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameTimeToBeats struct {
|
|||||||
|
|
||||||
func NewGameTimeToBeats(request RequestFunc) *GameTimeToBeats {
|
func NewGameTimeToBeats(request RequestFunc) *GameTimeToBeats {
|
||||||
a := &GameTimeToBeats{
|
a := &GameTimeToBeats{
|
||||||
BaseEndpoint[pb.GameTimeToBeat]{
|
BaseEndpoint: BaseEndpoint[pb.GameTimeToBeat]{
|
||||||
endpointName: EPGameTimeToBeats,
|
endpointName: EPGameTimeToBeats,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameTimeToBeats(request RequestFunc) *GameTimeToBeats {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameTimeToBeats) Query(query string) ([]*pb.GameTimeToBeat, error) {
|
func (a *GameTimeToBeats) Query(ctx context.Context, query string) ([]*pb.GameTimeToBeat, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameTimeToBeats) Query(query string) ([]*pb.GameTimeToBeat, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gametimetobeats) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gametimetobeats, nil
|
return data.Gametimetobeats, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameTypes struct {
|
|||||||
|
|
||||||
func NewGameTypes(request RequestFunc) *GameTypes {
|
func NewGameTypes(request RequestFunc) *GameTypes {
|
||||||
a := &GameTypes{
|
a := &GameTypes{
|
||||||
BaseEndpoint[pb.GameType]{
|
BaseEndpoint: BaseEndpoint[pb.GameType]{
|
||||||
endpointName: EPGameTypes,
|
endpointName: EPGameTypes,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameTypes(request RequestFunc) *GameTypes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameTypes) Query(query string) ([]*pb.GameType, error) {
|
func (a *GameTypes) Query(ctx context.Context, query string) ([]*pb.GameType, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameTypes) Query(query string) ([]*pb.GameType, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gametypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gametypes, nil
|
return data.Gametypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameVersionFeatureValues struct {
|
|||||||
|
|
||||||
func NewGameVersionFeatureValues(request RequestFunc) *GameVersionFeatureValues {
|
func NewGameVersionFeatureValues(request RequestFunc) *GameVersionFeatureValues {
|
||||||
a := &GameVersionFeatureValues{
|
a := &GameVersionFeatureValues{
|
||||||
BaseEndpoint[pb.GameVersionFeatureValue]{
|
BaseEndpoint: BaseEndpoint[pb.GameVersionFeatureValue]{
|
||||||
endpointName: EPGameVersionFeatureValues,
|
endpointName: EPGameVersionFeatureValues,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameVersionFeatureValues(request RequestFunc) *GameVersionFeatureValues
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameVersionFeatureValues) Query(query string) ([]*pb.GameVersionFeatureValue, error) {
|
func (a *GameVersionFeatureValues) Query(ctx context.Context, query string) ([]*pb.GameVersionFeatureValue, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameVersionFeatureValues) Query(query string) ([]*pb.GameVersionFeature
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gameversionfeaturevalues) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gameversionfeaturevalues, nil
|
return data.Gameversionfeaturevalues, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameVersionFeatures struct {
|
|||||||
|
|
||||||
func NewGameVersionFeatures(request RequestFunc) *GameVersionFeatures {
|
func NewGameVersionFeatures(request RequestFunc) *GameVersionFeatures {
|
||||||
a := &GameVersionFeatures{
|
a := &GameVersionFeatures{
|
||||||
BaseEndpoint[pb.GameVersionFeature]{
|
BaseEndpoint: BaseEndpoint[pb.GameVersionFeature]{
|
||||||
endpointName: EPGameVersionFeatures,
|
endpointName: EPGameVersionFeatures,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameVersionFeatures(request RequestFunc) *GameVersionFeatures {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameVersionFeatures) Query(query string) ([]*pb.GameVersionFeature, error) {
|
func (a *GameVersionFeatures) Query(ctx context.Context, query string) ([]*pb.GameVersionFeature, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameVersionFeatures) Query(query string) ([]*pb.GameVersionFeature, err
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gameversionfeatures) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gameversionfeatures, nil
|
return data.Gameversionfeatures, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameVersions struct {
|
|||||||
|
|
||||||
func NewGameVersions(request RequestFunc) *GameVersions {
|
func NewGameVersions(request RequestFunc) *GameVersions {
|
||||||
a := &GameVersions{
|
a := &GameVersions{
|
||||||
BaseEndpoint[pb.GameVersion]{
|
BaseEndpoint: BaseEndpoint[pb.GameVersion]{
|
||||||
endpointName: EPGameVersions,
|
endpointName: EPGameVersions,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameVersions(request RequestFunc) *GameVersions {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameVersions) Query(query string) ([]*pb.GameVersion, error) {
|
func (a *GameVersions) Query(ctx context.Context, query string) ([]*pb.GameVersion, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameVersions) Query(query string) ([]*pb.GameVersion, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gameversions) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gameversions, nil
|
return data.Gameversions, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type GameVideos struct {
|
|||||||
|
|
||||||
func NewGameVideos(request RequestFunc) *GameVideos {
|
func NewGameVideos(request RequestFunc) *GameVideos {
|
||||||
a := &GameVideos{
|
a := &GameVideos{
|
||||||
BaseEndpoint[pb.GameVideo]{
|
BaseEndpoint: BaseEndpoint[pb.GameVideo]{
|
||||||
endpointName: EPGameVideos,
|
endpointName: EPGameVideos,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGameVideos(request RequestFunc) *GameVideos {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *GameVideos) Query(query string) ([]*pb.GameVideo, error) {
|
func (a *GameVideos) Query(ctx context.Context, query string) ([]*pb.GameVideo, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *GameVideos) Query(query string) ([]*pb.GameVideo, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Gamevideos) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Gamevideos, nil
|
return data.Gamevideos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type Games struct {
|
|||||||
|
|
||||||
func NewGames(request RequestFunc) *Games {
|
func NewGames(request RequestFunc) *Games {
|
||||||
a := &Games{
|
a := &Games{
|
||||||
BaseEndpoint[pb.Game]{
|
BaseEndpoint: BaseEndpoint[pb.Game]{
|
||||||
endpointName: EPGames,
|
endpointName: EPGames,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGames(request RequestFunc) *Games {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Games) Query(query string) ([]*pb.Game, error) {
|
func (a *Games) Query(ctx context.Context, query string) ([]*pb.Game, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Games) Query(query string) ([]*pb.Game, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Games) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Games, nil
|
return data.Games, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type Genres struct {
|
|||||||
|
|
||||||
func NewGenres(request RequestFunc) *Genres {
|
func NewGenres(request RequestFunc) *Genres {
|
||||||
a := &Genres{
|
a := &Genres{
|
||||||
BaseEndpoint[pb.Genre]{
|
BaseEndpoint: BaseEndpoint[pb.Genre]{
|
||||||
endpointName: EPGenres,
|
endpointName: EPGenres,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewGenres(request RequestFunc) *Genres {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Genres) Query(query string) ([]*pb.Genre, error) {
|
func (a *Genres) Query(ctx context.Context, query string) ([]*pb.Genre, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Genres) Query(query string) ([]*pb.Genre, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Genres) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Genres, nil
|
return data.Genres, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type InvolvedCompanies struct {
|
|||||||
|
|
||||||
func NewInvolvedCompanies(request RequestFunc) *InvolvedCompanies {
|
func NewInvolvedCompanies(request RequestFunc) *InvolvedCompanies {
|
||||||
a := &InvolvedCompanies{
|
a := &InvolvedCompanies{
|
||||||
BaseEndpoint[pb.InvolvedCompany]{
|
BaseEndpoint: BaseEndpoint[pb.InvolvedCompany]{
|
||||||
endpointName: EPInvolvedCompanies,
|
endpointName: EPInvolvedCompanies,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewInvolvedCompanies(request RequestFunc) *InvolvedCompanies {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *InvolvedCompanies) Query(query string) ([]*pb.InvolvedCompany, error) {
|
func (a *InvolvedCompanies) Query(ctx context.Context, query string) ([]*pb.InvolvedCompany, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *InvolvedCompanies) Query(query string) ([]*pb.InvolvedCompany, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Involvedcompanies) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Involvedcompanies, nil
|
return data.Involvedcompanies, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type Keywords struct {
|
|||||||
|
|
||||||
func NewKeywords(request RequestFunc) *Keywords {
|
func NewKeywords(request RequestFunc) *Keywords {
|
||||||
a := &Keywords{
|
a := &Keywords{
|
||||||
BaseEndpoint[pb.Keyword]{
|
BaseEndpoint: BaseEndpoint[pb.Keyword]{
|
||||||
endpointName: EPKeywords,
|
endpointName: EPKeywords,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewKeywords(request RequestFunc) *Keywords {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Keywords) Query(query string) ([]*pb.Keyword, error) {
|
func (a *Keywords) Query(ctx context.Context, query string) ([]*pb.Keyword, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Keywords) Query(query string) ([]*pb.Keyword, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Keywords) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Keywords, nil
|
return data.Keywords, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewLanguageSupportTypes(request RequestFunc) *LanguageSupportTypes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *LanguageSupportTypes) Query(query string) ([]*pb.LanguageSupportType, error) {
|
func (a *LanguageSupportTypes) Query(ctx context.Context, query string) ([]*pb.LanguageSupportType, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *LanguageSupportTypes) Query(query string) ([]*pb.LanguageSupportType, e
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Languagesupporttypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Languagesupporttypes, nil
|
return data.Languagesupporttypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type LanguageSupports struct {
|
|||||||
|
|
||||||
func NewLanguageSupports(request RequestFunc) *LanguageSupports {
|
func NewLanguageSupports(request RequestFunc) *LanguageSupports {
|
||||||
a := &LanguageSupports{
|
a := &LanguageSupports{
|
||||||
BaseEndpoint[pb.LanguageSupport]{
|
BaseEndpoint: BaseEndpoint[pb.LanguageSupport]{
|
||||||
endpointName: EPLanguageSupports,
|
endpointName: EPLanguageSupports,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewLanguageSupports(request RequestFunc) *LanguageSupports {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *LanguageSupports) Query(query string) ([]*pb.LanguageSupport, error) {
|
func (a *LanguageSupports) Query(ctx context.Context, query string) ([]*pb.LanguageSupport, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *LanguageSupports) Query(query string) ([]*pb.LanguageSupport, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Languagesupports) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Languagesupports, nil
|
return data.Languagesupports, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type Languages struct {
|
|||||||
|
|
||||||
func NewLanguages(request RequestFunc) *Languages {
|
func NewLanguages(request RequestFunc) *Languages {
|
||||||
a := &Languages{
|
a := &Languages{
|
||||||
BaseEndpoint[pb.Language]{
|
BaseEndpoint: BaseEndpoint[pb.Language]{
|
||||||
endpointName: EPLanguages,
|
endpointName: EPLanguages,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewLanguages(request RequestFunc) *Languages {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Languages) Query(query string) ([]*pb.Language, error) {
|
func (a *Languages) Query(ctx context.Context, query string) ([]*pb.Language, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Languages) Query(query string) ([]*pb.Language, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Languages) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Languages, nil
|
return data.Languages, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type MultiplayerModes struct {
|
|||||||
|
|
||||||
func NewMultiplayerModes(request RequestFunc) *MultiplayerModes {
|
func NewMultiplayerModes(request RequestFunc) *MultiplayerModes {
|
||||||
a := &MultiplayerModes{
|
a := &MultiplayerModes{
|
||||||
BaseEndpoint[pb.MultiplayerMode]{
|
BaseEndpoint: BaseEndpoint[pb.MultiplayerMode]{
|
||||||
endpointName: EPMultiplayerModes,
|
endpointName: EPMultiplayerModes,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewMultiplayerModes(request RequestFunc) *MultiplayerModes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *MultiplayerModes) Query(query string) ([]*pb.MultiplayerMode, error) {
|
func (a *MultiplayerModes) Query(ctx context.Context, query string) ([]*pb.MultiplayerMode, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *MultiplayerModes) Query(query string) ([]*pb.MultiplayerMode, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Multiplayermodes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Multiplayermodes, nil
|
return data.Multiplayermodes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type NetworkTypes struct {
|
|||||||
|
|
||||||
func NewNetworkTypes(request RequestFunc) *NetworkTypes {
|
func NewNetworkTypes(request RequestFunc) *NetworkTypes {
|
||||||
a := &NetworkTypes{
|
a := &NetworkTypes{
|
||||||
BaseEndpoint[pb.NetworkType]{
|
BaseEndpoint: BaseEndpoint[pb.NetworkType]{
|
||||||
endpointName: EPNetworkTypes,
|
endpointName: EPNetworkTypes,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewNetworkTypes(request RequestFunc) *NetworkTypes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *NetworkTypes) Query(query string) ([]*pb.NetworkType, error) {
|
func (a *NetworkTypes) Query(ctx context.Context, query string) ([]*pb.NetworkType, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *NetworkTypes) Query(query string) ([]*pb.NetworkType, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Networktypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Networktypes, nil
|
return data.Networktypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type PlatformFamilies struct {
|
|||||||
|
|
||||||
func NewPlatformFamilies(request RequestFunc) *PlatformFamilies {
|
func NewPlatformFamilies(request RequestFunc) *PlatformFamilies {
|
||||||
a := &PlatformFamilies{
|
a := &PlatformFamilies{
|
||||||
BaseEndpoint[pb.PlatformFamily]{
|
BaseEndpoint: BaseEndpoint[pb.PlatformFamily]{
|
||||||
endpointName: EPPlatformFamilies,
|
endpointName: EPPlatformFamilies,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewPlatformFamilies(request RequestFunc) *PlatformFamilies {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PlatformFamilies) Query(query string) ([]*pb.PlatformFamily, error) {
|
func (a *PlatformFamilies) Query(ctx context.Context, query string) ([]*pb.PlatformFamily, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *PlatformFamilies) Query(query string) ([]*pb.PlatformFamily, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformfamilies) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformfamilies, nil
|
return data.Platformfamilies, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type PlatformLogos struct {
|
|||||||
|
|
||||||
func NewPlatformLogos(request RequestFunc) *PlatformLogos {
|
func NewPlatformLogos(request RequestFunc) *PlatformLogos {
|
||||||
a := &PlatformLogos{
|
a := &PlatformLogos{
|
||||||
BaseEndpoint[pb.PlatformLogo]{
|
BaseEndpoint: BaseEndpoint[pb.PlatformLogo]{
|
||||||
endpointName: EPPlatformLogos,
|
endpointName: EPPlatformLogos,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewPlatformLogos(request RequestFunc) *PlatformLogos {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PlatformLogos) Query(query string) ([]*pb.PlatformLogo, error) {
|
func (a *PlatformLogos) Query(ctx context.Context, query string) ([]*pb.PlatformLogo, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *PlatformLogos) Query(query string) ([]*pb.PlatformLogo, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformlogos) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformlogos, nil
|
return data.Platformlogos, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type PlatformTypes struct {
|
|||||||
|
|
||||||
func NewPlatformTypes(request RequestFunc) *PlatformTypes {
|
func NewPlatformTypes(request RequestFunc) *PlatformTypes {
|
||||||
a := &PlatformTypes{
|
a := &PlatformTypes{
|
||||||
BaseEndpoint[pb.PlatformType]{
|
BaseEndpoint: BaseEndpoint[pb.PlatformType]{
|
||||||
endpointName: EPPlatformTypes,
|
endpointName: EPPlatformTypes,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewPlatformTypes(request RequestFunc) *PlatformTypes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PlatformTypes) Query(query string) ([]*pb.PlatformType, error) {
|
func (a *PlatformTypes) Query(ctx context.Context, query string) ([]*pb.PlatformType, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *PlatformTypes) Query(query string) ([]*pb.PlatformType, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformtypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformtypes, nil
|
return data.Platformtypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type PlatformVersionCompanies struct {
|
|||||||
|
|
||||||
func NewPlatformVersionCompanies(request RequestFunc) *PlatformVersionCompanies {
|
func NewPlatformVersionCompanies(request RequestFunc) *PlatformVersionCompanies {
|
||||||
a := &PlatformVersionCompanies{
|
a := &PlatformVersionCompanies{
|
||||||
BaseEndpoint[pb.PlatformVersionCompany]{
|
BaseEndpoint: BaseEndpoint[pb.PlatformVersionCompany]{
|
||||||
endpointName: EPPlatformVersionCompanies,
|
endpointName: EPPlatformVersionCompanies,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewPlatformVersionCompanies(request RequestFunc) *PlatformVersionCompanies
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PlatformVersionCompanies) Query(query string) ([]*pb.PlatformVersionCompany, error) {
|
func (a *PlatformVersionCompanies) Query(ctx context.Context, query string) ([]*pb.PlatformVersionCompany, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *PlatformVersionCompanies) Query(query string) ([]*pb.PlatformVersionCom
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformversioncompanies) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformversioncompanies, nil
|
return data.Platformversioncompanies, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type PlatformVersionReleaseDates struct {
|
|||||||
|
|
||||||
func NewPlatformVersionReleaseDates(request RequestFunc) *PlatformVersionReleaseDates {
|
func NewPlatformVersionReleaseDates(request RequestFunc) *PlatformVersionReleaseDates {
|
||||||
a := &PlatformVersionReleaseDates{
|
a := &PlatformVersionReleaseDates{
|
||||||
BaseEndpoint[pb.PlatformVersionReleaseDate]{
|
BaseEndpoint: BaseEndpoint[pb.PlatformVersionReleaseDate]{
|
||||||
endpointName: EPPlatformVersionReleaseDates,
|
endpointName: EPPlatformVersionReleaseDates,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewPlatformVersionReleaseDates(request RequestFunc) *PlatformVersionRelease
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PlatformVersionReleaseDates) Query(query string) ([]*pb.PlatformVersionReleaseDate, error) {
|
func (a *PlatformVersionReleaseDates) Query(ctx context.Context, query string) ([]*pb.PlatformVersionReleaseDate, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *PlatformVersionReleaseDates) Query(query string) ([]*pb.PlatformVersion
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformversionreleasedates) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformversionreleasedates, nil
|
return data.Platformversionreleasedates, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type PlatformVersions struct {
|
|||||||
|
|
||||||
func NewPlatformVersions(request RequestFunc) *PlatformVersions {
|
func NewPlatformVersions(request RequestFunc) *PlatformVersions {
|
||||||
a := &PlatformVersions{
|
a := &PlatformVersions{
|
||||||
BaseEndpoint[pb.PlatformVersion]{
|
BaseEndpoint: BaseEndpoint[pb.PlatformVersion]{
|
||||||
endpointName: EPPlatformVersions,
|
endpointName: EPPlatformVersions,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewPlatformVersions(request RequestFunc) *PlatformVersions {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PlatformVersions) Query(query string) ([]*pb.PlatformVersion, error) {
|
func (a *PlatformVersions) Query(ctx context.Context, query string) ([]*pb.PlatformVersion, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *PlatformVersions) Query(query string) ([]*pb.PlatformVersion, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformversions) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformversions, nil
|
return data.Platformversions, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type PlatformWebsites struct {
|
|||||||
|
|
||||||
func NewPlatformWebsites(request RequestFunc) *PlatformWebsites {
|
func NewPlatformWebsites(request RequestFunc) *PlatformWebsites {
|
||||||
a := &PlatformWebsites{
|
a := &PlatformWebsites{
|
||||||
BaseEndpoint[pb.PlatformWebsite]{
|
BaseEndpoint: BaseEndpoint[pb.PlatformWebsite]{
|
||||||
endpointName: EPPlatformWebsites,
|
endpointName: EPPlatformWebsites,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewPlatformWebsites(request RequestFunc) *PlatformWebsites {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PlatformWebsites) Query(query string) ([]*pb.PlatformWebsite, error) {
|
func (a *PlatformWebsites) Query(ctx context.Context, query string) ([]*pb.PlatformWebsite, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *PlatformWebsites) Query(query string) ([]*pb.PlatformWebsite, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platformwebsites) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Platformwebsites, nil
|
return data.Platformwebsites, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewPlatforms(request RequestFunc) *Platforms {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Platforms) Query(query string) ([]*pb.Platform, error) {
|
func (a *Platforms) Query(ctx context.Context, query string) ([]*pb.Platform, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,8 +35,5 @@ func (a *Platforms) Query(query string) ([]*pb.Platform, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Platforms) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
return data.Platforms, nil
|
return data.Platforms, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type PlayerPerspectives struct {
|
|||||||
|
|
||||||
func NewPlayerPerspectives(request RequestFunc) *PlayerPerspectives {
|
func NewPlayerPerspectives(request RequestFunc) *PlayerPerspectives {
|
||||||
a := &PlayerPerspectives{
|
a := &PlayerPerspectives{
|
||||||
BaseEndpoint[pb.PlayerPerspective]{
|
BaseEndpoint: BaseEndpoint[pb.PlayerPerspective]{
|
||||||
endpointName: EPPlayerPerspectives,
|
endpointName: EPPlayerPerspectives,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewPlayerPerspectives(request RequestFunc) *PlayerPerspectives {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PlayerPerspectives) Query(query string) ([]*pb.PlayerPerspective, error) {
|
func (a *PlayerPerspectives) Query(ctx context.Context, query string) ([]*pb.PlayerPerspective, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *PlayerPerspectives) Query(query string) ([]*pb.PlayerPerspective, error
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Playerperspectives) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Playerperspectives, nil
|
return data.Playerperspectives, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -23,8 +24,8 @@ func NewPopularityPrimitives(request RequestFunc) *PopularityPrimitives {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PopularityPrimitives) Query(query string) ([]*pb.PopularityPrimitive, error) {
|
func (a *PopularityPrimitives) Query(ctx context.Context, query string) ([]*pb.PopularityPrimitive, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *PopularityPrimitives) Query(query string) ([]*pb.PopularityPrimitive, e
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Popularityprimitives) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Popularityprimitives, nil
|
return data.Popularityprimitives, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type PopularityTypes struct {
|
|||||||
|
|
||||||
func NewPopularityTypes(request RequestFunc) *PopularityTypes {
|
func NewPopularityTypes(request RequestFunc) *PopularityTypes {
|
||||||
a := &PopularityTypes{
|
a := &PopularityTypes{
|
||||||
BaseEndpoint[pb.PopularityType]{
|
BaseEndpoint: BaseEndpoint[pb.PopularityType]{
|
||||||
endpointName: EPPopularityTypes,
|
endpointName: EPPopularityTypes,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewPopularityTypes(request RequestFunc) *PopularityTypes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *PopularityTypes) Query(query string) ([]*pb.PopularityType, error) {
|
func (a *PopularityTypes) Query(ctx context.Context, query string) ([]*pb.PopularityType, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *PopularityTypes) Query(query string) ([]*pb.PopularityType, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Popularitytypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Popularitytypes, nil
|
return data.Popularitytypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type Regions struct {
|
|||||||
|
|
||||||
func NewRegions(request RequestFunc) *Regions {
|
func NewRegions(request RequestFunc) *Regions {
|
||||||
a := &Regions{
|
a := &Regions{
|
||||||
BaseEndpoint[pb.Region]{
|
BaseEndpoint: BaseEndpoint[pb.Region]{
|
||||||
endpointName: EPRegions,
|
endpointName: EPRegions,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewRegions(request RequestFunc) *Regions {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Regions) Query(query string) ([]*pb.Region, error) {
|
func (a *Regions) Query(ctx context.Context, query string) ([]*pb.Region, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Regions) Query(query string) ([]*pb.Region, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Regions) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Regions, nil
|
return data.Regions, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type ReleaseDateRegions struct {
|
|||||||
|
|
||||||
func NewReleaseDateRegions(request RequestFunc) *ReleaseDateRegions {
|
func NewReleaseDateRegions(request RequestFunc) *ReleaseDateRegions {
|
||||||
a := &ReleaseDateRegions{
|
a := &ReleaseDateRegions{
|
||||||
BaseEndpoint[pb.ReleaseDateRegion]{
|
BaseEndpoint: BaseEndpoint[pb.ReleaseDateRegion]{
|
||||||
endpointName: EPReleaseDateRegions,
|
endpointName: EPReleaseDateRegions,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewReleaseDateRegions(request RequestFunc) *ReleaseDateRegions {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ReleaseDateRegions) Query(query string) ([]*pb.ReleaseDateRegion, error) {
|
func (a *ReleaseDateRegions) Query(ctx context.Context, query string) ([]*pb.ReleaseDateRegion, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *ReleaseDateRegions) Query(query string) ([]*pb.ReleaseDateRegion, error
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Releasedateregions) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Releasedateregions, nil
|
return data.Releasedateregions, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type ReleaseDateStatuses struct {
|
|||||||
|
|
||||||
func NewReleaseDateStatuses(request RequestFunc) *ReleaseDateStatuses {
|
func NewReleaseDateStatuses(request RequestFunc) *ReleaseDateStatuses {
|
||||||
a := &ReleaseDateStatuses{
|
a := &ReleaseDateStatuses{
|
||||||
BaseEndpoint[pb.ReleaseDateStatus]{
|
BaseEndpoint: BaseEndpoint[pb.ReleaseDateStatus]{
|
||||||
endpointName: EPReleaseDateStatuses,
|
endpointName: EPReleaseDateStatuses,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewReleaseDateStatuses(request RequestFunc) *ReleaseDateStatuses {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ReleaseDateStatuses) Query(query string) ([]*pb.ReleaseDateStatus, error) {
|
func (a *ReleaseDateStatuses) Query(ctx context.Context, query string) ([]*pb.ReleaseDateStatus, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *ReleaseDateStatuses) Query(query string) ([]*pb.ReleaseDateStatus, erro
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Releasedatestatuses) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Releasedatestatuses, nil
|
return data.Releasedatestatuses, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type ReleaseDates struct {
|
|||||||
|
|
||||||
func NewReleaseDates(request RequestFunc) *ReleaseDates {
|
func NewReleaseDates(request RequestFunc) *ReleaseDates {
|
||||||
a := &ReleaseDates{
|
a := &ReleaseDates{
|
||||||
BaseEndpoint[pb.ReleaseDate]{
|
BaseEndpoint: BaseEndpoint[pb.ReleaseDate]{
|
||||||
endpointName: EPReleaseDates,
|
endpointName: EPReleaseDates,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewReleaseDates(request RequestFunc) *ReleaseDates {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ReleaseDates) Query(query string) ([]*pb.ReleaseDate, error) {
|
func (a *ReleaseDates) Query(ctx context.Context, query string) ([]*pb.ReleaseDate, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *ReleaseDates) Query(query string) ([]*pb.ReleaseDate, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Releasedates) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Releasedates, nil
|
return data.Releasedates, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type Screenshots struct {
|
|||||||
|
|
||||||
func NewScreenshots(request RequestFunc) *Screenshots {
|
func NewScreenshots(request RequestFunc) *Screenshots {
|
||||||
a := &Screenshots{
|
a := &Screenshots{
|
||||||
BaseEndpoint[pb.Screenshot]{
|
BaseEndpoint: BaseEndpoint[pb.Screenshot]{
|
||||||
endpointName: EPScreenshots,
|
endpointName: EPScreenshots,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewScreenshots(request RequestFunc) *Screenshots {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Screenshots) Query(query string) ([]*pb.Screenshot, error) {
|
func (a *Screenshots) Query(ctx context.Context, query string) ([]*pb.Screenshot, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Screenshots) Query(query string) ([]*pb.Screenshot, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Screenshots) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Screenshots, nil
|
return data.Screenshots, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@@ -9,10 +10,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
|
"git.nite07.com/nite/go-flaresolverr"
|
||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
"github.com/bestnite/go-flaresolverr"
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -34,8 +35,8 @@ func NewSearch(request RequestFunc) *Search {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Search) Search(query string) ([]*pb.Search, error) {
|
func (a *Search) Search(ctx context.Context, query string) ([]*pb.Search, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -45,10 +46,6 @@ func (a *Search) Search(query string) ([]*pb.Search, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Searches) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Searches, nil
|
return data.Searches, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type Themes struct {
|
|||||||
|
|
||||||
func NewThemes(request RequestFunc) *Themes {
|
func NewThemes(request RequestFunc) *Themes {
|
||||||
a := &Themes{
|
a := &Themes{
|
||||||
BaseEndpoint[pb.Theme]{
|
BaseEndpoint: BaseEndpoint[pb.Theme]{
|
||||||
endpointName: EPThemes,
|
endpointName: EPThemes,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewThemes(request RequestFunc) *Themes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Themes) Query(query string) ([]*pb.Theme, error) {
|
func (a *Themes) Query(ctx context.Context, query string) ([]*pb.Theme, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Themes) Query(query string) ([]*pb.Theme, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Themes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Themes, nil
|
return data.Themes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
@@ -37,13 +38,13 @@ type WebhookResponse struct {
|
|||||||
UpdatedAt string `json:"updated_at"`
|
UpdatedAt string `json:"updated_at"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Webhooks) Register(endpoint Name, secret, callbackUrl string, method WebhookMethod) (*WebhookResponse, error) {
|
func (a *Webhooks) Register(ctx context.Context, endpoint Name, secret, callbackUrl string, method WebhookMethod) (*WebhookResponse, error) {
|
||||||
dataBody := url.Values{}
|
dataBody := url.Values{}
|
||||||
dataBody.Set("url", callbackUrl)
|
dataBody.Set("url", callbackUrl)
|
||||||
dataBody.Set("secret", secret)
|
dataBody.Set("secret", secret)
|
||||||
dataBody.Set("method", string(method))
|
dataBody.Set("method", string(method))
|
||||||
|
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s/webhooks/", endpoint), dataBody.Encode())
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s/webhooks/", endpoint), dataBody.Encode())
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to make request: %s: %w", callbackUrl, err)
|
return nil, fmt.Errorf("failed to make request: %s: %w", callbackUrl, err)
|
||||||
@@ -61,8 +62,8 @@ func (a *Webhooks) Register(endpoint Name, secret, callbackUrl string, method We
|
|||||||
return &data, fmt.Errorf("failed to activate webhook: %s: %s", callbackUrl, resp.String())
|
return &data, fmt.Errorf("failed to activate webhook: %s: %s", callbackUrl, resp.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Webhooks) Unregister(webhookId uint64) error {
|
func (a *Webhooks) Unregister(ctx context.Context, webhookId uint64) error {
|
||||||
resp, err := a.request("DELETE", fmt.Sprintf("https://api.igdb.com/v4/webhooks/%v", webhookId), "")
|
resp, err := a.request(ctx, "DELETE", fmt.Sprintf("https://api.igdb.com/v4/webhooks/%v", webhookId), "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to make request: %w", err)
|
return fmt.Errorf("failed to make request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -74,8 +75,8 @@ func (a *Webhooks) Unregister(webhookId uint64) error {
|
|||||||
return fmt.Errorf("failed to unregister webhook: %s", resp.String())
|
return fmt.Errorf("failed to unregister webhook: %s", resp.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Webhooks) List() ([]*WebhookResponse, error) {
|
func (a *Webhooks) List(ctx context.Context) ([]*WebhookResponse, error) {
|
||||||
resp, err := a.request("GET", "https://api.igdb.com/v4/webhooks/", "")
|
resp, err := a.request(ctx, "GET", "https://api.igdb.com/v4/webhooks/", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to make request: %w", err)
|
return nil, fmt.Errorf("failed to make request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -88,8 +89,8 @@ func (a *Webhooks) List() ([]*WebhookResponse, error) {
|
|||||||
return data, nil
|
return data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Webhooks) Get(webhookId uint64) (*WebhookResponse, error) {
|
func (a *Webhooks) Get(ctx context.Context, webhookId uint64) (*WebhookResponse, error) {
|
||||||
resp, err := a.request("GET", fmt.Sprintf("https://api.igdb.com/v4/webhooks/%v", webhookId), "")
|
resp, err := a.request(ctx, "GET", fmt.Sprintf("https://api.igdb.com/v4/webhooks/%v", webhookId), "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to make request: %w", err)
|
return nil, fmt.Errorf("failed to make request: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type WebsiteTypes struct {
|
|||||||
|
|
||||||
func NewWebsiteTypes(request RequestFunc) *WebsiteTypes {
|
func NewWebsiteTypes(request RequestFunc) *WebsiteTypes {
|
||||||
a := &WebsiteTypes{
|
a := &WebsiteTypes{
|
||||||
BaseEndpoint[pb.WebsiteType]{
|
BaseEndpoint: BaseEndpoint[pb.WebsiteType]{
|
||||||
endpointName: EPWebsiteTypes,
|
endpointName: EPWebsiteTypes,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewWebsiteTypes(request RequestFunc) *WebsiteTypes {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *WebsiteTypes) Query(query string) ([]*pb.WebsiteType, error) {
|
func (a *WebsiteTypes) Query(ctx context.Context, query string) ([]*pb.WebsiteType, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *WebsiteTypes) Query(query string) ([]*pb.WebsiteType, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Websitetypes) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Websitetypes, nil
|
return data.Websitetypes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "git.nite07.com/nite/go-igdb/proto"
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
@@ -14,7 +15,7 @@ type Websites struct {
|
|||||||
|
|
||||||
func NewWebsites(request RequestFunc) *Websites {
|
func NewWebsites(request RequestFunc) *Websites {
|
||||||
a := &Websites{
|
a := &Websites{
|
||||||
BaseEndpoint[pb.Website]{
|
BaseEndpoint: BaseEndpoint[pb.Website]{
|
||||||
endpointName: EPWebsites,
|
endpointName: EPWebsites,
|
||||||
request: request,
|
request: request,
|
||||||
},
|
},
|
||||||
@@ -23,8 +24,8 @@ func NewWebsites(request RequestFunc) *Websites {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Websites) Query(query string) ([]*pb.Website, error) {
|
func (a *Websites) Query(ctx context.Context, query string) ([]*pb.Website, error) {
|
||||||
resp, err := a.request("POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to request: %w", err)
|
return nil, fmt.Errorf("failed to request: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,9 +35,5 @@ func (a *Websites) Query(query string) ([]*pb.Website, error) {
|
|||||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(data.Websites) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results: %s", query)
|
|
||||||
}
|
|
||||||
|
|
||||||
return data.Websites, nil
|
return data.Websites, nil
|
||||||
}
|
}
|
||||||
|
|||||||
40
go.mod
40
go.mod
@@ -1,27 +1,41 @@
|
|||||||
module github.com/bestnite/go-igdb
|
module git.nite07.com/nite/go-igdb
|
||||||
|
|
||||||
go 1.24.1
|
go 1.24.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
git.nite07.com/nite/go-flaresolverr v1.0.1
|
||||||
github.com/PuerkitoBio/goquery v1.10.2
|
github.com/PuerkitoBio/goquery v1.10.2
|
||||||
github.com/bestnite/go-flaresolverr v0.0.0-20250404141941-4644c2e66727
|
|
||||||
github.com/go-resty/resty/v2 v2.16.5
|
github.com/go-resty/resty/v2 v2.16.5
|
||||||
|
golang.org/x/time v0.14.0
|
||||||
google.golang.org/protobuf v1.36.6
|
google.golang.org/protobuf v1.36.6
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Danny-Dasilva/CycleTLS/cycletls v1.0.26 // indirect
|
github.com/Danny-Dasilva/CycleTLS/cycletls v1.0.30 // indirect
|
||||||
github.com/Danny-Dasilva/fhttp v0.0.0-20240217042913-eeeb0b347ce1 // indirect
|
github.com/Danny-Dasilva/fhttp v0.0.0-20240217042913-eeeb0b347ce1 // indirect
|
||||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
github.com/andybalholm/brotli v1.2.0 // indirect
|
||||||
github.com/andybalholm/cascadia v1.3.3 // indirect
|
github.com/andybalholm/cascadia v1.3.3 // indirect
|
||||||
github.com/cloudflare/circl v1.3.7 // indirect
|
github.com/gaukas/clienthellod v0.4.2 // indirect
|
||||||
github.com/gorilla/websocket v1.5.1 // indirect
|
github.com/gaukas/godicttls v0.0.4 // indirect
|
||||||
github.com/klauspost/compress v1.17.6 // indirect
|
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
|
||||||
github.com/quic-go/quic-go v0.41.0 // indirect
|
github.com/google/gopacket v1.1.19 // indirect
|
||||||
github.com/refraction-networking/utls v1.6.2 // indirect
|
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 // indirect
|
||||||
golang.org/x/crypto v0.33.0 // indirect
|
github.com/gorilla/websocket v1.5.3 // indirect
|
||||||
golang.org/x/net v0.35.0 // indirect
|
github.com/klauspost/compress v1.18.1 // indirect
|
||||||
golang.org/x/sys v0.30.0 // indirect
|
github.com/onsi/ginkgo/v2 v2.23.4 // indirect
|
||||||
golang.org/x/text v0.22.0 // indirect
|
github.com/quic-go/qpack v0.5.1 // indirect
|
||||||
|
github.com/quic-go/quic-go v0.55.0 // indirect
|
||||||
|
github.com/refraction-networking/uquic v0.0.6 // indirect
|
||||||
|
github.com/refraction-networking/utls v1.8.1 // indirect
|
||||||
|
go.uber.org/automaxprocs v1.6.0 // indirect
|
||||||
|
go.uber.org/mock v0.5.2 // indirect
|
||||||
|
golang.org/x/crypto v0.43.0 // indirect
|
||||||
|
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 // indirect
|
||||||
|
golang.org/x/mod v0.28.0 // indirect
|
||||||
|
golang.org/x/net v0.46.0 // indirect
|
||||||
|
golang.org/x/sync v0.17.0 // indirect
|
||||||
|
golang.org/x/sys v0.37.0 // indirect
|
||||||
|
golang.org/x/text v0.30.0 // indirect
|
||||||
|
golang.org/x/tools v0.37.0 // indirect
|
||||||
h12.io/socks v1.0.3 // indirect
|
h12.io/socks v1.0.3 // indirect
|
||||||
)
|
)
|
||||||
|
|||||||
102
go.sum
102
go.sum
@@ -7,22 +7,22 @@ dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBr
|
|||||||
dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4=
|
dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4=
|
||||||
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
|
dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU=
|
||||||
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
||||||
|
git.nite07.com/nite/go-flaresolverr v1.0.1 h1:fTnfQnoilxZDVXgVr/ThtPYo2VCwY9pr5iEXvdePoAU=
|
||||||
|
git.nite07.com/nite/go-flaresolverr v1.0.1/go.mod h1:KXW66g+K5Q9ind4nYurf0Cg5IcMbaSISkJ6cB5cGdZU=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/Danny-Dasilva/CycleTLS/cycletls v1.0.26 h1:6fexoGmvzoXMSk14BZ0AirapVm5c3KUsEjE0jLlVKi8=
|
github.com/Danny-Dasilva/CycleTLS/cycletls v1.0.30 h1:MUrYvIPkb4D83p16LKt7csGjhAF2JIeCdjtzhjm7doY=
|
||||||
github.com/Danny-Dasilva/CycleTLS/cycletls v1.0.26/go.mod h1:QFi/EVO7qqru3Ftxz1LR+96jIc91Tifv0DnskF/gWQ8=
|
github.com/Danny-Dasilva/CycleTLS/cycletls v1.0.30/go.mod h1:uLgl93R8am9dUvj+9pAI3pTwsmRKmFeWzz3eaN9HrQw=
|
||||||
github.com/Danny-Dasilva/fhttp v0.0.0-20240217042913-eeeb0b347ce1 h1:/lqhaiz7xdPr6kuaW1tQ/8DdpWdxkdyd9W/6EHz4oRw=
|
github.com/Danny-Dasilva/fhttp v0.0.0-20240217042913-eeeb0b347ce1 h1:/lqhaiz7xdPr6kuaW1tQ/8DdpWdxkdyd9W/6EHz4oRw=
|
||||||
github.com/Danny-Dasilva/fhttp v0.0.0-20240217042913-eeeb0b347ce1/go.mod h1:Hvab/V/YKCDXsEpKYKHjAXH5IFOmoq9FsfxjztEqvDc=
|
github.com/Danny-Dasilva/fhttp v0.0.0-20240217042913-eeeb0b347ce1/go.mod h1:Hvab/V/YKCDXsEpKYKHjAXH5IFOmoq9FsfxjztEqvDc=
|
||||||
github.com/PuerkitoBio/goquery v1.10.2 h1:7fh2BdHcG6VFZsK7toXBT/Bh1z5Wmy8Q9MV9HqT2AM8=
|
github.com/PuerkitoBio/goquery v1.10.2 h1:7fh2BdHcG6VFZsK7toXBT/Bh1z5Wmy8Q9MV9HqT2AM8=
|
||||||
github.com/PuerkitoBio/goquery v1.10.2/go.mod h1:0guWGjcLu9AYC7C1GHnpysHy056u9aEkUHwhdnePMCU=
|
github.com/PuerkitoBio/goquery v1.10.2/go.mod h1:0guWGjcLu9AYC7C1GHnpysHy056u9aEkUHwhdnePMCU=
|
||||||
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||||
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
|
||||||
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
|
||||||
github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM=
|
github.com/andybalholm/cascadia v1.3.3 h1:AG2YHrzJIm4BZ19iwJ/DAua6Btl3IwJX+VI4kktS1LM=
|
||||||
github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=
|
github.com/andybalholm/cascadia v1.3.3/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=
|
||||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||||
github.com/bestnite/go-flaresolverr v0.0.0-20250404141941-4644c2e66727 h1:F1fNb9j7wgPXa54SWAIYn1l8NJTg74Qx3EJ8qmys6FY=
|
|
||||||
github.com/bestnite/go-flaresolverr v0.0.0-20250404141941-4644c2e66727/go.mod h1:LX2oPIfG4LnUtQ7FAWV727IXuODZVbzRwG/7t2KdMNo=
|
|
||||||
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
|
||||||
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s=
|
||||||
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
|
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
|
||||||
@@ -31,28 +31,32 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P
|
|||||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||||
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
|
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
|
||||||
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
|
|
||||||
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
|
|
||||||
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||||
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
|
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
|
||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||||
|
github.com/gaukas/clienthellod v0.4.2 h1:LPJ+LSeqt99pqeCV4C0cllk+pyWmERisP7w6qWr7eqE=
|
||||||
|
github.com/gaukas/clienthellod v0.4.2/go.mod h1:M57+dsu0ZScvmdnNxaxsDPM46WhSEdPYAOdNgfL7IKA=
|
||||||
|
github.com/gaukas/godicttls v0.0.4 h1:NlRaXb3J6hAnTmWdsEKb9bcSBD6BvcIjdGdeb0zfXbk=
|
||||||
github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI=
|
github.com/gaukas/godicttls v0.0.4/go.mod h1:l6EenT4TLWgTdwslVb4sEMOCf7Bv0JAK67deKr9/NCI=
|
||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||||
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
||||||
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||||
github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ=
|
|
||||||
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||||
|
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
|
||||||
|
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||||
github.com/go-resty/resty/v2 v2.16.5 h1:hBKqmWrr7uRc3euHVqmh1HTHcKn99Smr7o5spptdhTM=
|
github.com/go-resty/resty/v2 v2.16.5 h1:hBKqmWrr7uRc3euHVqmh1HTHcKn99Smr7o5spptdhTM=
|
||||||
github.com/go-resty/resty/v2 v2.16.5/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ07xAwp/fiA=
|
github.com/go-resty/resty/v2 v2.16.5/go.mod h1:hkJtXbA2iKHzJheXYvQ8snQES5ZLGKMwQ07xAwp/fiA=
|
||||||
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
|
||||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
|
|
||||||
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
|
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
|
||||||
|
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
|
||||||
|
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
|
||||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
|
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
|
||||||
@@ -78,19 +82,23 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||||
|
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||||
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
|
||||||
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||||
|
github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8=
|
||||||
|
github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo=
|
||||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||||
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
|
|
||||||
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
|
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 h1:xhMrHhTJ6zxu3gA4enFM9MLn9AY7613teCdFnlUVbSQ=
|
||||||
|
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5/go.mod h1:5hDyRhoBCxViHszMt12TnOpEI4VVi+U8Gm9iphldiMA=
|
||||||
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
|
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg=
|
github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg=
|
||||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||||
github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY=
|
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||||
github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
|
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
|
||||||
github.com/h12w/go-socks5 v0.0.0-20200522160539-76189e178364 h1:5XxdakFhqd9dnXoAZy1Mb2R/DZ6D1e+0bGC/JhucGYI=
|
github.com/h12w/go-socks5 v0.0.0-20200522160539-76189e178364 h1:5XxdakFhqd9dnXoAZy1Mb2R/DZ6D1e+0bGC/JhucGYI=
|
||||||
@@ -102,8 +110,8 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
|
|||||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||||
github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI=
|
github.com/klauspost/compress v1.18.1 h1:bcSGx7UbpBqMChDtsF28Lw6v/G94LPrrbMbdC3JH2co=
|
||||||
github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
github.com/klauspost/compress v1.18.1/go.mod h1:ZQFFVG+MdnR0P+l6wpXgIL4NTtwiKIdBnrBd8Nrxr+0=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
@@ -120,7 +128,6 @@ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI
|
|||||||
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
|
||||||
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||||
github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc=
|
|
||||||
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
|
github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
|
||||||
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
|
github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
|
||||||
github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
|
github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU=
|
||||||
@@ -134,8 +141,9 @@ github.com/onsi/ginkgo/v2 v2.8.1/go.mod h1:N1/NbDngAFcSLdyZ+/aYTYGSlq9qMCS/cNKGJ
|
|||||||
github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxmrTcxyk=
|
github.com/onsi/ginkgo/v2 v2.9.0/go.mod h1:4xkjoL/tZv4SMWeww56BU5kAt19mVB47gTWxmrTcxyk=
|
||||||
github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo=
|
github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo=
|
||||||
github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=
|
github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts=
|
||||||
github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q=
|
|
||||||
github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
|
github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k=
|
||||||
|
github.com/onsi/ginkgo/v2 v2.23.4 h1:ktYTpKJAVZnDT4VjxSbiBenUjmlL/5QkBEocaWXiQus=
|
||||||
|
github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOTusL46e8=
|
||||||
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||||
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||||
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
||||||
@@ -149,25 +157,33 @@ github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdM
|
|||||||
github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw=
|
github.com/onsi/gomega v1.27.1/go.mod h1:aHX5xOykVYzWOV4WqQy0sy8BQptgukenXpCXfadcIAw=
|
||||||
github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw=
|
github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw=
|
||||||
github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ=
|
github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ=
|
||||||
github.com/onsi/gomega v1.27.6 h1:ENqfyGeS5AX/rlXDd/ETokDz93u0YufY1Pgxuy/PvWE=
|
|
||||||
github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
|
github.com/onsi/gomega v1.27.6/go.mod h1:PIQNjfQwkP3aQAH7lf7j87O/5FiNr+ZR8+ipb+qQlhg=
|
||||||
|
github.com/onsi/gomega v1.36.3 h1:hID7cr8t3Wp26+cYnfcjR6HpJ00fdogN6dqZ1t6IylU=
|
||||||
|
github.com/onsi/gomega v1.36.3/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0=
|
||||||
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
|
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
|
||||||
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc=
|
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc=
|
||||||
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
|
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
|
||||||
|
github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U=
|
||||||
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||||
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
|
||||||
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
|
||||||
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||||
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
|
github.com/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
|
||||||
|
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
|
||||||
|
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
|
||||||
github.com/quic-go/qtls-go1-20 v0.3.1/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k=
|
github.com/quic-go/qtls-go1-20 v0.3.1/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k=
|
||||||
github.com/quic-go/quic-go v0.37.4/go.mod h1:YsbH1r4mSHPJcLF4k4zruUkLBqctEMBDR6VPvcYjIsU=
|
github.com/quic-go/quic-go v0.37.4/go.mod h1:YsbH1r4mSHPJcLF4k4zruUkLBqctEMBDR6VPvcYjIsU=
|
||||||
github.com/quic-go/quic-go v0.41.0 h1:aD8MmHfgqTURWNJy48IYFg2OnxwHT3JL7ahGs73lb4k=
|
github.com/quic-go/quic-go v0.55.0 h1:zccPQIqYCXDt5NmcEabyYvOnomjs8Tlwl7tISjJh9Mk=
|
||||||
github.com/quic-go/quic-go v0.41.0/go.mod h1:qCkNjqczPEvgsOnxZ0eCD14lv+B2LHlFAB++CNOh9hA=
|
github.com/quic-go/quic-go v0.55.0/go.mod h1:DR51ilwU1uE164KuWXhinFcKWGlEjzys2l8zUl5Ss1U=
|
||||||
|
github.com/refraction-networking/uquic v0.0.6 h1:9ol1oOaOpHDeeDlBY7u228jK+T5oic35QrFimHVaCMM=
|
||||||
|
github.com/refraction-networking/uquic v0.0.6/go.mod h1:TFgTmV/yqVCMEXVwP7z7PMAhzye02rFHLV6cRAg59jc=
|
||||||
github.com/refraction-networking/utls v1.5.4/go.mod h1:SPuDbBmgLGp8s+HLNc83FuavwZCFoMmExj+ltUHiHUw=
|
github.com/refraction-networking/utls v1.5.4/go.mod h1:SPuDbBmgLGp8s+HLNc83FuavwZCFoMmExj+ltUHiHUw=
|
||||||
github.com/refraction-networking/utls v1.6.2 h1:iTeeGY0o6nMNcGyirxkD5bFIsVctP5InGZ3E0HrzS7k=
|
github.com/refraction-networking/utls v1.8.1 h1:yNY1kapmQU8JeM1sSw2H2asfTIwWxIkrMJI0pRUOCAo=
|
||||||
github.com/refraction-networking/utls v1.6.2/go.mod h1:yil9+7qSl+gBwJqztoQseO6Pr3h62pQoY1lXiNR/FPs=
|
github.com/refraction-networking/utls v1.8.1/go.mod h1:jkSOEkLqn+S/jtpEHPOsVv/4V4EVnelwbMQl4vCWXAM=
|
||||||
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||||
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
|
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
|
||||||
@@ -198,14 +214,22 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
|
|||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA=
|
||||||
github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU=
|
github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU=
|
||||||
github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
|
github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
|
||||||
|
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=
|
||||||
|
github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E=
|
||||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||||
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
|
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
|
||||||
|
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
|
||||||
|
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
|
||||||
|
go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
|
||||||
|
go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
|
||||||
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
|
go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE=
|
||||||
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
|
golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw=
|
||||||
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
@@ -222,13 +246,17 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY
|
|||||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||||
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||||
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
|
golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04=
|
||||||
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
|
golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
|
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
|
||||||
|
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792 h1:R9PFI6EUdfVKgwKjZef7QIwGcBKu86OEFpJ9nUEP2l4=
|
||||||
|
golang.org/x/exp v0.0.0-20250718183923-645b1fa84792/go.mod h1:A+z0yzpGtvnG90cToK5n2tu8UJVP2XUATh+r+sfOOOc=
|
||||||
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||||
|
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
|
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
|
||||||
@@ -241,6 +269,8 @@ golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
|||||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||||
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||||
|
golang.org/x/mod v0.28.0 h1:gQBtGhjxykdjY9YhZpSlZIsbnaE2+PgjfLWUQTnoZ1U=
|
||||||
|
golang.org/x/mod v0.28.0/go.mod h1:yfB/L0NOf/kmEbXjzCPOx1iK1fRutOydrCMsqRhEBxI=
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
@@ -273,8 +303,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
|||||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||||
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
|
||||||
golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
|
golang.org/x/net v0.46.0 h1:giFlY12I07fugqwPuWJi68oOnpfqFnJIJzaIIm2JVV4=
|
||||||
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
|
golang.org/x/net v0.46.0/go.mod h1:Q9BGdFy1y4nkUwiLvT5qtyhAnEHgnQ/zd8PfU6nc210=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
@@ -294,6 +324,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
|||||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
|
golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug=
|
||||||
|
golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
@@ -330,8 +362,8 @@ golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|||||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
|
||||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||||
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
@@ -363,18 +395,19 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
|||||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||||
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k=
|
||||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM=
|
||||||
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
|
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||||
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
||||||
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
|
golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
|
||||||
@@ -385,8 +418,9 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
|||||||
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
|
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
|
||||||
golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
|
golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
|
||||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
|
|
||||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||||
|
golang.org/x/tools v0.37.0 h1:DVSRzp7FwePZW356yEAChSdNcQo6Nsp+fex1SUW09lE=
|
||||||
|
golang.org/x/tools v0.37.0/go.mod h1:MBN5QPQtLMHVdvsbtarmTNukZDdgwdwlO5qGacAzF0w=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
|||||||
5845
proto/igdbapi.pb.go
5845
proto/igdbapi.pb.go
File diff suppressed because it is too large
Load Diff
@@ -209,6 +209,19 @@ enum AgeRatingContentDescriptionCategoryEnum {
|
|||||||
CLASS_IND_ATOS_CRIMINOSOS = 85 [deprecated = true];
|
CLASS_IND_ATOS_CRIMINOSOS = 85 [deprecated = true];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message AgeRatingContentDescriptionTypeResult {
|
||||||
|
repeated AgeRatingContentDescriptionType ageratingcontentdescriptiontypes = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message AgeRatingContentDescriptionType {
|
||||||
|
uint64 id = 1;
|
||||||
|
string slug = 2;
|
||||||
|
string name = 3;
|
||||||
|
google.protobuf.Timestamp created_at = 4;
|
||||||
|
google.protobuf.Timestamp updated_at = 5;
|
||||||
|
string checksum = 6;
|
||||||
|
}
|
||||||
|
|
||||||
message AgeRatingContentDescriptionV2Result {
|
message AgeRatingContentDescriptionV2Result {
|
||||||
repeated AgeRatingContentDescriptionV2 ageratingcontentdescriptionsv2 = 1;
|
repeated AgeRatingContentDescriptionV2 ageratingcontentdescriptionsv2 = 1;
|
||||||
}
|
}
|
||||||
@@ -220,6 +233,7 @@ message AgeRatingContentDescriptionV2 {
|
|||||||
google.protobuf.Timestamp created_at = 4;
|
google.protobuf.Timestamp created_at = 4;
|
||||||
google.protobuf.Timestamp updated_at = 5;
|
google.protobuf.Timestamp updated_at = 5;
|
||||||
string checksum = 6;
|
string checksum = 6;
|
||||||
|
AgeRatingContentDescriptionType description_type = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AgeRatingOrganizationResult {
|
message AgeRatingOrganizationResult {
|
||||||
@@ -260,6 +274,20 @@ message Artwork {
|
|||||||
string url = 7;
|
string url = 7;
|
||||||
int32 width = 8;
|
int32 width = 8;
|
||||||
string checksum = 9;
|
string checksum = 9;
|
||||||
|
ArtworkType artwork_type = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ArtworkTypeResult {
|
||||||
|
repeated ArtworkType artworktypes = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ArtworkType {
|
||||||
|
uint64 id = 1;
|
||||||
|
string slug = 2;
|
||||||
|
string name = 3;
|
||||||
|
google.protobuf.Timestamp created_at = 4;
|
||||||
|
google.protobuf.Timestamp updated_at = 5;
|
||||||
|
string checksum = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CharacterResult {
|
message CharacterResult {
|
||||||
@@ -1342,6 +1370,7 @@ message ReleaseDate {
|
|||||||
ReleaseDateStatus status = 13;
|
ReleaseDateStatus status = 13;
|
||||||
DateFormat date_format = 14;
|
DateFormat date_format = 14;
|
||||||
ReleaseDateRegion release_region = 15;
|
ReleaseDateRegion release_region = 15;
|
||||||
|
int32 d = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ReleaseDateRegionResult {
|
message ReleaseDateRegionResult {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||||
|
|
||||||
wget https://api.igdb.com/v4/igdbapi.proto -O ./igdbapi.proto
|
wget https://api.igdb.com/v4/igdbapi.proto -O ./proto/igdbapi.proto
|
||||||
protoc --go_out=. --go_opt=Mproto/igdbapi.proto=/proto ./proto/igdbapi.proto
|
protoc --go_out=. --go_opt=Mproto/igdbapi.proto=/proto ./proto/igdbapi.proto
|
||||||
|
|||||||
@@ -1,48 +0,0 @@
|
|||||||
package igdb
|
|
||||||
|
|
||||||
import (
|
|
||||||
"sync"
|
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
type rateLimiter struct {
|
|
||||||
mu sync.Mutex
|
|
||||||
rate int
|
|
||||||
interval time.Duration
|
|
||||||
tokens int
|
|
||||||
lastRefill time.Time
|
|
||||||
}
|
|
||||||
|
|
||||||
func newRateLimiter(rate int) *rateLimiter {
|
|
||||||
return &rateLimiter{
|
|
||||||
rate: rate,
|
|
||||||
interval: time.Second,
|
|
||||||
tokens: rate,
|
|
||||||
lastRefill: time.Now(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *rateLimiter) wait() {
|
|
||||||
r.mu.Lock()
|
|
||||||
defer r.mu.Unlock()
|
|
||||||
|
|
||||||
now := time.Now()
|
|
||||||
elapsed := now.Sub(r.lastRefill)
|
|
||||||
|
|
||||||
if elapsed >= r.interval {
|
|
||||||
r.tokens = r.rate
|
|
||||||
r.lastRefill = now
|
|
||||||
}
|
|
||||||
|
|
||||||
if r.tokens <= 0 {
|
|
||||||
waitTime := r.interval - elapsed
|
|
||||||
r.mu.Unlock()
|
|
||||||
time.Sleep(waitTime)
|
|
||||||
r.mu.Lock()
|
|
||||||
r.tokens = r.rate - 1
|
|
||||||
r.lastRefill = time.Now()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
r.tokens--
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package igdb
|
package igdb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/bestnite/go-igdb/endpoint"
|
"git.nite07.com/nite/go-igdb/endpoint"
|
||||||
)
|
)
|
||||||
|
|
||||||
func registerAllEndpoints(c *Client) {
|
func registerAllEndpoints(c *Client) {
|
||||||
|
|||||||
26
request.go
26
request.go
@@ -7,23 +7,19 @@ import (
|
|||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var client *resty.Client
|
type SilentLogger struct{}
|
||||||
|
|
||||||
func init() {
|
func (s SilentLogger) Errorf(string, ...any) {}
|
||||||
client = resty.New()
|
func (s SilentLogger) Warnf(string, ...any) {}
|
||||||
client.SetRetryCount(3).SetRetryWaitTime(3 * time.Second).AddRetryCondition(
|
func (s SilentLogger) Debugf(string, ...any) {}
|
||||||
|
|
||||||
|
func NewRestyClient() *resty.Client {
|
||||||
|
return resty.New().SetRetryCount(10).SetRetryWaitTime(3 * time.Second).AddRetryCondition(
|
||||||
func(r *resty.Response, err error) bool {
|
func(r *resty.Response, err error) bool {
|
||||||
return err != nil || r.StatusCode() == http.StatusTooManyRequests
|
if err != nil || r.StatusCode() == http.StatusTooManyRequests {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
func request() *resty.Request {
|
|
||||||
return client.R().SetLogger(disableLogger{}).SetHeader("Accept-Charset", "utf-8").SetHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0")
|
|
||||||
}
|
|
||||||
|
|
||||||
type disableLogger struct{}
|
|
||||||
|
|
||||||
func (d disableLogger) Errorf(string, ...interface{}) {}
|
|
||||||
func (d disableLogger) Warnf(string, ...interface{}) {}
|
|
||||||
func (d disableLogger) Debugf(string, ...interface{}) {}
|
|
||||||
|
|||||||
15
token.go
15
token.go
@@ -1,31 +1,32 @@
|
|||||||
package igdb
|
package igdb
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TwitchToken struct {
|
type twitchToken struct {
|
||||||
clientID string
|
clientID string
|
||||||
clientSecret string
|
clientSecret string
|
||||||
token string
|
token string
|
||||||
expires time.Time
|
expires time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTwitchToken(clientID, clientSecret string) *TwitchToken {
|
func newTwitchToken(clientID, clientSecret string) *twitchToken {
|
||||||
return &TwitchToken{
|
return &twitchToken{
|
||||||
clientID: clientID,
|
clientID: clientID,
|
||||||
clientSecret: clientSecret,
|
clientSecret: clientSecret,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TwitchToken) getToken() (string, error) {
|
func (t *twitchToken) GetToken(ctx context.Context) (string, error) {
|
||||||
if t.token != "" && time.Now().Before(t.expires) {
|
if t.token != "" && time.Now().Before(t.expires) {
|
||||||
return t.token, nil
|
return t.token, nil
|
||||||
}
|
}
|
||||||
token, expires, err := t.loginTwitch()
|
token, expires, err := t.LoginTwitch(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("failed to login twitch: %w", err)
|
return "", fmt.Errorf("failed to login twitch: %w", err)
|
||||||
}
|
}
|
||||||
@@ -34,7 +35,7 @@ func (t *TwitchToken) getToken() (string, error) {
|
|||||||
return token, nil
|
return token, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TwitchToken) loginTwitch() (string, time.Duration, error) {
|
func (t *twitchToken) LoginTwitch(ctx context.Context) (string, time.Duration, error) {
|
||||||
baseURL, _ := url.Parse("https://id.twitch.tv/oauth2/token")
|
baseURL, _ := url.Parse("https://id.twitch.tv/oauth2/token")
|
||||||
params := url.Values{}
|
params := url.Values{}
|
||||||
params.Add("client_id", t.clientID)
|
params.Add("client_id", t.clientID)
|
||||||
@@ -42,7 +43,7 @@ func (t *TwitchToken) loginTwitch() (string, time.Duration, error) {
|
|||||||
params.Add("grant_type", "client_credentials")
|
params.Add("grant_type", "client_credentials")
|
||||||
baseURL.RawQuery = params.Encode()
|
baseURL.RawQuery = params.Encode()
|
||||||
|
|
||||||
resp, err := request().SetHeader("User-Agent", "").Post(baseURL.String())
|
resp, err := NewRestyClient().R().SetContext(ctx).SetHeader("User-Agent", "").Post(baseURL.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", 0, fmt.Errorf("failed to make request: %s: %w", baseURL.String(), err)
|
return "", 0, fmt.Errorf("failed to make request: %s: %w", baseURL.String(), err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user