Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
0ba1e8da92
|
|||
|
03abf3b30d
|
|||
| a7780a891d | |||
| 06a9c87722 | |||
| aaf697a005 | |||
| 7ef9cb37e6 | |||
| 87afdc63b8 | |||
| b99d06a2de | |||
| 4b6f488f59 | |||
| 3df648929d | |||
| 5cb4ab4c61 | |||
| ecf81bcf79 | |||
| cf1f68c2d8 | |||
| fb58744928 | |||
| 3d28910178 | |||
| a583940e21 | |||
| 194e84c258 | |||
| a8e650e4d7 | |||
| f88ba544c2 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
*test.go
|
||||
test/
|
||||
.vscode/
|
||||
.idea/
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Nite
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
41
README.md
41
README.md
@@ -14,7 +14,7 @@ A Go client library for the IGDB (Internet Game Database) API v4. This library p
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
go get github.com/bestnite/go-igdb
|
||||
go get git.nite07.com/nite/go-igdb
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
@@ -25,12 +25,11 @@ package main
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/bestnite/go-igdb"
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
"git.nite07.com/nite/go-igdb"
|
||||
)
|
||||
|
||||
func Test1(c *igdb.Client) {
|
||||
game, err := igdb.GetItemByID[pb.Game](1942, c.Games.Query)
|
||||
game, err := c.Games.GetByID(1942)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -38,7 +37,7 @@ func Test1(c *igdb.Client) {
|
||||
}
|
||||
|
||||
func Test2(c *igdb.Client) {
|
||||
games, err := igdb.GetItemsByIDs[pb.Game]([]uint64{119171, 119133}, c.Games.Query)
|
||||
games, err := c.Games.GetByIDs([]uint64{119171, 119133})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -46,7 +45,7 @@ func Test2(c *igdb.Client) {
|
||||
}
|
||||
|
||||
func Test3(c *igdb.Client) {
|
||||
total, err := igdb.GetItemsLength[pb.Game](c.Games.Query)
|
||||
total, err := c.Games.Count()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -54,7 +53,7 @@ func Test3(c *igdb.Client) {
|
||||
}
|
||||
|
||||
func Test4(c *igdb.Client) {
|
||||
games, err := igdb.GetItemsPagniated[pb.Game](0, 10, c.Games.Query)
|
||||
games, err := c.Games.Paginated(0, 10)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -65,15 +64,15 @@ func Test4(c *igdb.Client) {
|
||||
}
|
||||
|
||||
func Test5(c *igdb.Client) {
|
||||
game, err := igdb.AssertSingle[pb.Game](c.Games.Query("fields name,rating; sort rating desc; limit 1;"))
|
||||
game, err := c.Games.Query("fields name,rating; sort rating desc; limit 1;")
|
||||
if err != nil {
|
||||
log.Fatalf("failed to get game: %s", err)
|
||||
}
|
||||
log.Printf("Name of first game with highest rating: %s\n", game.Name)
|
||||
log.Printf("Name of first game with highest rating: %s\n", game[0].Name)
|
||||
}
|
||||
|
||||
func Test6(c *igdb.Client) {
|
||||
games, err := igdb.AssertSlice[pb.Game](c.Games.Query("fields *; where rating > 70; limit 10;"))
|
||||
games, err := c.Games.Query("fields *; where rating > 70; limit 10;")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -94,21 +93,21 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
## Advanced Usage
|
||||
## Example Projects
|
||||
|
||||
### Using with FlareSolverr
|
||||
- [igdb-database](https://github.com/bestnite/igdb-database)
|
||||
|
||||
```go
|
||||
import "github.com/bestnite/go-flaresolverr"
|
||||
## Dependencies
|
||||
|
||||
flaresolverr := flaresolverr.New("http://localhost:8191")
|
||||
client := igdb.NewWithFlaresolverr("your-client-id", "your-client-secret", flaresolverr)
|
||||
```
|
||||
|
||||
### Rate Limiting
|
||||
|
||||
The client automatically handles rate limiting with a default of 4 requests per second. This helps prevent hitting IGDB's rate limits.
|
||||
- [go-resty/resty](https://github.com/go-resty/resty)
|
||||
- [google/protobuf](https://github.com/google/protobuf)
|
||||
- [bestnite/go-flaresolverr](https://github.com/bestnite/go-flaresolverr)
|
||||
- [PuerkitoBio/goquery](https://github.com/PuerkitoBio/goquery)
|
||||
|
||||
## Contributing
|
||||
|
||||
Contributions are welcome! Please feel free to submit a Pull Request.
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
||||
|
||||
41
assert.go
41
assert.go
@@ -1,41 +0,0 @@
|
||||
package igdb
|
||||
|
||||
import "fmt"
|
||||
|
||||
func AssertSingle[T any](data any, err error) (*T, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if data == nil {
|
||||
return nil, fmt.Errorf("data is nil")
|
||||
}
|
||||
|
||||
datas, ok := data.([]*T)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("failed to convert to []*T")
|
||||
}
|
||||
|
||||
if len(datas) == 0 {
|
||||
return nil, fmt.Errorf("no results")
|
||||
}
|
||||
|
||||
return datas[0], nil
|
||||
}
|
||||
|
||||
func AssertSlice[T any](data any, err error) ([]*T, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if data == nil {
|
||||
return nil, fmt.Errorf("data is nil")
|
||||
}
|
||||
|
||||
datas, ok := data.([]*T)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("failed to convert to []*T")
|
||||
}
|
||||
|
||||
return datas, nil
|
||||
}
|
||||
103
client.go
103
client.go
@@ -1,11 +1,13 @@
|
||||
package igdb
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/bestnite/go-flaresolverr"
|
||||
"github.com/bestnite/go-igdb/endpoint"
|
||||
"git.nite07.com/nite/go-flaresolverr"
|
||||
"git.nite07.com/nite/go-igdb/endpoint"
|
||||
"golang.org/x/time/rate"
|
||||
|
||||
"github.com/go-resty/resty/v2"
|
||||
)
|
||||
@@ -14,9 +16,8 @@ type Client struct {
|
||||
clientID string
|
||||
token *twitchToken
|
||||
flaresolverr *flaresolverr.Flaresolverr
|
||||
limiter *rateLimiter
|
||||
|
||||
EntityEndpoints map[endpoint.EndpointName]endpoint.EntityEndpoint
|
||||
restyClient *resty.Client
|
||||
limiter *rate.Limiter
|
||||
|
||||
AgeRatingCategories *endpoint.AgeRatingCategories
|
||||
AgeRatingContentDescriptions *endpoint.AgeRatingContentDescriptions
|
||||
@@ -94,104 +95,48 @@ type Client struct {
|
||||
func New(clientID, clientSecret string) *Client {
|
||||
c := &Client{
|
||||
clientID: clientID,
|
||||
limiter: newRateLimiter(4),
|
||||
token: NewTwitchToken(clientID, clientSecret),
|
||||
restyClient: NewRestyClient(),
|
||||
token: newTwitchToken(clientID, clientSecret),
|
||||
flaresolverr: nil,
|
||||
EntityEndpoints: make(map[endpoint.EndpointName]endpoint.EntityEndpoint),
|
||||
limiter: rate.NewLimiter(rate.Limit(4), 4),
|
||||
}
|
||||
|
||||
registerAllEndpoints(c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type RequestFunc func(method string, URL string, dataBody any) (*resty.Response, error)
|
||||
|
||||
func NewWithFlaresolverr(clientID, clientSecret string, f *flaresolverr.Flaresolverr) *Client {
|
||||
c := New(clientID, clientSecret)
|
||||
c.flaresolverr = f
|
||||
return c
|
||||
}
|
||||
|
||||
func (g *Client) Request(URL string, dataBody any) (*resty.Response, error) {
|
||||
g.limiter.wait()
|
||||
func (g *Client) Request(ctx context.Context, method string, requestURL string, dataBody any) (*resty.Response, error) {
|
||||
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 {
|
||||
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,
|
||||
"Authorization": "Bearer " + t,
|
||||
"User-Agent": "",
|
||||
"Content-Type": "text/plain",
|
||||
}).Post(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 {
|
||||
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
|
||||
}
|
||||
|
||||
func GetItemsPagniated[T any](offset, limit int, f func(string) ([]*T, error)) ([]*T, error) {
|
||||
query := fmt.Sprintf("offset %d; limit %d; f *; sort id asc;", offset, limit)
|
||||
items, err := f(query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return items, nil
|
||||
}
|
||||
|
||||
func GetItemsLength[T any](f func(string) ([]*T, error)) (uint64, error) {
|
||||
query := "fields id; sort id desc; limit 1;"
|
||||
items, err := f(query)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
if len(items) == 0 {
|
||||
return 0, fmt.Errorf("no results: %s", query)
|
||||
}
|
||||
|
||||
type Iid interface {
|
||||
GetId() uint64
|
||||
}
|
||||
|
||||
item, ok := any(items[0]).(Iid)
|
||||
|
||||
if !ok {
|
||||
return 0, fmt.Errorf("failed to convert")
|
||||
}
|
||||
|
||||
return item.GetId(), nil
|
||||
}
|
||||
|
||||
func GetItemByID[T any](id uint64, f func(string) ([]*T, error)) (*T, error) {
|
||||
query := fmt.Sprintf("where id = %d; fields *;", id)
|
||||
items, err := f(query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if len(items) == 0 {
|
||||
return nil, fmt.Errorf("no results: %s", query)
|
||||
}
|
||||
|
||||
return items[0], nil
|
||||
}
|
||||
|
||||
func GetItemsByIDs[T any](ids []uint64, f func(string) ([]*T, error)) ([]*T, error) {
|
||||
idStrSlice := make([]string, len(ids))
|
||||
for i, id := range ids {
|
||||
idStrSlice[i] = fmt.Sprintf("%d", id)
|
||||
}
|
||||
|
||||
idStr := fmt.Sprintf(`where id = (%s); fields *;`, strings.Join(idStrSlice, ","))
|
||||
|
||||
items, err := f(idStr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return items, nil
|
||||
}
|
||||
|
||||
@@ -1,19 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type AgeRatingCategories struct {
|
||||
BaseEndpoint
|
||||
BaseEndpoint[pb.AgeRatingCategory]
|
||||
}
|
||||
|
||||
func (a *AgeRatingCategories) Query(query string) ([]*pb.AgeRatingCategory, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/age_rating_categories.pb", query)
|
||||
func NewAgeRatingCategories(request RequestFunc) *AgeRatingCategories {
|
||||
a := &AgeRatingCategories{
|
||||
BaseEndpoint: BaseEndpoint[pb.AgeRatingCategory]{
|
||||
endpointName: EPAgeRatingCategories,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *AgeRatingCategories) Query(ctx context.Context, query string) ([]*pb.AgeRatingCategory, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -23,9 +35,5 @@ func (a *AgeRatingCategories) Query(query string) ([]*pb.AgeRatingCategory, erro
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,19 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type AgeRatingContentDescriptions struct {
|
||||
BaseEndpoint
|
||||
BaseEndpoint[pb.AgeRatingContentDescription]
|
||||
}
|
||||
|
||||
func (a *AgeRatingContentDescriptions) Query(query string) ([]*pb.AgeRatingContentDescription, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/age_rating_content_descriptions.pb", query)
|
||||
func NewAgeRatingContentDescriptions(request RequestFunc) *AgeRatingContentDescriptions {
|
||||
a := &AgeRatingContentDescriptions{
|
||||
BaseEndpoint[pb.AgeRatingContentDescription]{
|
||||
endpointName: EPAgeRatingContentDescriptions,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *AgeRatingContentDescriptions) Query(ctx context.Context, query string) ([]*pb.AgeRatingContentDescription, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -23,9 +35,5 @@ func (a *AgeRatingContentDescriptions) Query(query string) ([]*pb.AgeRatingConte
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,19 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type AgeRatingContentDescriptionsV2 struct {
|
||||
BaseEndpoint
|
||||
BaseEndpoint[pb.AgeRatingContentDescriptionV2]
|
||||
}
|
||||
|
||||
func (a *AgeRatingContentDescriptionsV2) Query(query string) ([]*pb.AgeRatingContentDescriptionV2, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/age_rating_content_descriptions_v2.pb", query)
|
||||
func NewAgeRatingContentDescriptionsV2(request RequestFunc) *AgeRatingContentDescriptionsV2 {
|
||||
a := &AgeRatingContentDescriptionsV2{
|
||||
BaseEndpoint[pb.AgeRatingContentDescriptionV2]{
|
||||
endpointName: EPAgeRatingContentDescriptionsV2,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *AgeRatingContentDescriptionsV2) Query(ctx context.Context, query string) ([]*pb.AgeRatingContentDescriptionV2, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -23,9 +35,5 @@ func (a *AgeRatingContentDescriptionsV2) Query(query string) ([]*pb.AgeRatingCon
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type AgeRatingOrganizations struct{ BaseEndpoint }
|
||||
type AgeRatingOrganizations struct {
|
||||
BaseEndpoint[pb.AgeRatingOrganization]
|
||||
}
|
||||
|
||||
func (a *AgeRatingOrganizations) Query(query string) ([]*pb.AgeRatingOrganization, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/age_rating_organizations.pb", query)
|
||||
func NewAgeRatingOrganizations(request RequestFunc) *AgeRatingOrganizations {
|
||||
a := &AgeRatingOrganizations{
|
||||
BaseEndpoint[pb.AgeRatingOrganization]{
|
||||
endpointName: EPAgeRatingOrganizations,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *AgeRatingOrganizations) Query(ctx context.Context, query string) ([]*pb.AgeRatingOrganization, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *AgeRatingOrganizations) Query(query string) ([]*pb.AgeRatingOrganizatio
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type AgeRatings struct{ BaseEndpoint }
|
||||
type AgeRatings struct {
|
||||
BaseEndpoint[pb.AgeRating]
|
||||
}
|
||||
|
||||
func (a *AgeRatings) Query(query string) ([]*pb.AgeRating, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/age_ratings.pb", query)
|
||||
func NewAgeRatings(request RequestFunc) *AgeRatings {
|
||||
a := &AgeRatings{
|
||||
BaseEndpoint[pb.AgeRating]{
|
||||
endpointName: EPAgeRatings,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *AgeRatings) Query(ctx context.Context, query string) ([]*pb.AgeRating, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *AgeRatings) Query(query string) ([]*pb.AgeRating, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type AlternativeNames struct{ BaseEndpoint }
|
||||
type AlternativeNames struct {
|
||||
BaseEndpoint[pb.AlternativeName]
|
||||
}
|
||||
|
||||
func (a *AlternativeNames) Query(query string) ([]*pb.AlternativeName, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/alternative_names.pb", query)
|
||||
func NewAlternativeNames(request RequestFunc) *AlternativeNames {
|
||||
a := &AlternativeNames{
|
||||
BaseEndpoint[pb.AlternativeName]{
|
||||
endpointName: EPAlternativeNames,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *AlternativeNames) Query(ctx context.Context, query string) ([]*pb.AlternativeName, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *AlternativeNames) Query(query string) ([]*pb.AlternativeName, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Artworks struct{ BaseEndpoint }
|
||||
type Artworks struct {
|
||||
BaseEndpoint[pb.Artwork]
|
||||
}
|
||||
|
||||
func (a *Artworks) Query(query string) ([]*pb.Artwork, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/artworks.pb", query)
|
||||
func NewArtworks(request RequestFunc) *Artworks {
|
||||
a := &Artworks{
|
||||
BaseEndpoint[pb.Artwork]{
|
||||
endpointName: EPArtworks,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Artworks) Query(ctx context.Context, query string) ([]*pb.Artwork, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Artworks) Query(query string) ([]*pb.Artwork, error) {
|
||||
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
|
||||
}
|
||||
|
||||
107
endpoint/base.go
107
endpoint/base.go
@@ -1,38 +1,105 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/go-resty/resty/v2"
|
||||
)
|
||||
|
||||
type BaseEndpoint struct {
|
||||
request func(URL string, dataBody any) (*resty.Response, error)
|
||||
endpointName EndpointName
|
||||
type RequestFunc func(ctx context.Context, method string, URL string, dataBody any) (*resty.Response, error)
|
||||
|
||||
type BaseEndpoint[T any] struct {
|
||||
request RequestFunc
|
||||
endpointName Name
|
||||
queryFunc func(context.Context, string) ([]*T, error)
|
||||
}
|
||||
|
||||
func NewBaseEndpoint(request func(URL string, dataBody any) (*resty.Response, error), endpointName EndpointName) *BaseEndpoint {
|
||||
return &BaseEndpoint{
|
||||
request: request,
|
||||
endpointName: endpointName,
|
||||
}
|
||||
}
|
||||
|
||||
func (b *BaseEndpoint) GetEndpointName() EndpointName {
|
||||
func (b *BaseEndpoint[T]) GetEndpointName() Name {
|
||||
return b.endpointName
|
||||
}
|
||||
|
||||
func (b *BaseEndpoint) Query(query string) (any, error) {
|
||||
return nil, nil
|
||||
func (b *BaseEndpoint[T]) Query(ctx context.Context, query string) ([]*T, error) {
|
||||
if b.queryFunc == nil {
|
||||
return nil, fmt.Errorf("query method must be implemented by specific endpoint")
|
||||
}
|
||||
return b.queryFunc(ctx, query)
|
||||
}
|
||||
|
||||
func (b *BaseEndpoint) QueryAny(query string) (any, error) {
|
||||
return b.Query(query)
|
||||
func (b *BaseEndpoint[T]) GetByID(ctx context.Context, id uint64) (*T, error) {
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
if len(res) == 0 {
|
||||
return nil, fmt.Errorf("no results")
|
||||
}
|
||||
return res[0], nil
|
||||
}
|
||||
|
||||
type Endpoint interface {
|
||||
GetEndpointName() EndpointName
|
||||
func (b *BaseEndpoint[T]) GetByIDs(ctx context.Context, ids []uint64) ([]*T, error) {
|
||||
if len(ids) == 0 {
|
||||
return []*T{}, nil
|
||||
}
|
||||
batches := make([][]uint64, 0)
|
||||
for i := 0; i < len(ids); i += 500 {
|
||||
end := min(i+500, len(ids))
|
||||
batches = append(batches, ids[i:end])
|
||||
}
|
||||
res := []*T{}
|
||||
for _, batch := range batches {
|
||||
builder := strings.Builder{}
|
||||
for i, v := range batch {
|
||||
if i > 0 {
|
||||
builder.WriteByte(',')
|
||||
}
|
||||
builder.WriteString(strconv.FormatUint(v, 10))
|
||||
}
|
||||
batchRes, err := b.Query(ctx, fmt.Sprintf("where id = (%s); fields *; limit 500;", builder.String()))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
res = append(res, batchRes...)
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
type EntityEndpoint interface {
|
||||
QueryAny(query string) (any, error)
|
||||
GetEndpointName() EndpointName
|
||||
func (b *BaseEndpoint[T]) Count(ctx context.Context) (uint64, error) {
|
||||
resp, err := b.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s/count.pb", b.endpointName), "")
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
|
||||
var res pb.Count
|
||||
if err = proto.Unmarshal(resp.Body(), &res); err != nil {
|
||||
return 0, fmt.Errorf("failed to unmarshal: %w", err)
|
||||
}
|
||||
|
||||
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(ctx context.Context, offset, limit uint64) ([]*T, error) {
|
||||
return b.Query(ctx, fmt.Sprintf("offset %d; limit %d; fields *; sort id asc;", offset, limit))
|
||||
}
|
||||
|
||||
type EntityEndpoint[T any] interface {
|
||||
GetEndpointName() Name
|
||||
Query(context.Context, string) ([]*T, error)
|
||||
GetByID(context.Context, uint64) (*T, error)
|
||||
GetByIDs(context.Context, []uint64) ([]*T, error)
|
||||
Count(context.Context) (uint64, error)
|
||||
Paginated(context.Context, uint64, uint64) ([]*T, error)
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CharacterGenders struct{ BaseEndpoint }
|
||||
type CharacterGenders struct {
|
||||
BaseEndpoint[pb.CharacterGender]
|
||||
}
|
||||
|
||||
func (a *CharacterGenders) Query(query string) ([]*pb.CharacterGender, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/character_genders.pb", query)
|
||||
func NewCharacterGenders(request RequestFunc) *CharacterGenders {
|
||||
a := &CharacterGenders{
|
||||
BaseEndpoint[pb.CharacterGender]{
|
||||
endpointName: EPCharacterGenders,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CharacterGenders) Query(ctx context.Context, query string) ([]*pb.CharacterGender, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CharacterGenders) Query(query string) ([]*pb.CharacterGender, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CharacterMugShots struct{ BaseEndpoint }
|
||||
type CharacterMugShots struct {
|
||||
BaseEndpoint[pb.CharacterMugShot]
|
||||
}
|
||||
|
||||
func (a *CharacterMugShots) Query(query string) ([]*pb.CharacterMugShot, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/character_mug_shots.pb", query)
|
||||
func NewCharacterMugShots(request RequestFunc) *CharacterMugShots {
|
||||
a := &CharacterMugShots{
|
||||
BaseEndpoint[pb.CharacterMugShot]{
|
||||
endpointName: EPCharacterMugShots,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CharacterMugShots) Query(ctx context.Context, query string) ([]*pb.CharacterMugShot, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CharacterMugShots) Query(query string) ([]*pb.CharacterMugShot, error)
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CharacterSpecies struct{ BaseEndpoint }
|
||||
type CharacterSpecies struct {
|
||||
BaseEndpoint[pb.CharacterSpecie]
|
||||
}
|
||||
|
||||
func (a *CharacterSpecies) Query(query string) ([]*pb.CharacterSpecie, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/character_species.pb", query)
|
||||
func NewCharacterSpecies(request RequestFunc) *CharacterSpecies {
|
||||
a := &CharacterSpecies{
|
||||
BaseEndpoint[pb.CharacterSpecie]{
|
||||
endpointName: EPCharacterSpecies,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CharacterSpecies) Query(ctx context.Context, query string) ([]*pb.CharacterSpecie, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CharacterSpecies) Query(query string) ([]*pb.CharacterSpecie, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Characters struct{ BaseEndpoint }
|
||||
type Characters struct {
|
||||
BaseEndpoint[pb.Character]
|
||||
}
|
||||
|
||||
func (a *Characters) Query(query string) ([]*pb.Character, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/characters.pb", query)
|
||||
func NewCharacters(request RequestFunc) *Characters {
|
||||
a := &Characters{
|
||||
BaseEndpoint[pb.Character]{
|
||||
endpointName: EPCharacters,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Characters) Query(ctx context.Context, query string) ([]*pb.Character, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Characters) Query(query string) ([]*pb.Character, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CollectionMembershipTypes struct{ BaseEndpoint }
|
||||
type CollectionMembershipTypes struct {
|
||||
BaseEndpoint[pb.CollectionMembershipType]
|
||||
}
|
||||
|
||||
func (a *CollectionMembershipTypes) Query(query string) ([]*pb.CollectionMembershipType, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/collection_membership_types.pb", query)
|
||||
func NewCollectionMembershipTypes(request RequestFunc) *CollectionMembershipTypes {
|
||||
a := &CollectionMembershipTypes{
|
||||
BaseEndpoint[pb.CollectionMembershipType]{
|
||||
endpointName: EPCollectionMembershipTypes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CollectionMembershipTypes) Query(ctx context.Context, query string) ([]*pb.CollectionMembershipType, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CollectionMembershipTypes) Query(query string) ([]*pb.CollectionMembers
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CollectionMemberships struct{ BaseEndpoint }
|
||||
type CollectionMemberships struct {
|
||||
BaseEndpoint[pb.CollectionMembership]
|
||||
}
|
||||
|
||||
func (a *CollectionMemberships) Query(query string) ([]*pb.CollectionMembership, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/collection_memberships.pb", query)
|
||||
func NewCollectionMemberships(request RequestFunc) *CollectionMemberships {
|
||||
a := &CollectionMemberships{
|
||||
BaseEndpoint[pb.CollectionMembership]{
|
||||
endpointName: EPCollectionMemberships,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CollectionMemberships) Query(ctx context.Context, query string) ([]*pb.CollectionMembership, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CollectionMemberships) Query(query string) ([]*pb.CollectionMembership,
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CollectionRelationTypes struct{ BaseEndpoint }
|
||||
type CollectionRelationTypes struct {
|
||||
BaseEndpoint[pb.CollectionRelationType]
|
||||
}
|
||||
|
||||
func (a *CollectionRelationTypes) Query(query string) ([]*pb.CollectionRelationType, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/collection_relation_types.pb", query)
|
||||
func NewCollectionRelationTypes(request RequestFunc) *CollectionRelationTypes {
|
||||
a := &CollectionRelationTypes{
|
||||
BaseEndpoint[pb.CollectionRelationType]{
|
||||
endpointName: EPCollectionRelationTypes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CollectionRelationTypes) Query(ctx context.Context, query string) ([]*pb.CollectionRelationType, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CollectionRelationTypes) Query(query string) ([]*pb.CollectionRelationT
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CollectionRelations struct{ BaseEndpoint }
|
||||
type CollectionRelations struct {
|
||||
BaseEndpoint[pb.CollectionRelation]
|
||||
}
|
||||
|
||||
func (a *CollectionRelations) Query(query string) ([]*pb.CollectionRelation, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/collection_relations.pb", query)
|
||||
func NewCollectionRelations(request RequestFunc) *CollectionRelations {
|
||||
a := &CollectionRelations{
|
||||
BaseEndpoint[pb.CollectionRelation]{
|
||||
endpointName: EPCollectionRelations,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CollectionRelations) Query(ctx context.Context, query string) ([]*pb.CollectionRelation, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CollectionRelations) Query(query string) ([]*pb.CollectionRelation, 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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CollectionTypes struct{ BaseEndpoint }
|
||||
type CollectionTypes struct {
|
||||
BaseEndpoint[pb.CollectionType]
|
||||
}
|
||||
|
||||
func (a *CollectionTypes) Query(query string) ([]*pb.CollectionType, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/collection_types.pb", query)
|
||||
func NewCollectionTypes(request RequestFunc) *CollectionTypes {
|
||||
a := &CollectionTypes{
|
||||
BaseEndpoint[pb.CollectionType]{
|
||||
endpointName: EPCollectionTypes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CollectionTypes) Query(ctx context.Context, query string) ([]*pb.CollectionType, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CollectionTypes) Query(query string) ([]*pb.CollectionType, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Collections struct{ BaseEndpoint }
|
||||
type Collections struct {
|
||||
BaseEndpoint[pb.Collection]
|
||||
}
|
||||
|
||||
func (a *Collections) Query(query string) ([]*pb.Collection, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/collections.pb", query)
|
||||
func NewCollections(request RequestFunc) *Collections {
|
||||
a := &Collections{
|
||||
BaseEndpoint[pb.Collection]{
|
||||
endpointName: EPCollections,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Collections) Query(ctx context.Context, query string) ([]*pb.Collection, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Collections) Query(query string) ([]*pb.Collection, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,18 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Companies struct{ BaseEndpoint }
|
||||
type Companies struct {
|
||||
BaseEndpoint[pb.Company]
|
||||
}
|
||||
|
||||
func (a *Companies) Query(query string) ([]*pb.Company, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/companies.pb", query)
|
||||
func NewCompanies(request RequestFunc) *Companies {
|
||||
a := &Companies{
|
||||
BaseEndpoint[pb.Company]{
|
||||
endpointName: EPCompanies,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Companies) Query(ctx context.Context, query string) ([]*pb.Company, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -22,9 +35,5 @@ func (a *Companies) Query(query string) ([]*pb.Company, error) {
|
||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||
}
|
||||
|
||||
if len(data.Companies) == 0 {
|
||||
return nil, errors.New("no results")
|
||||
}
|
||||
|
||||
return data.Companies, nil
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CompanyLogos struct{ BaseEndpoint }
|
||||
type CompanyLogos struct {
|
||||
BaseEndpoint[pb.CompanyLogo]
|
||||
}
|
||||
|
||||
func (a *CompanyLogos) Query(query string) ([]*pb.CompanyLogo, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/company_logos.pb", query)
|
||||
func NewCompanyLogos(request RequestFunc) *CompanyLogos {
|
||||
a := &CompanyLogos{
|
||||
BaseEndpoint[pb.CompanyLogo]{
|
||||
endpointName: EPCompanyLogos,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CompanyLogos) Query(ctx context.Context, query string) ([]*pb.CompanyLogo, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CompanyLogos) Query(query string) ([]*pb.CompanyLogo, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CompanyStatuses struct{ BaseEndpoint }
|
||||
type CompanyStatuses struct {
|
||||
BaseEndpoint[pb.CompanyStatus]
|
||||
}
|
||||
|
||||
func (a *CompanyStatuses) Query(query string) ([]*pb.CompanyStatus, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/company_statuses.pb", query)
|
||||
func NewCompanyStatuses(request RequestFunc) *CompanyStatuses {
|
||||
a := &CompanyStatuses{
|
||||
BaseEndpoint[pb.CompanyStatus]{
|
||||
endpointName: EPCompanyStatuses,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CompanyStatuses) Query(ctx context.Context, query string) ([]*pb.CompanyStatus, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CompanyStatuses) Query(query string) ([]*pb.CompanyStatus, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type CompanyWebsites struct{ BaseEndpoint }
|
||||
type CompanyWebsites struct {
|
||||
BaseEndpoint[pb.CompanyWebsite]
|
||||
}
|
||||
|
||||
func (a *CompanyWebsites) Query(query string) ([]*pb.CompanyWebsite, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/company_websites.pb", query)
|
||||
func NewCompanyWebsites(request RequestFunc) *CompanyWebsites {
|
||||
a := &CompanyWebsites{
|
||||
BaseEndpoint[pb.CompanyWebsite]{
|
||||
endpointName: EPCompanyWebsites,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *CompanyWebsites) Query(ctx context.Context, query string) ([]*pb.CompanyWebsite, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *CompanyWebsites) Query(query string) ([]*pb.CompanyWebsite, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Covers struct{ BaseEndpoint }
|
||||
type Covers struct {
|
||||
BaseEndpoint[pb.Cover]
|
||||
}
|
||||
|
||||
func (a *Covers) Query(query string) ([]*pb.Cover, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/covers.pb", query)
|
||||
func NewCovers(request RequestFunc) *Covers {
|
||||
a := &Covers{
|
||||
BaseEndpoint[pb.Cover]{
|
||||
endpointName: EPCovers,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Covers) Query(ctx context.Context, query string) ([]*pb.Cover, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Covers) Query(query string) ([]*pb.Cover, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type DateFormats struct{ BaseEndpoint }
|
||||
type DateFormats struct {
|
||||
BaseEndpoint[pb.DateFormat]
|
||||
}
|
||||
|
||||
func (a *DateFormats) Query(query string) ([]*pb.DateFormat, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/date_formats.pb", query)
|
||||
func NewDateFormats(request RequestFunc) *DateFormats {
|
||||
a := &DateFormats{
|
||||
BaseEndpoint[pb.DateFormat]{
|
||||
endpointName: EPDateFormats,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *DateFormats) Query(ctx context.Context, query string) ([]*pb.DateFormat, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *DateFormats) Query(query string) ([]*pb.DateFormat, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,82 +1,82 @@
|
||||
package endpoint
|
||||
|
||||
type EndpointName string
|
||||
type Name string
|
||||
|
||||
var (
|
||||
EPAgeRatingCategories EndpointName = "age_rating_categories"
|
||||
EPAgeRatingContentDescriptions EndpointName = "age_rating_content_descriptions"
|
||||
EPAgeRatingContentDescriptionsV2 EndpointName = "age_rating_content_descriptions_v2"
|
||||
EPAgeRatingOrganizations EndpointName = "age_rating_organizations"
|
||||
EPAgeRatings EndpointName = "age_ratings"
|
||||
EPAlternativeNames EndpointName = "alternative_names"
|
||||
EPArtworks EndpointName = "artworks"
|
||||
EPCharacterGenders EndpointName = "character_genders"
|
||||
EPCharacterMugShots EndpointName = "character_mug_shots"
|
||||
EPCharacters EndpointName = "characters"
|
||||
EPCharacterSpecies EndpointName = "character_species"
|
||||
EPCollectionMemberships EndpointName = "collection_memberships"
|
||||
EPCollectionMembershipTypes EndpointName = "collection_membership_types"
|
||||
EPCollectionRelations EndpointName = "collection_relations"
|
||||
EPCollectionRelationTypes EndpointName = "collection_relation_types"
|
||||
EPCollections EndpointName = "collections"
|
||||
EPCollectionTypes EndpointName = "collection_types"
|
||||
EPCompanies EndpointName = "companies"
|
||||
EPCompanyLogos EndpointName = "company_logos"
|
||||
EPCompanyStatuses EndpointName = "company_statuses"
|
||||
EPCompanyWebsites EndpointName = "company_websites"
|
||||
EPCovers EndpointName = "covers"
|
||||
EPDateFormats EndpointName = "date_formats"
|
||||
EPEventLogos EndpointName = "event_logos"
|
||||
EPEventNetworks EndpointName = "event_networks"
|
||||
EPEvents EndpointName = "events"
|
||||
EPExternalGames EndpointName = "external_games"
|
||||
EPExternalGameSources EndpointName = "external_game_sources"
|
||||
EPFranchises EndpointName = "franchises"
|
||||
EPGameEngineLogos EndpointName = "game_engine_logos"
|
||||
EPGameEngines EndpointName = "game_engines"
|
||||
EPGameLocalizations EndpointName = "game_localizations"
|
||||
EPGameModes EndpointName = "game_modes"
|
||||
EPGameReleaseFormats EndpointName = "game_release_formats"
|
||||
EPGames EndpointName = "games"
|
||||
EPGameStatuses EndpointName = "game_statuses"
|
||||
EPGameTimeToBeats EndpointName = "game_time_to_beats"
|
||||
EPGameTypes EndpointName = "game_types"
|
||||
EPGameVersionFeatures EndpointName = "game_version_features"
|
||||
EPGameVersionFeatureValues EndpointName = "game_version_feature_values"
|
||||
EPGameVersions EndpointName = "game_versions"
|
||||
EPGameVideos EndpointName = "game_videos"
|
||||
EPGenres EndpointName = "genres"
|
||||
EPInvolvedCompanies EndpointName = "involved_companies"
|
||||
EPKeywords EndpointName = "keywords"
|
||||
EPLanguages EndpointName = "languages"
|
||||
EPLanguageSupports EndpointName = "language_supports"
|
||||
EPLanguageSupportTypes EndpointName = "language_support_types"
|
||||
EPMultiplayerModes EndpointName = "multiplayer_modes"
|
||||
EPNetworkTypes EndpointName = "network_types"
|
||||
EPPlatformFamilies EndpointName = "platform_families"
|
||||
EPPlatformLogos EndpointName = "platform_logos"
|
||||
EPPlatforms EndpointName = "platforms"
|
||||
EPPlatformTypes EndpointName = "platform_types"
|
||||
EPPlatformVersionCompanies EndpointName = "platform_version_companies"
|
||||
EPPlatformVersionReleaseDates EndpointName = "platform_version_release_dates"
|
||||
EPPlatformVersions EndpointName = "platform_versions"
|
||||
EPPlatformWebsites EndpointName = "platform_websites"
|
||||
EPPlayerPerspectives EndpointName = "player_perspectives"
|
||||
EPPopularityPrimitives EndpointName = "popularity_primitives"
|
||||
EPPopularityTypes EndpointName = "popularity_types"
|
||||
EPRegions EndpointName = "regions"
|
||||
EPReleaseDateRegions EndpointName = "release_date_regions"
|
||||
EPReleaseDates EndpointName = "release_dates"
|
||||
EPReleaseDateStatuses EndpointName = "release_date_statuses"
|
||||
EPScreenshots EndpointName = "screenshots"
|
||||
EPSearch EndpointName = "search"
|
||||
EPThemes EndpointName = "themes"
|
||||
EPWebhooks EndpointName = "webhooks"
|
||||
EPWebsites EndpointName = "websites"
|
||||
EPWebsiteTypes EndpointName = "website_types"
|
||||
EPAgeRatingCategories Name = "age_rating_categories"
|
||||
EPAgeRatingContentDescriptions Name = "age_rating_content_descriptions"
|
||||
EPAgeRatingContentDescriptionsV2 Name = "age_rating_content_descriptions_v2"
|
||||
EPAgeRatingOrganizations Name = "age_rating_organizations"
|
||||
EPAgeRatings Name = "age_ratings"
|
||||
EPAlternativeNames Name = "alternative_names"
|
||||
EPArtworks Name = "artworks"
|
||||
EPCharacterGenders Name = "character_genders"
|
||||
EPCharacterMugShots Name = "character_mug_shots"
|
||||
EPCharacters Name = "characters"
|
||||
EPCharacterSpecies Name = "character_species"
|
||||
EPCollectionMemberships Name = "collection_memberships"
|
||||
EPCollectionMembershipTypes Name = "collection_membership_types"
|
||||
EPCollectionRelations Name = "collection_relations"
|
||||
EPCollectionRelationTypes Name = "collection_relation_types"
|
||||
EPCollections Name = "collections"
|
||||
EPCollectionTypes Name = "collection_types"
|
||||
EPCompanies Name = "companies"
|
||||
EPCompanyLogos Name = "company_logos"
|
||||
EPCompanyStatuses Name = "company_statuses"
|
||||
EPCompanyWebsites Name = "company_websites"
|
||||
EPCovers Name = "covers"
|
||||
EPDateFormats Name = "date_formats"
|
||||
EPEventLogos Name = "event_logos"
|
||||
EPEventNetworks Name = "event_networks"
|
||||
EPEvents Name = "events"
|
||||
EPExternalGames Name = "external_games"
|
||||
EPExternalGameSources Name = "external_game_sources"
|
||||
EPFranchises Name = "franchises"
|
||||
EPGameEngineLogos Name = "game_engine_logos"
|
||||
EPGameEngines Name = "game_engines"
|
||||
EPGameLocalizations Name = "game_localizations"
|
||||
EPGameModes Name = "game_modes"
|
||||
EPGameReleaseFormats Name = "game_release_formats"
|
||||
EPGames Name = "games"
|
||||
EPGameStatuses Name = "game_statuses"
|
||||
EPGameTimeToBeats Name = "game_time_to_beats"
|
||||
EPGameTypes Name = "game_types"
|
||||
EPGameVersionFeatures Name = "game_version_features"
|
||||
EPGameVersionFeatureValues Name = "game_version_feature_values"
|
||||
EPGameVersions Name = "game_versions"
|
||||
EPGameVideos Name = "game_videos"
|
||||
EPGenres Name = "genres"
|
||||
EPInvolvedCompanies Name = "involved_companies"
|
||||
EPKeywords Name = "keywords"
|
||||
EPLanguages Name = "languages"
|
||||
EPLanguageSupports Name = "language_supports"
|
||||
EPLanguageSupportTypes Name = "language_support_types"
|
||||
EPMultiplayerModes Name = "multiplayer_modes"
|
||||
EPNetworkTypes Name = "network_types"
|
||||
EPPlatformFamilies Name = "platform_families"
|
||||
EPPlatformLogos Name = "platform_logos"
|
||||
EPPlatforms Name = "platforms"
|
||||
EPPlatformTypes Name = "platform_types"
|
||||
EPPlatformVersionCompanies Name = "platform_version_companies"
|
||||
EPPlatformVersionReleaseDates Name = "platform_version_release_dates"
|
||||
EPPlatformVersions Name = "platform_versions"
|
||||
EPPlatformWebsites Name = "platform_websites"
|
||||
EPPlayerPerspectives Name = "player_perspectives"
|
||||
EPPopularityPrimitives Name = "popularity_primitives"
|
||||
EPPopularityTypes Name = "popularity_types"
|
||||
EPRegions Name = "regions"
|
||||
EPReleaseDateRegions Name = "release_date_regions"
|
||||
EPReleaseDates Name = "release_dates"
|
||||
EPReleaseDateStatuses Name = "release_date_statuses"
|
||||
EPScreenshots Name = "screenshots"
|
||||
EPSearch Name = "search"
|
||||
EPThemes Name = "themes"
|
||||
EPWebhooks Name = "webhooks"
|
||||
EPWebsites Name = "websites"
|
||||
EPWebsiteTypes Name = "website_types"
|
||||
)
|
||||
|
||||
var AllEndpoints = []EndpointName{
|
||||
var AllNames = []Name{
|
||||
EPAgeRatingCategories,
|
||||
EPAgeRatingContentDescriptions,
|
||||
EPAgeRatingContentDescriptionsV2,
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type EventLogos struct{ BaseEndpoint }
|
||||
type EventLogos struct {
|
||||
BaseEndpoint[pb.EventLogo]
|
||||
}
|
||||
|
||||
func (a *EventLogos) Query(query string) ([]*pb.EventLogo, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/event_logos.pb", query)
|
||||
func NewEventLogos(request RequestFunc) *EventLogos {
|
||||
a := &EventLogos{
|
||||
BaseEndpoint[pb.EventLogo]{
|
||||
endpointName: EPEventLogos,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *EventLogos) Query(ctx context.Context, query string) ([]*pb.EventLogo, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *EventLogos) Query(query string) ([]*pb.EventLogo, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type EventNetworks struct{ BaseEndpoint }
|
||||
type EventNetworks struct {
|
||||
BaseEndpoint[pb.EventNetwork]
|
||||
}
|
||||
|
||||
func (a *EventNetworks) Query(query string) ([]*pb.EventNetwork, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/event_networks.pb", query)
|
||||
func NewEventNetworks(request RequestFunc) *EventNetworks {
|
||||
a := &EventNetworks{
|
||||
BaseEndpoint[pb.EventNetwork]{
|
||||
endpointName: EPEventNetworks,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *EventNetworks) Query(ctx context.Context, query string) ([]*pb.EventNetwork, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *EventNetworks) Query(query string) ([]*pb.EventNetwork, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Events struct{ BaseEndpoint }
|
||||
type Events struct {
|
||||
BaseEndpoint[pb.Event]
|
||||
}
|
||||
|
||||
func (a *Events) Query(query string) ([]*pb.Event, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/events.pb", query)
|
||||
func NewEvents(request RequestFunc) *Events {
|
||||
a := &Events{
|
||||
BaseEndpoint[pb.Event]{
|
||||
endpointName: EPEvents,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Events) Query(ctx context.Context, query string) ([]*pb.Event, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Events) Query(query string) ([]*pb.Event, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type ExternalGameSources struct{ BaseEndpoint }
|
||||
type ExternalGameSources struct {
|
||||
BaseEndpoint[pb.ExternalGameSource]
|
||||
}
|
||||
|
||||
func (a *ExternalGameSources) Query(query string) ([]*pb.ExternalGameSource, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/external_game_sources.pb", query)
|
||||
func NewExternalGameSources(request RequestFunc) *ExternalGameSources {
|
||||
a := &ExternalGameSources{
|
||||
BaseEndpoint[pb.ExternalGameSource]{
|
||||
endpointName: EPExternalGameSources,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ExternalGameSources) Query(ctx context.Context, query string) ([]*pb.ExternalGameSource, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *ExternalGameSources) Query(query string) ([]*pb.ExternalGameSource, 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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type ExternalGames struct{ BaseEndpoint }
|
||||
type ExternalGames struct {
|
||||
BaseEndpoint[pb.ExternalGame]
|
||||
}
|
||||
|
||||
func (a *ExternalGames) Query(query string) ([]*pb.ExternalGame, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/external_games.pb", query)
|
||||
func NewExternalGames(request RequestFunc) *ExternalGames {
|
||||
a := &ExternalGames{
|
||||
BaseEndpoint[pb.ExternalGame]{
|
||||
endpointName: EPExternalGames,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ExternalGames) Query(ctx context.Context, query string) ([]*pb.ExternalGame, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *ExternalGames) Query(query string) ([]*pb.ExternalGame, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Franchises struct{ BaseEndpoint }
|
||||
type Franchises struct {
|
||||
BaseEndpoint[pb.Franchise]
|
||||
}
|
||||
|
||||
func (a *Franchises) Query(query string) ([]*pb.Franchise, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/franchises.pb", query)
|
||||
func NewFranchises(request RequestFunc) *Franchises {
|
||||
a := &Franchises{
|
||||
BaseEndpoint: BaseEndpoint[pb.Franchise]{
|
||||
endpointName: EPFranchises,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Franchises) Query(ctx context.Context, query string) ([]*pb.Franchise, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Franchises) Query(query string) ([]*pb.Franchise, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameEngineLogos struct{ BaseEndpoint }
|
||||
type GameEngineLogos struct {
|
||||
BaseEndpoint[pb.GameEngineLogo]
|
||||
}
|
||||
|
||||
func (a *GameEngineLogos) Query(query string) ([]*pb.GameEngineLogo, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_engine_logos.pb", query)
|
||||
func NewGameEngineLogos(request RequestFunc) *GameEngineLogos {
|
||||
a := &GameEngineLogos{
|
||||
BaseEndpoint[pb.GameEngineLogo]{
|
||||
endpointName: EPGameEngineLogos,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameEngineLogos) Query(ctx context.Context, query string) ([]*pb.GameEngineLogo, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameEngineLogos) Query(query string) ([]*pb.GameEngineLogo, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameEngines struct{ BaseEndpoint }
|
||||
type GameEngines struct {
|
||||
BaseEndpoint[pb.GameEngine]
|
||||
}
|
||||
|
||||
func (a *GameEngines) Query(query string) ([]*pb.GameEngine, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_engines.pb", query)
|
||||
func NewGameEngines(request RequestFunc) *GameEngines {
|
||||
a := &GameEngines{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameEngine]{
|
||||
endpointName: EPGameEngines,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameEngines) Query(ctx context.Context, query string) ([]*pb.GameEngine, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameEngines) Query(query string) ([]*pb.GameEngine, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameLocalizations struct{ BaseEndpoint }
|
||||
type GameLocalizations struct {
|
||||
BaseEndpoint[pb.GameLocalization]
|
||||
}
|
||||
|
||||
func (a *GameLocalizations) Query(query string) ([]*pb.GameLocalization, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_localizations.pb", query)
|
||||
func NewGameLocalizations(request RequestFunc) *GameLocalizations {
|
||||
a := &GameLocalizations{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameLocalization]{
|
||||
endpointName: EPGameLocalizations,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameLocalizations) Query(ctx context.Context, query string) ([]*pb.GameLocalization, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameLocalizations) Query(query string) ([]*pb.GameLocalization, error)
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameModes struct{ BaseEndpoint }
|
||||
type GameModes struct {
|
||||
BaseEndpoint[pb.GameMode]
|
||||
}
|
||||
|
||||
func (a *GameModes) Query(query string) ([]*pb.GameMode, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_modes.pb", query)
|
||||
func NewGameModes(request RequestFunc) *GameModes {
|
||||
a := &GameModes{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameMode]{
|
||||
endpointName: EPGameModes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameModes) Query(ctx context.Context, query string) ([]*pb.GameMode, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameModes) Query(query string) ([]*pb.GameMode, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameReleaseFormats struct{ BaseEndpoint }
|
||||
type GameReleaseFormats struct {
|
||||
BaseEndpoint[pb.GameReleaseFormat]
|
||||
}
|
||||
|
||||
func (a *GameReleaseFormats) Query(query string) ([]*pb.GameReleaseFormat, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_release_formats.pb", query)
|
||||
func NewGameReleaseFormats(request RequestFunc) *GameReleaseFormats {
|
||||
a := &GameReleaseFormats{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameReleaseFormat]{
|
||||
endpointName: EPGameReleaseFormats,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameReleaseFormats) Query(ctx context.Context, query string) ([]*pb.GameReleaseFormat, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameReleaseFormats) Query(query string) ([]*pb.GameReleaseFormat, error
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameStatuses struct{ BaseEndpoint }
|
||||
type GameStatuses struct {
|
||||
BaseEndpoint[pb.GameStatus]
|
||||
}
|
||||
|
||||
func (a *GameStatuses) Query(query string) ([]*pb.GameStatus, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_statuses.pb", query)
|
||||
func NewGameStatuses(request RequestFunc) *GameStatuses {
|
||||
a := &GameStatuses{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameStatus]{
|
||||
endpointName: EPGameStatuses,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameStatuses) Query(ctx context.Context, query string) ([]*pb.GameStatus, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameStatuses) Query(query string) ([]*pb.GameStatus, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameTimeToBeats struct{ BaseEndpoint }
|
||||
type GameTimeToBeats struct {
|
||||
BaseEndpoint[pb.GameTimeToBeat]
|
||||
}
|
||||
|
||||
func (a *GameTimeToBeats) Query(query string) ([]*pb.GameTimeToBeat, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_time_to_beats.pb", query)
|
||||
func NewGameTimeToBeats(request RequestFunc) *GameTimeToBeats {
|
||||
a := &GameTimeToBeats{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameTimeToBeat]{
|
||||
endpointName: EPGameTimeToBeats,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameTimeToBeats) Query(ctx context.Context, query string) ([]*pb.GameTimeToBeat, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameTimeToBeats) Query(query string) ([]*pb.GameTimeToBeat, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameTypes struct{ BaseEndpoint }
|
||||
type GameTypes struct {
|
||||
BaseEndpoint[pb.GameType]
|
||||
}
|
||||
|
||||
func (a *GameTypes) Query(query string) ([]*pb.GameType, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_types.pb", query)
|
||||
func NewGameTypes(request RequestFunc) *GameTypes {
|
||||
a := &GameTypes{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameType]{
|
||||
endpointName: EPGameTypes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameTypes) Query(ctx context.Context, query string) ([]*pb.GameType, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameTypes) Query(query string) ([]*pb.GameType, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameVersionFeatureValues struct{ BaseEndpoint }
|
||||
type GameVersionFeatureValues struct {
|
||||
BaseEndpoint[pb.GameVersionFeatureValue]
|
||||
}
|
||||
|
||||
func (a *GameVersionFeatureValues) Query(query string) ([]*pb.GameVersionFeatureValue, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_version_feature_values.pb", query)
|
||||
func NewGameVersionFeatureValues(request RequestFunc) *GameVersionFeatureValues {
|
||||
a := &GameVersionFeatureValues{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameVersionFeatureValue]{
|
||||
endpointName: EPGameVersionFeatureValues,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameVersionFeatureValues) Query(ctx context.Context, query string) ([]*pb.GameVersionFeatureValue, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameVersionFeatureValues) Query(query string) ([]*pb.GameVersionFeature
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameVersionFeatures struct{ BaseEndpoint }
|
||||
type GameVersionFeatures struct {
|
||||
BaseEndpoint[pb.GameVersionFeature]
|
||||
}
|
||||
|
||||
func (a *GameVersionFeatures) Query(query string) ([]*pb.GameVersionFeature, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_version_features.pb", query)
|
||||
func NewGameVersionFeatures(request RequestFunc) *GameVersionFeatures {
|
||||
a := &GameVersionFeatures{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameVersionFeature]{
|
||||
endpointName: EPGameVersionFeatures,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameVersionFeatures) Query(ctx context.Context, query string) ([]*pb.GameVersionFeature, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameVersionFeatures) Query(query string) ([]*pb.GameVersionFeature, 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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameVersions struct{ BaseEndpoint }
|
||||
type GameVersions struct {
|
||||
BaseEndpoint[pb.GameVersion]
|
||||
}
|
||||
|
||||
func (a *GameVersions) Query(query string) ([]*pb.GameVersion, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_versions.pb", query)
|
||||
func NewGameVersions(request RequestFunc) *GameVersions {
|
||||
a := &GameVersions{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameVersion]{
|
||||
endpointName: EPGameVersions,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameVersions) Query(ctx context.Context, query string) ([]*pb.GameVersion, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameVersions) Query(query string) ([]*pb.GameVersion, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameVideos struct{ BaseEndpoint }
|
||||
type GameVideos struct {
|
||||
BaseEndpoint[pb.GameVideo]
|
||||
}
|
||||
|
||||
func (a *GameVideos) Query(query string) ([]*pb.GameVideo, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/game_videos.pb", query)
|
||||
func NewGameVideos(request RequestFunc) *GameVideos {
|
||||
a := &GameVideos{
|
||||
BaseEndpoint: BaseEndpoint[pb.GameVideo]{
|
||||
endpointName: EPGameVideos,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *GameVideos) Query(ctx context.Context, query string) ([]*pb.GameVideo, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *GameVideos) Query(query string) ([]*pb.GameVideo, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Games struct{ BaseEndpoint }
|
||||
type Games struct {
|
||||
BaseEndpoint[pb.Game]
|
||||
}
|
||||
|
||||
func (a *Games) Query(query string) ([]*pb.Game, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/games.pb", query)
|
||||
func NewGames(request RequestFunc) *Games {
|
||||
a := &Games{
|
||||
BaseEndpoint: BaseEndpoint[pb.Game]{
|
||||
endpointName: EPGames,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Games) Query(ctx context.Context, query string) ([]*pb.Game, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Games) Query(query string) ([]*pb.Game, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Genres struct{ BaseEndpoint }
|
||||
type Genres struct {
|
||||
BaseEndpoint[pb.Genre]
|
||||
}
|
||||
|
||||
func (a *Genres) Query(query string) ([]*pb.Genre, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/genres.pb", query)
|
||||
func NewGenres(request RequestFunc) *Genres {
|
||||
a := &Genres{
|
||||
BaseEndpoint: BaseEndpoint[pb.Genre]{
|
||||
endpointName: EPGenres,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Genres) Query(ctx context.Context, query string) ([]*pb.Genre, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Genres) Query(query string) ([]*pb.Genre, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type InvolvedCompanies struct{ BaseEndpoint }
|
||||
type InvolvedCompanies struct {
|
||||
BaseEndpoint[pb.InvolvedCompany]
|
||||
}
|
||||
|
||||
func (a *InvolvedCompanies) Query(query string) ([]*pb.InvolvedCompany, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/involved_companies.pb", query)
|
||||
func NewInvolvedCompanies(request RequestFunc) *InvolvedCompanies {
|
||||
a := &InvolvedCompanies{
|
||||
BaseEndpoint: BaseEndpoint[pb.InvolvedCompany]{
|
||||
endpointName: EPInvolvedCompanies,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *InvolvedCompanies) Query(ctx context.Context, query string) ([]*pb.InvolvedCompany, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *InvolvedCompanies) Query(query string) ([]*pb.InvolvedCompany, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Keywords struct{ BaseEndpoint }
|
||||
type Keywords struct {
|
||||
BaseEndpoint[pb.Keyword]
|
||||
}
|
||||
|
||||
func (a *Keywords) Query(query string) ([]*pb.Keyword, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/keywords.pb", query)
|
||||
func NewKeywords(request RequestFunc) *Keywords {
|
||||
a := &Keywords{
|
||||
BaseEndpoint: BaseEndpoint[pb.Keyword]{
|
||||
endpointName: EPKeywords,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Keywords) Query(ctx context.Context, query string) ([]*pb.Keyword, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Keywords) Query(query string) ([]*pb.Keyword, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type LanguageSupportTypes struct{ BaseEndpoint }
|
||||
type LanguageSupportTypes struct {
|
||||
BaseEndpoint[pb.LanguageSupportType]
|
||||
}
|
||||
|
||||
func (a *LanguageSupportTypes) Query(query string) ([]*pb.LanguageSupportType, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/language_support_types.pb", query)
|
||||
func NewLanguageSupportTypes(request RequestFunc) *LanguageSupportTypes {
|
||||
a := &LanguageSupportTypes{
|
||||
BaseEndpoint[pb.LanguageSupportType]{
|
||||
endpointName: EPLanguageSupportTypes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *LanguageSupportTypes) Query(ctx context.Context, query string) ([]*pb.LanguageSupportType, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *LanguageSupportTypes) Query(query string) ([]*pb.LanguageSupportType, e
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type LanguageSupports struct{ BaseEndpoint }
|
||||
type LanguageSupports struct {
|
||||
BaseEndpoint[pb.LanguageSupport]
|
||||
}
|
||||
|
||||
func (a *LanguageSupports) Query(query string) ([]*pb.LanguageSupport, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/language_supports.pb", query)
|
||||
func NewLanguageSupports(request RequestFunc) *LanguageSupports {
|
||||
a := &LanguageSupports{
|
||||
BaseEndpoint: BaseEndpoint[pb.LanguageSupport]{
|
||||
endpointName: EPLanguageSupports,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *LanguageSupports) Query(ctx context.Context, query string) ([]*pb.LanguageSupport, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *LanguageSupports) Query(query string) ([]*pb.LanguageSupport, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Languages struct{ BaseEndpoint }
|
||||
type Languages struct {
|
||||
BaseEndpoint[pb.Language]
|
||||
}
|
||||
|
||||
func (a *Languages) Query(query string) ([]*pb.Language, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/languages.pb", query)
|
||||
func NewLanguages(request RequestFunc) *Languages {
|
||||
a := &Languages{
|
||||
BaseEndpoint: BaseEndpoint[pb.Language]{
|
||||
endpointName: EPLanguages,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Languages) Query(ctx context.Context, query string) ([]*pb.Language, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Languages) Query(query string) ([]*pb.Language, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type MultiplayerModes struct{ BaseEndpoint }
|
||||
type MultiplayerModes struct {
|
||||
BaseEndpoint[pb.MultiplayerMode]
|
||||
}
|
||||
|
||||
func (a *MultiplayerModes) Query(query string) ([]*pb.MultiplayerMode, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/multiplayer_modes.pb", query)
|
||||
func NewMultiplayerModes(request RequestFunc) *MultiplayerModes {
|
||||
a := &MultiplayerModes{
|
||||
BaseEndpoint: BaseEndpoint[pb.MultiplayerMode]{
|
||||
endpointName: EPMultiplayerModes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *MultiplayerModes) Query(ctx context.Context, query string) ([]*pb.MultiplayerMode, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *MultiplayerModes) Query(query string) ([]*pb.MultiplayerMode, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type NetworkTypes struct{ BaseEndpoint }
|
||||
type NetworkTypes struct {
|
||||
BaseEndpoint[pb.NetworkType]
|
||||
}
|
||||
|
||||
func (a *NetworkTypes) Query(query string) ([]*pb.NetworkType, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/network_types.pb", query)
|
||||
func NewNetworkTypes(request RequestFunc) *NetworkTypes {
|
||||
a := &NetworkTypes{
|
||||
BaseEndpoint: BaseEndpoint[pb.NetworkType]{
|
||||
endpointName: EPNetworkTypes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *NetworkTypes) Query(ctx context.Context, query string) ([]*pb.NetworkType, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *NetworkTypes) Query(query string) ([]*pb.NetworkType, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type PlatformFamilies struct{ BaseEndpoint }
|
||||
type PlatformFamilies struct {
|
||||
BaseEndpoint[pb.PlatformFamily]
|
||||
}
|
||||
|
||||
func (a *PlatformFamilies) Query(query string) ([]*pb.PlatformFamily, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/platform_families.pb", query)
|
||||
func NewPlatformFamilies(request RequestFunc) *PlatformFamilies {
|
||||
a := &PlatformFamilies{
|
||||
BaseEndpoint: BaseEndpoint[pb.PlatformFamily]{
|
||||
endpointName: EPPlatformFamilies,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *PlatformFamilies) Query(ctx context.Context, query string) ([]*pb.PlatformFamily, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *PlatformFamilies) Query(query string) ([]*pb.PlatformFamily, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type PlatformLogos struct{ BaseEndpoint }
|
||||
type PlatformLogos struct {
|
||||
BaseEndpoint[pb.PlatformLogo]
|
||||
}
|
||||
|
||||
func (a *PlatformLogos) Query(query string) ([]*pb.PlatformLogo, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/platform_logos.pb", query)
|
||||
func NewPlatformLogos(request RequestFunc) *PlatformLogos {
|
||||
a := &PlatformLogos{
|
||||
BaseEndpoint: BaseEndpoint[pb.PlatformLogo]{
|
||||
endpointName: EPPlatformLogos,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *PlatformLogos) Query(ctx context.Context, query string) ([]*pb.PlatformLogo, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *PlatformLogos) Query(query string) ([]*pb.PlatformLogo, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type PlatformTypes struct{ BaseEndpoint }
|
||||
type PlatformTypes struct {
|
||||
BaseEndpoint[pb.PlatformType]
|
||||
}
|
||||
|
||||
func (a *PlatformTypes) Query(query string) ([]*pb.PlatformType, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/platform_types.pb", query)
|
||||
func NewPlatformTypes(request RequestFunc) *PlatformTypes {
|
||||
a := &PlatformTypes{
|
||||
BaseEndpoint: BaseEndpoint[pb.PlatformType]{
|
||||
endpointName: EPPlatformTypes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *PlatformTypes) Query(ctx context.Context, query string) ([]*pb.PlatformType, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *PlatformTypes) Query(query string) ([]*pb.PlatformType, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type PlatformVersionCompanies struct{ BaseEndpoint }
|
||||
type PlatformVersionCompanies struct {
|
||||
BaseEndpoint[pb.PlatformVersionCompany]
|
||||
}
|
||||
|
||||
func (a *PlatformVersionCompanies) Query(query string) ([]*pb.PlatformVersionCompany, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/platform_version_companies.pb", query)
|
||||
func NewPlatformVersionCompanies(request RequestFunc) *PlatformVersionCompanies {
|
||||
a := &PlatformVersionCompanies{
|
||||
BaseEndpoint: BaseEndpoint[pb.PlatformVersionCompany]{
|
||||
endpointName: EPPlatformVersionCompanies,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *PlatformVersionCompanies) Query(ctx context.Context, query string) ([]*pb.PlatformVersionCompany, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *PlatformVersionCompanies) Query(query string) ([]*pb.PlatformVersionCom
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type PlatformVersionReleaseDates struct{ BaseEndpoint }
|
||||
type PlatformVersionReleaseDates struct {
|
||||
BaseEndpoint[pb.PlatformVersionReleaseDate]
|
||||
}
|
||||
|
||||
func (a *PlatformVersionReleaseDates) Query(query string) ([]*pb.PlatformVersionReleaseDate, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/platform_version_release_dates.pb", query)
|
||||
func NewPlatformVersionReleaseDates(request RequestFunc) *PlatformVersionReleaseDates {
|
||||
a := &PlatformVersionReleaseDates{
|
||||
BaseEndpoint: BaseEndpoint[pb.PlatformVersionReleaseDate]{
|
||||
endpointName: EPPlatformVersionReleaseDates,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *PlatformVersionReleaseDates) Query(ctx context.Context, query string) ([]*pb.PlatformVersionReleaseDate, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *PlatformVersionReleaseDates) Query(query string) ([]*pb.PlatformVersion
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type PlatformVersions struct{ BaseEndpoint }
|
||||
type PlatformVersions struct {
|
||||
BaseEndpoint[pb.PlatformVersion]
|
||||
}
|
||||
|
||||
func (a *PlatformVersions) Query(query string) ([]*pb.PlatformVersion, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/platform_versions.pb", query)
|
||||
func NewPlatformVersions(request RequestFunc) *PlatformVersions {
|
||||
a := &PlatformVersions{
|
||||
BaseEndpoint: BaseEndpoint[pb.PlatformVersion]{
|
||||
endpointName: EPPlatformVersions,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *PlatformVersions) Query(ctx context.Context, query string) ([]*pb.PlatformVersion, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *PlatformVersions) Query(query string) ([]*pb.PlatformVersion, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type PlatformWebsites struct{ BaseEndpoint }
|
||||
type PlatformWebsites struct {
|
||||
BaseEndpoint[pb.PlatformWebsite]
|
||||
}
|
||||
|
||||
func (a *PlatformWebsites) Query(query string) ([]*pb.PlatformWebsite, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/platform_websites.pb", query)
|
||||
func NewPlatformWebsites(request RequestFunc) *PlatformWebsites {
|
||||
a := &PlatformWebsites{
|
||||
BaseEndpoint: BaseEndpoint[pb.PlatformWebsite]{
|
||||
endpointName: EPPlatformWebsites,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *PlatformWebsites) Query(ctx context.Context, query string) ([]*pb.PlatformWebsite, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *PlatformWebsites) Query(query string) ([]*pb.PlatformWebsite, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Platforms struct{ BaseEndpoint }
|
||||
type Platforms struct {
|
||||
BaseEndpoint[pb.Platform]
|
||||
}
|
||||
|
||||
func (a *Platforms) Query(query string) ([]*pb.Platform, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/platforms.pb", query)
|
||||
func NewPlatforms(request RequestFunc) *Platforms {
|
||||
a := &Platforms{
|
||||
BaseEndpoint[pb.Platform]{
|
||||
endpointName: EPPlatforms,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Platforms) Query(ctx context.Context, query string) ([]*pb.Platform, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,8 +35,5 @@ func (a *Platforms) Query(query string) ([]*pb.Platform, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type PlayerPerspectives struct{ BaseEndpoint }
|
||||
type PlayerPerspectives struct {
|
||||
BaseEndpoint[pb.PlayerPerspective]
|
||||
}
|
||||
|
||||
func (a *PlayerPerspectives) Query(query string) ([]*pb.PlayerPerspective, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/player_perspectives.pb", query)
|
||||
func NewPlayerPerspectives(request RequestFunc) *PlayerPerspectives {
|
||||
a := &PlayerPerspectives{
|
||||
BaseEndpoint: BaseEndpoint[pb.PlayerPerspective]{
|
||||
endpointName: EPPlayerPerspectives,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *PlayerPerspectives) Query(ctx context.Context, query string) ([]*pb.PlayerPerspective, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *PlayerPerspectives) Query(query string) ([]*pb.PlayerPerspective, error
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type PopularityPrimitives struct{ BaseEndpoint }
|
||||
type PopularityPrimitives struct {
|
||||
BaseEndpoint[pb.PopularityPrimitive]
|
||||
}
|
||||
|
||||
func (a *PopularityPrimitives) Query(query string) ([]*pb.PopularityPrimitive, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/popularity_primitives.pb", query)
|
||||
func NewPopularityPrimitives(request RequestFunc) *PopularityPrimitives {
|
||||
a := &PopularityPrimitives{
|
||||
BaseEndpoint[pb.PopularityPrimitive]{
|
||||
endpointName: EPPopularityPrimitives,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *PopularityPrimitives) Query(ctx context.Context, query string) ([]*pb.PopularityPrimitive, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *PopularityPrimitives) Query(query string) ([]*pb.PopularityPrimitive, e
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type PopularityTypes struct{ BaseEndpoint }
|
||||
type PopularityTypes struct {
|
||||
BaseEndpoint[pb.PopularityType]
|
||||
}
|
||||
|
||||
func (a *PopularityTypes) Query(query string) ([]*pb.PopularityType, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/popularity_types.pb", query)
|
||||
func NewPopularityTypes(request RequestFunc) *PopularityTypes {
|
||||
a := &PopularityTypes{
|
||||
BaseEndpoint: BaseEndpoint[pb.PopularityType]{
|
||||
endpointName: EPPopularityTypes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *PopularityTypes) Query(ctx context.Context, query string) ([]*pb.PopularityType, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *PopularityTypes) Query(query string) ([]*pb.PopularityType, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Regions struct{ BaseEndpoint }
|
||||
type Regions struct {
|
||||
BaseEndpoint[pb.Region]
|
||||
}
|
||||
|
||||
func (a *Regions) Query(query string) ([]*pb.Region, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/regions.pb", query)
|
||||
func NewRegions(request RequestFunc) *Regions {
|
||||
a := &Regions{
|
||||
BaseEndpoint: BaseEndpoint[pb.Region]{
|
||||
endpointName: EPRegions,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Regions) Query(ctx context.Context, query string) ([]*pb.Region, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Regions) Query(query string) ([]*pb.Region, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type ReleaseDateRegions struct{ BaseEndpoint }
|
||||
type ReleaseDateRegions struct {
|
||||
BaseEndpoint[pb.ReleaseDateRegion]
|
||||
}
|
||||
|
||||
func (a *ReleaseDateRegions) Query(query string) ([]*pb.ReleaseDateRegion, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/release_date_regions.pb", query)
|
||||
func NewReleaseDateRegions(request RequestFunc) *ReleaseDateRegions {
|
||||
a := &ReleaseDateRegions{
|
||||
BaseEndpoint: BaseEndpoint[pb.ReleaseDateRegion]{
|
||||
endpointName: EPReleaseDateRegions,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ReleaseDateRegions) Query(ctx context.Context, query string) ([]*pb.ReleaseDateRegion, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *ReleaseDateRegions) Query(query string) ([]*pb.ReleaseDateRegion, error
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type ReleaseDateStatuses struct{ BaseEndpoint }
|
||||
type ReleaseDateStatuses struct {
|
||||
BaseEndpoint[pb.ReleaseDateStatus]
|
||||
}
|
||||
|
||||
func (a *ReleaseDateStatuses) Query(query string) ([]*pb.ReleaseDateStatus, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/release_date_statuses.pb", query)
|
||||
func NewReleaseDateStatuses(request RequestFunc) *ReleaseDateStatuses {
|
||||
a := &ReleaseDateStatuses{
|
||||
BaseEndpoint: BaseEndpoint[pb.ReleaseDateStatus]{
|
||||
endpointName: EPReleaseDateStatuses,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ReleaseDateStatuses) Query(ctx context.Context, query string) ([]*pb.ReleaseDateStatus, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *ReleaseDateStatuses) Query(query string) ([]*pb.ReleaseDateStatus, erro
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type ReleaseDates struct{ BaseEndpoint }
|
||||
type ReleaseDates struct {
|
||||
BaseEndpoint[pb.ReleaseDate]
|
||||
}
|
||||
|
||||
func (a *ReleaseDates) Query(query string) ([]*pb.ReleaseDate, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/release_dates.pb", query)
|
||||
func NewReleaseDates(request RequestFunc) *ReleaseDates {
|
||||
a := &ReleaseDates{
|
||||
BaseEndpoint: BaseEndpoint[pb.ReleaseDate]{
|
||||
endpointName: EPReleaseDates,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *ReleaseDates) Query(ctx context.Context, query string) ([]*pb.ReleaseDate, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *ReleaseDates) Query(query string) ([]*pb.ReleaseDate, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Screenshots struct{ BaseEndpoint }
|
||||
type Screenshots struct {
|
||||
BaseEndpoint[pb.Screenshot]
|
||||
}
|
||||
|
||||
func (a *Screenshots) Query(query string) ([]*pb.Screenshot, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/screenshots.pb", query)
|
||||
func NewScreenshots(request RequestFunc) *Screenshots {
|
||||
a := &Screenshots{
|
||||
BaseEndpoint: BaseEndpoint[pb.Screenshot]{
|
||||
endpointName: EPScreenshots,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Screenshots) Query(ctx context.Context, query string) ([]*pb.Screenshot, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Screenshots) Query(query string) ([]*pb.Screenshot, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -9,25 +10,34 @@ import (
|
||||
"strings"
|
||||
"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/bestnite/go-flaresolverr"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
var webSearchCFCookies struct {
|
||||
cookies []*http.Cookie
|
||||
ua string
|
||||
expires time.Time
|
||||
}
|
||||
|
||||
type Search struct {
|
||||
BaseEndpoint
|
||||
endpointName Name
|
||||
request RequestFunc
|
||||
flaresolverr *flaresolverr.Flaresolverr
|
||||
}
|
||||
|
||||
func (a *Search) Search(query string) ([]*pb.Search, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/search.pb", query)
|
||||
func NewSearch(request RequestFunc) *Search {
|
||||
return &Search{
|
||||
endpointName: EPSearch,
|
||||
request: request,
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Search) Search(ctx context.Context, query string) ([]*pb.Search, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -37,10 +47,6 @@ func (a *Search) Search(query string) ([]*pb.Search, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -69,16 +75,15 @@ func (a *Search) WebSearchGameIDs(name string) ([]uint64, error) {
|
||||
return nil, fmt.Errorf("failed to web search: %s: %w", name, err)
|
||||
}
|
||||
webSearchCFCookies.cookies = resp.Solution.Cookies
|
||||
webSearchCFCookies.ua = resp.Solution.UserAgent
|
||||
webSearchCFCookies.expires = time.Now().Add(3 * time.Hour)
|
||||
respBody = strings.NewReader(resp.Solution.Response)
|
||||
} else if time.Now().Before(webSearchCFCookies.expires) {
|
||||
resp, err := f.SimulateGet(Url, &flaresolverr.SimulateOptions{
|
||||
HttpCookies: webSearchCFCookies.cookies,
|
||||
})
|
||||
resp, err := f.SimulateGet(Url, webSearchCFCookies.ua, webSearchCFCookies.cookies)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to search IGDB ID: %s: %w", name, err)
|
||||
}
|
||||
respBody = strings.NewReader(resp.Body)
|
||||
respBody = resp.Body
|
||||
}
|
||||
|
||||
doc, err := goquery.NewDocumentFromReader(respBody)
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Themes struct{ BaseEndpoint }
|
||||
type Themes struct {
|
||||
BaseEndpoint[pb.Theme]
|
||||
}
|
||||
|
||||
func (a *Themes) Query(query string) ([]*pb.Theme, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/themes.pb", query)
|
||||
func NewThemes(request RequestFunc) *Themes {
|
||||
a := &Themes{
|
||||
BaseEndpoint: BaseEndpoint[pb.Theme]{
|
||||
endpointName: EPThemes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Themes) Query(ctx context.Context, query string) ([]*pb.Theme, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Themes) Query(query string) ([]*pb.Theme, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,26 +1,104 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type Webhooks struct{ BaseEndpoint }
|
||||
type Webhooks struct {
|
||||
request RequestFunc
|
||||
}
|
||||
|
||||
func (a *Webhooks) Register(endpoint EndpointName, secret, callbackUrl string) error {
|
||||
func NewWebhooks(request RequestFunc) *Webhooks {
|
||||
return &Webhooks{
|
||||
request: request,
|
||||
}
|
||||
}
|
||||
|
||||
type WebhookMethod string
|
||||
|
||||
const (
|
||||
WebhookMethodUpdate WebhookMethod = "update"
|
||||
WebhookMethodDelete WebhookMethod = "delete"
|
||||
WebhookMethodCreate WebhookMethod = "create"
|
||||
)
|
||||
|
||||
type WebhookResponse struct {
|
||||
Id uint64 `json:"id"`
|
||||
Url string `json:"url"`
|
||||
Category uint64 `json:"category"`
|
||||
SubCategory uint64 `json:"sub_category"`
|
||||
Active bool `json:"active"`
|
||||
ApiKey string `json:"api_key"`
|
||||
Secret string `json:"secret"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
UpdatedAt string `json:"updated_at"`
|
||||
}
|
||||
|
||||
func (a *Webhooks) Register(ctx context.Context, endpoint Name, secret, callbackUrl string, method WebhookMethod) (*WebhookResponse, error) {
|
||||
dataBody := url.Values{}
|
||||
dataBody.Set("url", callbackUrl)
|
||||
dataBody.Set("secret", secret)
|
||||
dataBody.Set("method", "update")
|
||||
resp, err := a.request(fmt.Sprintf("https://api.igdb.com/v4/%s/webhooks/", endpoint), dataBody.Encode())
|
||||
dataBody.Set("method", string(method))
|
||||
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s/webhooks/", endpoint), dataBody.Encode())
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to make request: %s: %w", callbackUrl, err)
|
||||
return nil, fmt.Errorf("failed to make request: %s: %w", callbackUrl, err)
|
||||
}
|
||||
|
||||
if resp.StatusCode() == http.StatusOK {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
var data WebhookResponse
|
||||
if err = json.Unmarshal(resp.Body(), &data); err != nil {
|
||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||
}
|
||||
|
||||
return &data, fmt.Errorf("failed to activate webhook: %s: %s", callbackUrl, resp.String())
|
||||
}
|
||||
|
||||
func (a *Webhooks) Unregister(ctx context.Context, webhookId uint64) error {
|
||||
resp, err := a.request(ctx, "DELETE", fmt.Sprintf("https://api.igdb.com/v4/webhooks/%v", webhookId), "")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to make request: %w", err)
|
||||
}
|
||||
|
||||
if resp.StatusCode() == http.StatusOK {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("failed to activate webhook: %s: %s", callbackUrl, resp.String())
|
||||
|
||||
return fmt.Errorf("failed to unregister webhook: %s", resp.String())
|
||||
}
|
||||
|
||||
func (a *Webhooks) List(ctx context.Context) ([]*WebhookResponse, error) {
|
||||
resp, err := a.request(ctx, "GET", "https://api.igdb.com/v4/webhooks/", "")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to make request: %w", err)
|
||||
}
|
||||
|
||||
var data []*WebhookResponse
|
||||
if err = json.Unmarshal(resp.Body(), &data); err != nil {
|
||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||
}
|
||||
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func (a *Webhooks) Get(ctx context.Context, webhookId uint64) (*WebhookResponse, error) {
|
||||
resp, err := a.request(ctx, "GET", fmt.Sprintf("https://api.igdb.com/v4/webhooks/%v", webhookId), "")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to make request: %w", err)
|
||||
}
|
||||
|
||||
var data WebhookResponse
|
||||
if err = json.Unmarshal(resp.Body(), &data); err != nil {
|
||||
return nil, fmt.Errorf("failed to unmarshal: %w", err)
|
||||
}
|
||||
|
||||
return &data, nil
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type WebsiteTypes struct{ BaseEndpoint }
|
||||
type WebsiteTypes struct {
|
||||
BaseEndpoint[pb.WebsiteType]
|
||||
}
|
||||
|
||||
func (a *WebsiteTypes) Query(query string) ([]*pb.WebsiteType, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/website_types.pb", query)
|
||||
func NewWebsiteTypes(request RequestFunc) *WebsiteTypes {
|
||||
a := &WebsiteTypes{
|
||||
BaseEndpoint: BaseEndpoint[pb.WebsiteType]{
|
||||
endpointName: EPWebsiteTypes,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *WebsiteTypes) Query(ctx context.Context, query string) ([]*pb.WebsiteType, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *WebsiteTypes) Query(query string) ([]*pb.WebsiteType, error) {
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
package endpoint
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
pb "git.nite07.com/nite/go-igdb/proto"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type Websites struct{ BaseEndpoint }
|
||||
type Websites struct {
|
||||
BaseEndpoint[pb.Website]
|
||||
}
|
||||
|
||||
func (a *Websites) Query(query string) ([]*pb.Website, error) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/websites.pb", query)
|
||||
func NewWebsites(request RequestFunc) *Websites {
|
||||
a := &Websites{
|
||||
BaseEndpoint: BaseEndpoint[pb.Website]{
|
||||
endpointName: EPWebsites,
|
||||
request: request,
|
||||
},
|
||||
}
|
||||
a.queryFunc = a.Query
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *Websites) Query(ctx context.Context, query string) ([]*pb.Website, error) {
|
||||
resp, err := a.request(ctx, "POST", fmt.Sprintf("https://api.igdb.com/v4/%s.pb", a.endpointName), query)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to request: %w", err)
|
||||
}
|
||||
@@ -21,9 +35,5 @@ func (a *Websites) Query(query string) ([]*pb.Website, error) {
|
||||
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
|
||||
}
|
||||
|
||||
40
go.mod
40
go.mod
@@ -1,27 +1,31 @@
|
||||
module github.com/bestnite/go-igdb
|
||||
module git.nite07.com/nite/go-igdb
|
||||
|
||||
go 1.24.1
|
||||
|
||||
require (
|
||||
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
|
||||
google.golang.org/protobuf v1.36.6
|
||||
git.nite07.com/nite/go-flaresolverr v1.0.4-0.20260125200826-e2ef035c3999
|
||||
github.com/PuerkitoBio/goquery v1.11.0
|
||||
github.com/go-resty/resty/v2 v2.17.1
|
||||
golang.org/x/time v0.14.0
|
||||
google.golang.org/protobuf v1.36.11
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Danny-Dasilva/CycleTLS/cycletls v1.0.26 // 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/cloudflare/circl v1.3.7 // indirect
|
||||
github.com/gorilla/websocket v1.5.1 // indirect
|
||||
github.com/klauspost/compress v1.17.6 // indirect
|
||||
github.com/quic-go/quic-go v0.41.0 // indirect
|
||||
github.com/refraction-networking/utls v1.6.2 // indirect
|
||||
golang.org/x/crypto v0.33.0 // indirect
|
||||
golang.org/x/net v0.35.0 // indirect
|
||||
golang.org/x/sys v0.30.0 // indirect
|
||||
golang.org/x/text v0.22.0 // indirect
|
||||
h12.io/socks v1.0.3 // indirect
|
||||
github.com/bdandy/go-errors v1.2.2 // indirect
|
||||
github.com/bdandy/go-socks4 v1.2.3 // indirect
|
||||
github.com/bogdanfinn/fhttp v0.6.7 // indirect
|
||||
github.com/bogdanfinn/quic-go-utls v1.0.7-utls // indirect
|
||||
github.com/bogdanfinn/tls-client v1.13.2-0.20260121072726-145b2fdcf1c7 // indirect
|
||||
github.com/bogdanfinn/utls v1.7.7-barnius // indirect
|
||||
github.com/bogdanfinn/websocket v1.5.4-barnius // indirect
|
||||
github.com/klauspost/compress v1.18.3 // indirect
|
||||
github.com/quic-go/qpack v0.6.0 // indirect
|
||||
github.com/tam7t/hpkp v0.0.0-20160821193359-2b70b4024ed5 // indirect
|
||||
go.uber.org/mock v0.6.0 // indirect
|
||||
golang.org/x/crypto v0.47.0 // indirect
|
||||
golang.org/x/net v0.49.0 // indirect
|
||||
golang.org/x/sys v0.40.0 // indirect
|
||||
golang.org/x/text v0.33.0 // indirect
|
||||
)
|
||||
|
||||
423
go.sum
423
go.sum
@@ -1,441 +1,128 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo=
|
||||
dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU=
|
||||
dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU=
|
||||
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=
|
||||
git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
|
||||
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.26/go.mod h1:QFi/EVO7qqru3Ftxz1LR+96jIc91Tifv0DnskF/gWQ8=
|
||||
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/PuerkitoBio/goquery v1.10.2 h1:7fh2BdHcG6VFZsK7toXBT/Bh1z5Wmy8Q9MV9HqT2AM8=
|
||||
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.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
||||
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
||||
git.nite07.com/nite/go-flaresolverr v1.0.2 h1:HsQzjGDJQPrs33SlOdK0lNP4IVcYcHBolYQBowYZZKI=
|
||||
git.nite07.com/nite/go-flaresolverr v1.0.2/go.mod h1:8BwQx4LxsrLjuC2iyqGQrOaZw5k2Kr3AFslcRyRpmNg=
|
||||
git.nite07.com/nite/go-flaresolverr v1.0.3 h1:blXRZBtFo9KpKcFOH3jn5ryZN4HAZchy1cQdHLdMgng=
|
||||
git.nite07.com/nite/go-flaresolverr v1.0.3/go.mod h1:8BwQx4LxsrLjuC2iyqGQrOaZw5k2Kr3AFslcRyRpmNg=
|
||||
git.nite07.com/nite/go-flaresolverr v1.0.4-0.20260125200826-e2ef035c3999 h1:PxbRwX5biu9Dc2hDrHdrntxd5Lm3BPN4FiuTfIhfUwg=
|
||||
git.nite07.com/nite/go-flaresolverr v1.0.4-0.20260125200826-e2ef035c3999/go.mod h1:8BwQx4LxsrLjuC2iyqGQrOaZw5k2Kr3AFslcRyRpmNg=
|
||||
github.com/PuerkitoBio/goquery v1.11.0 h1:jZ7pwMQXIITcUXNH83LLk+txlaEy6NVOfTuP43xxfqw=
|
||||
github.com/PuerkitoBio/goquery v1.11.0/go.mod h1:wQHgxUOU3JGuj3oD/QFfxUdlzW6xPHfqyHre6VMY4DQ=
|
||||
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
|
||||
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/go.mod h1:xNd9bqTn98Ln4DwST8/nG+H0yuB8Hmgu1YHNnWw0GeA=
|
||||
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/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/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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
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/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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/bdandy/go-errors v1.2.2 h1:WdFv/oukjTJCLa79UfkGmwX7ZxONAihKu4V0mLIs11Q=
|
||||
github.com/bdandy/go-errors v1.2.2/go.mod h1:NkYHl4Fey9oRRdbB1CoC6e84tuqQHiqrOcZpqFEkBxM=
|
||||
github.com/bdandy/go-socks4 v1.2.3 h1:Q6Y2heY1GRjCtHbmlKfnwrKVU/k81LS8mRGLRlmDlic=
|
||||
github.com/bdandy/go-socks4 v1.2.3/go.mod h1:98kiVFgpdogR8aIGLWLvjDVZ8XcKPsSI/ypGrO+bqHI=
|
||||
github.com/bogdanfinn/fhttp v0.6.7 h1:yTDywa9INbRqePBE5gHhpxlMjvAQ0bdX77pvOTPJoPI=
|
||||
github.com/bogdanfinn/fhttp v0.6.7/go.mod h1:A+EKDzMx2hb4IUbMx4TlkoHnaJEiLl8r/1Ss1Y+5e5M=
|
||||
github.com/bogdanfinn/quic-go-utls v1.0.7-utls h1:opxU/wt2C6FcD3rkGSOwfpQgfGSFx9eAKYQrFwYBzuo=
|
||||
github.com/bogdanfinn/quic-go-utls v1.0.7-utls/go.mod h1:bk8QMY2KypO8A6LzHJ7C4+bdB0ksLOd6NZt600wXYe8=
|
||||
github.com/bogdanfinn/tls-client v1.13.2-0.20260121072726-145b2fdcf1c7 h1:7/7xbSyvJTwxjOP5iBw5CM3SmIBGqHwC5nFkbkvdI28=
|
||||
github.com/bogdanfinn/tls-client v1.13.2-0.20260121072726-145b2fdcf1c7/go.mod h1:z01rwJcKsjx8Vo0dXKwz7YRkqo+XNIKC0pJaCdJDHgs=
|
||||
github.com/bogdanfinn/utls v1.7.7-barnius h1:OuJ497cc7F3yKNVHRsYPQdGggmk5x6+V5ZlrCR7fOLU=
|
||||
github.com/bogdanfinn/utls v1.7.7-barnius/go.mod h1:aAK1VZQlpKZClF1WEQeq6kyclbkPq4hz6xTbB5xSlmg=
|
||||
github.com/bogdanfinn/websocket v1.5.4-barnius h1:qn3DU/KMHMNPNnwDCtA/IN3QqmzV98DVsvQkQkxruKw=
|
||||
github.com/bogdanfinn/websocket v1.5.4-barnius/go.mod h1:IWHoWLZd+5/o9340A/m/ApAOBmWDSTUXuL7zSVmRHQk=
|
||||
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/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/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.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
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/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-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-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-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/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/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/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.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||
github.com/go-resty/resty/v2 v2.17.1 h1:x3aMpHK1YM9e4va/TMDRlusDDoZiQ+ViDu/WpA6xTM4=
|
||||
github.com/go-resty/resty/v2 v2.17.1/go.mod h1:kCKZ3wWmwJaNc7S29BRtUhJwy7iqmn+2mLtQrOyQlVA=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
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/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-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
|
||||
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
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/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.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY=
|
||||
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/h12w/go-socks5 v0.0.0-20200522160539-76189e178364 h1:5XxdakFhqd9dnXoAZy1Mb2R/DZ6D1e+0bGC/JhucGYI=
|
||||
github.com/h12w/go-socks5 v0.0.0-20200522160539-76189e178364/go.mod h1:eDJQioIyy4Yn3MVivT7rv/39gAJTrA7lgmYr8EW950c=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
|
||||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
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/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.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
||||
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.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
|
||||
github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
|
||||
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
|
||||
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||
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.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/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.6/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk=
|
||||
github.com/onsi/ginkgo/v2 v2.2.0/go.mod h1:MEH45j8TBi6u9BMogfbp0stKC5cdGjumZj5Y7AG4VIk=
|
||||
github.com/onsi/ginkgo/v2 v2.3.0/go.mod h1:Eew0uilEqZmIEZr8JrvYlvOM7Rr6xzTmMV8AyFNU9d0=
|
||||
github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo=
|
||||
github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw=
|
||||
github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo=
|
||||
github.com/onsi/ginkgo/v2 v2.8.1/go.mod h1:N1/NbDngAFcSLdyZ+/aYTYGSlq9qMCS/cNKGJjy+csc=
|
||||
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.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/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.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
|
||||
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
|
||||
github.com/onsi/gomega v1.20.1/go.mod h1:DtrZpjmvpn2mPm4YWQa0/ALMDj9v4YxLgojwPeREyVo=
|
||||
github.com/onsi/gomega v1.21.1/go.mod h1:iYAIXgPSaDHak0LCMA+AWBpIKBr8WZicMxnE8luStNc=
|
||||
github.com/onsi/gomega v1.22.1/go.mod h1:x6n7VNe4hw0vkyYUM4mjIXx3JbLiPaBPNgB7PRQ1tuM=
|
||||
github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg=
|
||||
github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM=
|
||||
github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM=
|
||||
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.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/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/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
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/klauspost/compress v1.18.3 h1:9PJRvfbmTabkOX8moIpXPbMMbYN60bWImDDU7L+/6zw=
|
||||
github.com/klauspost/compress v1.18.3/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4=
|
||||
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/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/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/quic-go/qpack v0.4.0/go.mod h1:UZVnYIfi5GRk+zI9UMaCPsmZ2xKJP7XBUvVyT1Knj9A=
|
||||
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.41.0 h1:aD8MmHfgqTURWNJy48IYFg2OnxwHT3JL7ahGs73lb4k=
|
||||
github.com/quic-go/quic-go v0.41.0/go.mod h1:qCkNjqczPEvgsOnxZ0eCD14lv+B2LHlFAB++CNOh9hA=
|
||||
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.6.2/go.mod h1:yil9+7qSl+gBwJqztoQseO6Pr3h62pQoY1lXiNR/FPs=
|
||||
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/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
|
||||
github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM=
|
||||
github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0=
|
||||
github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk=
|
||||
github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ=
|
||||
github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
|
||||
github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI=
|
||||
github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU=
|
||||
github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag=
|
||||
github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg=
|
||||
github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw=
|
||||
github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y=
|
||||
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
|
||||
github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q=
|
||||
github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ=
|
||||
github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I=
|
||||
github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0=
|
||||
github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ=
|
||||
github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk=
|
||||
github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4=
|
||||
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
|
||||
github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE=
|
||||
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
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.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
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/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM=
|
||||
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.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
|
||||
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/tam7t/hpkp v0.0.0-20160821193359-2b70b4024ed5 h1:YqAladjX7xpA6BM04leXMWAEjS0mTZ5kUU9KRBriQJc=
|
||||
github.com/tam7t/hpkp v0.0.0-20160821193359-2b70b4024ed5/go.mod h1:2JjD2zLQYH5HO74y5+aE3remJQvl6q4Sn6aWA2wD1Ng=
|
||||
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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA=
|
||||
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/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
|
||||
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
|
||||
golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80=
|
||||
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
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.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
|
||||
golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=
|
||||
golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M=
|
||||
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/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-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
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.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY=
|
||||
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
|
||||
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
|
||||
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
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.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20211104170005-ce137452f963/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
|
||||
golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
|
||||
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
|
||||
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.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.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
|
||||
golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
|
||||
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-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o=
|
||||
golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
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.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
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-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
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.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.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
|
||||
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
|
||||
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||
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-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
|
||||
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
|
||||
golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
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.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.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
||||
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.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U=
|
||||
golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
|
||||
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
|
||||
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||
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-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-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
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.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
|
||||
golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ=
|
||||
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.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
|
||||
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/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-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
|
||||
google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
|
||||
google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||
google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
|
||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
|
||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
|
||||
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o=
|
||||
h12.io/socks v1.0.3 h1:Ka3qaQewws4j4/eDQnOdpr4wXsC//dXtWvftlIcCQUo=
|
||||
h12.io/socks v1.0.3/go.mod h1:AIhxy1jOId/XCz9BO+EIgNL2rQiPTBNnOfnVnQ+3Eck=
|
||||
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck=
|
||||
sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=
|
||||
|
||||
5827
proto/igdbapi.pb.go
5827
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];
|
||||
}
|
||||
|
||||
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 {
|
||||
repeated AgeRatingContentDescriptionV2 ageratingcontentdescriptionsv2 = 1;
|
||||
}
|
||||
@@ -220,6 +233,7 @@ message AgeRatingContentDescriptionV2 {
|
||||
google.protobuf.Timestamp created_at = 4;
|
||||
google.protobuf.Timestamp updated_at = 5;
|
||||
string checksum = 6;
|
||||
AgeRatingContentDescriptionType description_type = 7;
|
||||
}
|
||||
|
||||
message AgeRatingOrganizationResult {
|
||||
@@ -260,6 +274,20 @@ message Artwork {
|
||||
string url = 7;
|
||||
int32 width = 8;
|
||||
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 {
|
||||
@@ -1342,6 +1370,7 @@ message ReleaseDate {
|
||||
ReleaseDateStatus status = 13;
|
||||
DateFormat date_format = 14;
|
||||
ReleaseDateRegion release_region = 15;
|
||||
int32 d = 16;
|
||||
}
|
||||
|
||||
message ReleaseDateRegionResult {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
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
|
||||
|
||||
@@ -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,358 +1,149 @@
|
||||
package igdb
|
||||
|
||||
import "github.com/bestnite/go-igdb/endpoint"
|
||||
import (
|
||||
"git.nite07.com/nite/go-igdb/endpoint"
|
||||
)
|
||||
|
||||
func registerAllEndpoints(c *Client) {
|
||||
c.AgeRatingCategories = &endpoint.AgeRatingCategories{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAgeRatingCategories),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPAgeRatingCategories] = c.AgeRatingCategories
|
||||
|
||||
c.AgeRatingContentDescriptions = &endpoint.AgeRatingContentDescriptions{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAgeRatingContentDescriptions),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPAgeRatingContentDescriptions] = c.AgeRatingContentDescriptions
|
||||
|
||||
c.AgeRatingContentDescriptionsV2 = &endpoint.AgeRatingContentDescriptionsV2{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAgeRatingContentDescriptionsV2),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPAgeRatingContentDescriptionsV2] = c.AgeRatingContentDescriptionsV2
|
||||
|
||||
c.AgeRatingOrganizations = &endpoint.AgeRatingOrganizations{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAgeRatingOrganizations),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPAgeRatingOrganizations] = c.AgeRatingOrganizations
|
||||
|
||||
c.AgeRatings = &endpoint.AgeRatings{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAgeRatings),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPAgeRatings] = c.AgeRatings
|
||||
|
||||
c.AlternativeNames = &endpoint.AlternativeNames{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAlternativeNames),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPAlternativeNames] = c.AlternativeNames
|
||||
|
||||
c.Artworks = &endpoint.Artworks{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPArtworks),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPArtworks] = c.Artworks
|
||||
|
||||
c.CharacterGenders = &endpoint.CharacterGenders{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCharacterGenders),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCharacterGenders] = c.CharacterGenders
|
||||
|
||||
c.CharacterMugShots = &endpoint.CharacterMugShots{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCharacterMugShots),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCharacterMugShots] = c.CharacterMugShots
|
||||
|
||||
c.Characters = &endpoint.Characters{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCharacters),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCharacters] = c.Characters
|
||||
|
||||
c.CharacterSpecies = &endpoint.CharacterSpecies{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCharacterSpecies),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCharacterSpecies] = c.CharacterSpecies
|
||||
|
||||
c.CollectionMemberships = &endpoint.CollectionMemberships{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollectionMemberships),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCollectionMemberships] = c.CollectionMemberships
|
||||
|
||||
c.CollectionMembershipTypes = &endpoint.CollectionMembershipTypes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollectionMembershipTypes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCollectionMembershipTypes] = c.CollectionMembershipTypes
|
||||
|
||||
c.CollectionRelations = &endpoint.CollectionRelations{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollectionRelations),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCollectionRelations] = c.CollectionRelations
|
||||
|
||||
c.CollectionRelationTypes = &endpoint.CollectionRelationTypes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollectionRelationTypes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCollectionRelationTypes] = c.CollectionRelationTypes
|
||||
|
||||
c.Collections = &endpoint.Collections{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollections),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCollections] = c.Collections
|
||||
|
||||
c.CollectionTypes = &endpoint.CollectionTypes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollectionTypes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCollectionTypes] = c.CollectionTypes
|
||||
|
||||
c.Companies = &endpoint.Companies{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCompanies),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCompanies] = c.Companies
|
||||
|
||||
c.CompanyLogos = &endpoint.CompanyLogos{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCompanyLogos),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCompanyLogos] = c.CompanyLogos
|
||||
|
||||
c.CompanyStatuses = &endpoint.CompanyStatuses{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCompanyStatuses),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCompanyStatuses] = c.CompanyStatuses
|
||||
|
||||
c.CompanyWebsites = &endpoint.CompanyWebsites{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCompanyWebsites),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCompanyWebsites] = c.CompanyWebsites
|
||||
|
||||
c.Covers = &endpoint.Covers{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCovers),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPCovers] = c.Covers
|
||||
|
||||
c.DateFormats = &endpoint.DateFormats{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPDateFormats),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPDateFormats] = c.DateFormats
|
||||
|
||||
c.EventLogos = &endpoint.EventLogos{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPEventLogos),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPEventLogos] = c.EventLogos
|
||||
|
||||
c.EventNetworks = &endpoint.EventNetworks{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPEventNetworks),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPEventNetworks] = c.EventNetworks
|
||||
|
||||
c.Events = &endpoint.Events{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPEvents),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPEvents] = c.Events
|
||||
|
||||
c.ExternalGames = &endpoint.ExternalGames{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPExternalGames),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPExternalGames] = c.ExternalGames
|
||||
|
||||
c.ExternalGameSources = &endpoint.ExternalGameSources{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPExternalGameSources),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPExternalGameSources] = c.ExternalGameSources
|
||||
|
||||
c.Franchises = &endpoint.Franchises{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPFranchises),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPFranchises] = c.Franchises
|
||||
|
||||
c.GameEngineLogos = &endpoint.GameEngineLogos{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameEngineLogos),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameEngineLogos] = c.GameEngineLogos
|
||||
|
||||
c.GameEngines = &endpoint.GameEngines{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameEngines),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameEngines] = c.GameEngines
|
||||
|
||||
c.GameLocalizations = &endpoint.GameLocalizations{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameLocalizations),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameLocalizations] = c.GameLocalizations
|
||||
|
||||
c.GameModes = &endpoint.GameModes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameModes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameModes] = c.GameModes
|
||||
|
||||
c.GameReleaseFormats = &endpoint.GameReleaseFormats{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameReleaseFormats),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameReleaseFormats] = c.GameReleaseFormats
|
||||
|
||||
c.Games = &endpoint.Games{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGames),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGames] = c.Games
|
||||
|
||||
c.GameStatuses = &endpoint.GameStatuses{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameStatuses),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameStatuses] = c.GameStatuses
|
||||
|
||||
c.GameTimeToBeats = &endpoint.GameTimeToBeats{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameTimeToBeats),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameTimeToBeats] = c.GameTimeToBeats
|
||||
|
||||
c.GameTypes = &endpoint.GameTypes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameTypes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameTypes] = c.GameTypes
|
||||
|
||||
c.GameVersionFeatures = &endpoint.GameVersionFeatures{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameVersionFeatures),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameVersionFeatures] = c.GameVersionFeatures
|
||||
|
||||
c.GameVersionFeatureValues = &endpoint.GameVersionFeatureValues{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameVersionFeatureValues),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameVersionFeatureValues] = c.GameVersionFeatureValues
|
||||
|
||||
c.GameVersions = &endpoint.GameVersions{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameVersions),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameVersions] = c.GameVersions
|
||||
|
||||
c.GameVideos = &endpoint.GameVideos{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGameVideos),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGameVideos] = c.GameVideos
|
||||
|
||||
c.Genres = &endpoint.Genres{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPGenres),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPGenres] = c.Genres
|
||||
|
||||
c.InvolvedCompanies = &endpoint.InvolvedCompanies{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPInvolvedCompanies),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPInvolvedCompanies] = c.InvolvedCompanies
|
||||
|
||||
c.Keywords = &endpoint.Keywords{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPKeywords),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPKeywords] = c.Keywords
|
||||
|
||||
c.Languages = &endpoint.Languages{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPLanguages),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPLanguages] = c.Languages
|
||||
|
||||
c.LanguageSupports = &endpoint.LanguageSupports{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPLanguageSupports),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPLanguageSupports] = c.LanguageSupports
|
||||
|
||||
c.LanguageSupportTypes = &endpoint.LanguageSupportTypes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPLanguageSupportTypes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPLanguageSupportTypes] = c.LanguageSupportTypes
|
||||
|
||||
c.MultiplayerModes = &endpoint.MultiplayerModes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPMultiplayerModes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPMultiplayerModes] = c.MultiplayerModes
|
||||
|
||||
c.NetworkTypes = &endpoint.NetworkTypes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPNetworkTypes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPNetworkTypes] = c.NetworkTypes
|
||||
|
||||
c.PlatformFamilies = &endpoint.PlatformFamilies{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPlatformFamilies),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPlatformFamilies] = c.PlatformFamilies
|
||||
|
||||
c.PlatformLogos = &endpoint.PlatformLogos{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPlatformLogos),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPlatformLogos] = c.PlatformLogos
|
||||
|
||||
c.Platforms = &endpoint.Platforms{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPlatforms),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPlatforms] = c.Platforms
|
||||
|
||||
c.PlatformTypes = &endpoint.PlatformTypes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPlatformTypes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPlatformTypes] = c.PlatformTypes
|
||||
|
||||
c.PlatformVersionCompanies = &endpoint.PlatformVersionCompanies{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPlatformVersionCompanies),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPlatformVersionCompanies] = c.PlatformVersionCompanies
|
||||
|
||||
c.PlatformVersionReleaseDates = &endpoint.PlatformVersionReleaseDates{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPlatformVersionReleaseDates),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPlatformVersionReleaseDates] = c.PlatformVersionReleaseDates
|
||||
|
||||
c.PlatformVersions = &endpoint.PlatformVersions{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPlatformVersions),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPlatformVersions] = c.PlatformVersions
|
||||
|
||||
c.PlatformWebsites = &endpoint.PlatformWebsites{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPlatformWebsites),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPlatformWebsites] = c.PlatformWebsites
|
||||
|
||||
c.PlayerPerspectives = &endpoint.PlayerPerspectives{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPlayerPerspectives),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPlayerPerspectives] = c.PlayerPerspectives
|
||||
|
||||
c.PopularityPrimitives = &endpoint.PopularityPrimitives{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPopularityPrimitives),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPopularityPrimitives] = c.PopularityPrimitives
|
||||
|
||||
c.PopularityTypes = &endpoint.PopularityTypes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPPopularityTypes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPPopularityTypes] = c.PopularityTypes
|
||||
|
||||
c.Regions = &endpoint.Regions{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPRegions),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPRegions] = c.Regions
|
||||
|
||||
c.ReleaseDateRegions = &endpoint.ReleaseDateRegions{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPReleaseDateRegions),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPReleaseDateRegions] = c.ReleaseDateRegions
|
||||
|
||||
c.ReleaseDates = &endpoint.ReleaseDates{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPReleaseDates),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPReleaseDates] = c.ReleaseDates
|
||||
|
||||
c.ReleaseDateStatuses = &endpoint.ReleaseDateStatuses{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPReleaseDateStatuses),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPReleaseDateStatuses] = c.ReleaseDateStatuses
|
||||
|
||||
c.Screenshots = &endpoint.Screenshots{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPScreenshots),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPScreenshots] = c.Screenshots
|
||||
|
||||
c.Themes = &endpoint.Themes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPThemes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPThemes] = c.Themes
|
||||
|
||||
c.Websites = &endpoint.Websites{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPWebsites),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPWebsites] = c.Websites
|
||||
|
||||
c.WebsiteTypes = &endpoint.WebsiteTypes{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPWebsiteTypes),
|
||||
}
|
||||
c.EntityEndpoints[endpoint.EPWebsiteTypes] = c.WebsiteTypes
|
||||
|
||||
c.Webhooks = &endpoint.Webhooks{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPWebhooks),
|
||||
}
|
||||
|
||||
c.Search = &endpoint.Search{
|
||||
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPSearch),
|
||||
}
|
||||
c.AgeRatingCategories = endpoint.NewAgeRatingCategories(c.Request)
|
||||
|
||||
c.AgeRatingContentDescriptions = endpoint.NewAgeRatingContentDescriptions(c.Request)
|
||||
|
||||
c.AgeRatingContentDescriptionsV2 = endpoint.NewAgeRatingContentDescriptionsV2(c.Request)
|
||||
|
||||
c.AgeRatingOrganizations = endpoint.NewAgeRatingOrganizations(c.Request)
|
||||
|
||||
c.AgeRatings = endpoint.NewAgeRatings(c.Request)
|
||||
|
||||
c.AlternativeNames = endpoint.NewAlternativeNames(c.Request)
|
||||
|
||||
c.Artworks = endpoint.NewArtworks(c.Request)
|
||||
|
||||
c.CharacterGenders = endpoint.NewCharacterGenders(c.Request)
|
||||
|
||||
c.CharacterMugShots = endpoint.NewCharacterMugShots(c.Request)
|
||||
|
||||
c.Characters = endpoint.NewCharacters(c.Request)
|
||||
|
||||
c.CharacterSpecies = endpoint.NewCharacterSpecies(c.Request)
|
||||
|
||||
c.CollectionMemberships = endpoint.NewCollectionMemberships(c.Request)
|
||||
|
||||
c.CollectionMembershipTypes = endpoint.NewCollectionMembershipTypes(c.Request)
|
||||
|
||||
c.CollectionRelations = endpoint.NewCollectionRelations(c.Request)
|
||||
|
||||
c.CollectionRelationTypes = endpoint.NewCollectionRelationTypes(c.Request)
|
||||
|
||||
c.Collections = endpoint.NewCollections(c.Request)
|
||||
|
||||
c.CollectionTypes = endpoint.NewCollectionTypes(c.Request)
|
||||
|
||||
c.Companies = endpoint.NewCompanies(c.Request)
|
||||
|
||||
c.CompanyLogos = endpoint.NewCompanyLogos(c.Request)
|
||||
|
||||
c.CompanyStatuses = endpoint.NewCompanyStatuses(c.Request)
|
||||
|
||||
c.CompanyWebsites = endpoint.NewCompanyWebsites(c.Request)
|
||||
|
||||
c.Covers = endpoint.NewCovers(c.Request)
|
||||
|
||||
c.DateFormats = endpoint.NewDateFormats(c.Request)
|
||||
|
||||
c.EventLogos = endpoint.NewEventLogos(c.Request)
|
||||
|
||||
c.EventNetworks = endpoint.NewEventNetworks(c.Request)
|
||||
|
||||
c.Events = endpoint.NewEvents(c.Request)
|
||||
|
||||
c.ExternalGames = endpoint.NewExternalGames(c.Request)
|
||||
|
||||
c.ExternalGameSources = endpoint.NewExternalGameSources(c.Request)
|
||||
|
||||
c.Franchises = endpoint.NewFranchises(c.Request)
|
||||
|
||||
c.GameEngineLogos = endpoint.NewGameEngineLogos(c.Request)
|
||||
|
||||
c.GameEngines = endpoint.NewGameEngines(c.Request)
|
||||
|
||||
c.GameLocalizations = endpoint.NewGameLocalizations(c.Request)
|
||||
|
||||
c.GameModes = endpoint.NewGameModes(c.Request)
|
||||
|
||||
c.GameReleaseFormats = endpoint.NewGameReleaseFormats(c.Request)
|
||||
|
||||
c.Games = endpoint.NewGames(c.Request)
|
||||
|
||||
c.GameStatuses = endpoint.NewGameStatuses(c.Request)
|
||||
|
||||
c.GameTimeToBeats = endpoint.NewGameTimeToBeats(c.Request)
|
||||
|
||||
c.GameTypes = endpoint.NewGameTypes(c.Request)
|
||||
|
||||
c.GameVersionFeatures = endpoint.NewGameVersionFeatures(c.Request)
|
||||
|
||||
c.GameVersionFeatureValues = endpoint.NewGameVersionFeatureValues(c.Request)
|
||||
|
||||
c.GameVersions = endpoint.NewGameVersions(c.Request)
|
||||
|
||||
c.GameVideos = endpoint.NewGameVideos(c.Request)
|
||||
|
||||
c.Genres = endpoint.NewGenres(c.Request)
|
||||
|
||||
c.InvolvedCompanies = endpoint.NewInvolvedCompanies(c.Request)
|
||||
|
||||
c.Keywords = endpoint.NewKeywords(c.Request)
|
||||
|
||||
c.Languages = endpoint.NewLanguages(c.Request)
|
||||
|
||||
c.LanguageSupports = endpoint.NewLanguageSupports(c.Request)
|
||||
|
||||
c.LanguageSupportTypes = endpoint.NewLanguageSupportTypes(c.Request)
|
||||
|
||||
c.MultiplayerModes = endpoint.NewMultiplayerModes(c.Request)
|
||||
|
||||
c.NetworkTypes = endpoint.NewNetworkTypes(c.Request)
|
||||
|
||||
c.PlatformFamilies = endpoint.NewPlatformFamilies(c.Request)
|
||||
|
||||
c.PlatformLogos = endpoint.NewPlatformLogos(c.Request)
|
||||
|
||||
c.Platforms = endpoint.NewPlatforms(c.Request)
|
||||
|
||||
c.PlatformTypes = endpoint.NewPlatformTypes(c.Request)
|
||||
|
||||
c.PlatformVersionCompanies = endpoint.NewPlatformVersionCompanies(c.Request)
|
||||
|
||||
c.PlatformVersionReleaseDates = endpoint.NewPlatformVersionReleaseDates(c.Request)
|
||||
|
||||
c.PlatformVersions = endpoint.NewPlatformVersions(c.Request)
|
||||
|
||||
c.PlatformWebsites = endpoint.NewPlatformWebsites(c.Request)
|
||||
|
||||
c.PlayerPerspectives = endpoint.NewPlayerPerspectives(c.Request)
|
||||
|
||||
c.PopularityPrimitives = endpoint.NewPopularityPrimitives(c.Request)
|
||||
|
||||
c.PopularityTypes = endpoint.NewPopularityTypes(c.Request)
|
||||
|
||||
c.Regions = endpoint.NewRegions(c.Request)
|
||||
|
||||
c.ReleaseDateRegions = endpoint.NewReleaseDateRegions(c.Request)
|
||||
|
||||
c.ReleaseDates = endpoint.NewReleaseDates(c.Request)
|
||||
|
||||
c.ReleaseDateStatuses = endpoint.NewReleaseDateStatuses(c.Request)
|
||||
|
||||
c.Screenshots = endpoint.NewScreenshots(c.Request)
|
||||
|
||||
c.Themes = endpoint.NewThemes(c.Request)
|
||||
|
||||
c.Websites = endpoint.NewWebsites(c.Request)
|
||||
|
||||
c.WebsiteTypes = endpoint.NewWebsiteTypes(c.Request)
|
||||
|
||||
c.Webhooks = endpoint.NewWebhooks(c.Request)
|
||||
|
||||
c.Search = endpoint.NewSearch(c.Request)
|
||||
}
|
||||
|
||||
26
request.go
26
request.go
@@ -7,23 +7,19 @@ import (
|
||||
"github.com/go-resty/resty/v2"
|
||||
)
|
||||
|
||||
var client *resty.Client
|
||||
type SilentLogger struct{}
|
||||
|
||||
func init() {
|
||||
client = resty.New()
|
||||
client.SetRetryCount(3).SetRetryWaitTime(3 * time.Second).AddRetryCondition(
|
||||
func (s SilentLogger) Errorf(string, ...any) {}
|
||||
func (s SilentLogger) Warnf(string, ...any) {}
|
||||
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 {
|
||||
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(format string, v ...interface{}) {}
|
||||
func (d disableLogger) Warnf(format string, v ...interface{}) {}
|
||||
func (d disableLogger) Debugf(format string, v ...interface{}) {}
|
||||
|
||||
11
token.go
11
token.go
@@ -1,6 +1,7 @@
|
||||
package igdb
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/url"
|
||||
@@ -14,18 +15,18 @@ type twitchToken struct {
|
||||
expires time.Time
|
||||
}
|
||||
|
||||
func NewTwitchToken(clientID, clientSecret string) *twitchToken {
|
||||
func newTwitchToken(clientID, clientSecret string) *twitchToken {
|
||||
return &twitchToken{
|
||||
clientID: clientID,
|
||||
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) {
|
||||
return t.token, nil
|
||||
}
|
||||
token, expires, err := t.loginTwitch()
|
||||
token, expires, err := t.LoginTwitch(ctx)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to login twitch: %w", err)
|
||||
}
|
||||
@@ -34,7 +35,7 @@ func (t *twitchToken) getToken() (string, error) {
|
||||
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")
|
||||
params := url.Values{}
|
||||
params.Add("client_id", t.clientID)
|
||||
@@ -42,7 +43,7 @@ func (t *twitchToken) loginTwitch() (string, time.Duration, error) {
|
||||
params.Add("grant_type", "client_credentials")
|
||||
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 {
|
||||
return "", 0, fmt.Errorf("failed to make request: %s: %w", baseURL.String(), err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user