mirror of
https://github.com/bestnite/go-igdb.git
synced 2025-04-20 03:05:54 +08:00
Compare commits
No commits in common. "194e84c258eadd071fd0c6488e7a6b02ca1f752b" and "f88ba544c28e31e42630a2cd37840d9372356153" have entirely different histories.
194e84c258
...
f88ba544c2
23
README.md
23
README.md
@ -29,7 +29,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Test1(c *igdb.Client) {
|
func Test1(c *igdb.Client) {
|
||||||
game, err := c.Games.GetByID(1942)
|
game, err := igdb.GetItemByID(1942, c.Games.Query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ func Test1(c *igdb.Client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test2(c *igdb.Client) {
|
func Test2(c *igdb.Client) {
|
||||||
games, err := c.Games.GetByIDs([]uint64{119171, 119133})
|
games, err := igdb.GetItemsByIDs([]uint64{119171, 119133}, c.Games.Query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ func Test2(c *igdb.Client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test3(c *igdb.Client) {
|
func Test3(c *igdb.Client) {
|
||||||
total, err := c.Games.GetLastOneId()
|
total, err := igdb.GetItemsLength(c.Games.Query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ func Test3(c *igdb.Client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Test4(c *igdb.Client) {
|
func Test4(c *igdb.Client) {
|
||||||
games, err := c.Games.Paginated(0, 10)
|
games, err := igdb.GetItemsPagniated(0, 10, c.Games.Query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -93,6 +93,21 @@ func main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Advanced Usage
|
||||||
|
|
||||||
|
### Using with FlareSolverr
|
||||||
|
|
||||||
|
```go
|
||||||
|
import "github.com/bestnite/go-flaresolverr"
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Contributions are welcome! Please feel free to submit a Pull Request.
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
||||||
|
76
client.go
76
client.go
@ -2,6 +2,7 @@ package igdb
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/bestnite/go-flaresolverr"
|
"github.com/bestnite/go-flaresolverr"
|
||||||
"github.com/bestnite/go-igdb/endpoint"
|
"github.com/bestnite/go-igdb/endpoint"
|
||||||
@ -15,6 +16,8 @@ type Client struct {
|
|||||||
flaresolverr *flaresolverr.Flaresolverr
|
flaresolverr *flaresolverr.Flaresolverr
|
||||||
limiter *rateLimiter
|
limiter *rateLimiter
|
||||||
|
|
||||||
|
EntityEndpoints map[endpoint.EndpointName]endpoint.EntityEndpoint
|
||||||
|
|
||||||
AgeRatingCategories *endpoint.AgeRatingCategories
|
AgeRatingCategories *endpoint.AgeRatingCategories
|
||||||
AgeRatingContentDescriptions *endpoint.AgeRatingContentDescriptions
|
AgeRatingContentDescriptions *endpoint.AgeRatingContentDescriptions
|
||||||
AgeRatingContentDescriptionsV2 *endpoint.AgeRatingContentDescriptionsV2
|
AgeRatingContentDescriptionsV2 *endpoint.AgeRatingContentDescriptionsV2
|
||||||
@ -90,10 +93,11 @@ type Client struct {
|
|||||||
|
|
||||||
func New(clientID, clientSecret string) *Client {
|
func New(clientID, clientSecret string) *Client {
|
||||||
c := &Client{
|
c := &Client{
|
||||||
clientID: clientID,
|
clientID: clientID,
|
||||||
limiter: newRateLimiter(4),
|
limiter: newRateLimiter(4),
|
||||||
token: NewTwitchToken(clientID, clientSecret),
|
token: NewTwitchToken(clientID, clientSecret),
|
||||||
flaresolverr: nil,
|
flaresolverr: nil,
|
||||||
|
EntityEndpoints: make(map[endpoint.EndpointName]endpoint.EntityEndpoint),
|
||||||
}
|
}
|
||||||
|
|
||||||
registerAllEndpoints(c)
|
registerAllEndpoints(c)
|
||||||
@ -127,3 +131,67 @@ func (g *Client) Request(URL string, dataBody any) (*resty.Response, error) {
|
|||||||
}
|
}
|
||||||
return resp, nil
|
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
|
||||||
|
}
|
||||||
|
@ -4,24 +4,12 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AgeRatingCategories struct {
|
type AgeRatingCategories struct {
|
||||||
BaseEndpoint[pb.AgeRatingCategory]
|
BaseEndpoint
|
||||||
}
|
|
||||||
|
|
||||||
func NewAgeRatingCategories(request func(URL string, dataBody any) (*resty.Response, error)) *AgeRatingCategories {
|
|
||||||
a := &AgeRatingCategories{
|
|
||||||
BaseEndpoint: BaseEndpoint[pb.AgeRatingCategory]{
|
|
||||||
endpointName: EPAgeRatingCategories,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AgeRatingCategories) Query(query string) ([]*pb.AgeRatingCategory, error) {
|
func (a *AgeRatingCategories) Query(query string) ([]*pb.AgeRatingCategory, error) {
|
||||||
|
@ -4,24 +4,12 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AgeRatingContentDescriptions struct {
|
type AgeRatingContentDescriptions struct {
|
||||||
BaseEndpoint[pb.AgeRatingContentDescription]
|
BaseEndpoint
|
||||||
}
|
|
||||||
|
|
||||||
func NewAgeRatingContentDescriptions(request func(URL string, dataBody any) (*resty.Response, error)) *AgeRatingContentDescriptions {
|
|
||||||
a := &AgeRatingContentDescriptions{
|
|
||||||
BaseEndpoint[pb.AgeRatingContentDescription]{
|
|
||||||
endpointName: EPAgeRatingContentDescriptions,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AgeRatingContentDescriptions) Query(query string) ([]*pb.AgeRatingContentDescription, error) {
|
func (a *AgeRatingContentDescriptions) Query(query string) ([]*pb.AgeRatingContentDescription, error) {
|
||||||
|
@ -4,24 +4,12 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AgeRatingContentDescriptionsV2 struct {
|
type AgeRatingContentDescriptionsV2 struct {
|
||||||
BaseEndpoint[pb.AgeRatingContentDescriptionV2]
|
BaseEndpoint
|
||||||
}
|
|
||||||
|
|
||||||
func NewAgeRatingContentDescriptionsV2(request func(URL string, dataBody any) (*resty.Response, error)) *AgeRatingContentDescriptionsV2 {
|
|
||||||
a := &AgeRatingContentDescriptionsV2{
|
|
||||||
BaseEndpoint[pb.AgeRatingContentDescriptionV2]{
|
|
||||||
endpointName: EPAgeRatingContentDescriptionsV2,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AgeRatingContentDescriptionsV2) Query(query string) ([]*pb.AgeRatingContentDescriptionV2, error) {
|
func (a *AgeRatingContentDescriptionsV2) Query(query string) ([]*pb.AgeRatingContentDescriptionV2, error) {
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AgeRatingOrganizations struct {
|
type AgeRatingOrganizations struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.AgeRatingOrganization]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewAgeRatingOrganizations(request func(URL string, dataBody any) (*resty.Response, error)) *AgeRatingOrganizations {
|
|
||||||
a := &AgeRatingOrganizations{
|
|
||||||
BaseEndpoint[pb.AgeRatingOrganization]{
|
|
||||||
endpointName: EPAgeRatingOrganizations,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *AgeRatingOrganizations) Query(query string) ([]*pb.AgeRatingOrganization, error) {
|
func (a *AgeRatingOrganizations) Query(query string) ([]*pb.AgeRatingOrganization, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/age_rating_organizations.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/age_rating_organizations.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AgeRatings struct {
|
type AgeRatings struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.AgeRating]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewAgeRatings(request func(URL string, dataBody any) (*resty.Response, error)) *AgeRatings {
|
|
||||||
a := &AgeRatings{
|
|
||||||
BaseEndpoint[pb.AgeRating]{
|
|
||||||
endpointName: EPAgeRatings,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *AgeRatings) Query(query string) ([]*pb.AgeRating, error) {
|
func (a *AgeRatings) Query(query string) ([]*pb.AgeRating, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/age_ratings.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/age_ratings.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type AlternativeNames struct {
|
type AlternativeNames struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.AlternativeName]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewAlternativeNames(request func(URL string, dataBody any) (*resty.Response, error)) *AlternativeNames {
|
|
||||||
a := &AlternativeNames{
|
|
||||||
BaseEndpoint[pb.AlternativeName]{
|
|
||||||
endpointName: EPAlternativeNames,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *AlternativeNames) Query(query string) ([]*pb.AlternativeName, error) {
|
func (a *AlternativeNames) Query(query string) ([]*pb.AlternativeName, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/alternative_names.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/alternative_names.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Artworks struct {
|
type Artworks struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Artwork]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewArtworks(request func(URL string, dataBody any) (*resty.Response, error)) *Artworks {
|
|
||||||
a := &Artworks{
|
|
||||||
BaseEndpoint[pb.Artwork]{
|
|
||||||
endpointName: EPArtworks,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Artworks) Query(query string) ([]*pb.Artwork, error) {
|
func (a *Artworks) Query(query string) ([]*pb.Artwork, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/artworks.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/artworks.pb", query)
|
||||||
|
@ -1,79 +1,38 @@
|
|||||||
package endpoint
|
package endpoint
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
type BaseEndpoint[T any] struct {
|
type BaseEndpoint struct {
|
||||||
request func(URL string, dataBody any) (*resty.Response, error)
|
request func(URL string, dataBody any) (*resty.Response, error)
|
||||||
endpointName EndpointName
|
endpointName EndpointName
|
||||||
queryFunc func(string) ([]*T, error)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) GetEndpointName() EndpointName {
|
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 {
|
||||||
return b.endpointName
|
return b.endpointName
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) Query(query string) ([]*T, error) {
|
func (b *BaseEndpoint) Query(query string) (any, error) {
|
||||||
if b.queryFunc == nil {
|
return nil, nil
|
||||||
return nil, fmt.Errorf("Query method must be implemented by specific endpoint")
|
|
||||||
}
|
|
||||||
return b.queryFunc(query)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) GetByID(id uint64) (*T, error) {
|
func (b *BaseEndpoint) QueryAny(query string) (any, error) {
|
||||||
res, err := b.Query(fmt.Sprintf("where id = %d; fields *;", id))
|
return b.Query(query)
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if len(res) == 0 {
|
|
||||||
return nil, fmt.Errorf("no results")
|
|
||||||
}
|
|
||||||
return res[0], nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) GetByIDs(ids []uint64) ([]*T, error) {
|
type Endpoint interface {
|
||||||
builder := strings.Builder{}
|
GetEndpointName() EndpointName
|
||||||
for i, v := range ids {
|
}
|
||||||
if i > 0 {
|
|
||||||
builder.WriteByte(',')
|
type EntityEndpoint interface {
|
||||||
}
|
QueryAny(query string) (any, error)
|
||||||
builder.WriteString(strconv.FormatUint(v, 10))
|
|
||||||
}
|
|
||||||
return b.Query(fmt.Sprintf("where id = (%s); fields *;", builder.String()))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) GetLastOneId() (uint64, error) {
|
|
||||||
res, err := b.Query("fields *; sort id desc; limit 1;")
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
if len(res) == 0 {
|
|
||||||
return 0, fmt.Errorf("no results")
|
|
||||||
}
|
|
||||||
type IdGetter interface {
|
|
||||||
GetId() uint64
|
|
||||||
}
|
|
||||||
item, ok := any(res[0]).(IdGetter)
|
|
||||||
if !ok {
|
|
||||||
return 0, fmt.Errorf("invalid type")
|
|
||||||
}
|
|
||||||
return item.GetId(), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *BaseEndpoint[T]) Paginated(offset, limit uint64) ([]*T, error) {
|
|
||||||
return b.Query(fmt.Sprintf("offset %d; limit %d; fields *; sort id asc;", offset, limit))
|
|
||||||
}
|
|
||||||
|
|
||||||
type EntityEndpoint[T any] interface {
|
|
||||||
GetEndpointName() EndpointName
|
GetEndpointName() EndpointName
|
||||||
Query(string) ([]*T, error)
|
|
||||||
GetByID(uint64) (*T, error)
|
|
||||||
GetByIDs([]uint64) ([]*T, error)
|
|
||||||
GetLastOneId() (uint64, error)
|
|
||||||
Paginated(uint64, uint64) ([]*T, error)
|
|
||||||
}
|
}
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CharacterGenders struct {
|
type CharacterGenders struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CharacterGender]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCharacterGenders(request func(URL string, dataBody any) (*resty.Response, error)) *CharacterGenders {
|
|
||||||
a := &CharacterGenders{
|
|
||||||
BaseEndpoint[pb.CharacterGender]{
|
|
||||||
endpointName: EPCharacterGenders,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CharacterGenders) Query(query string) ([]*pb.CharacterGender, error) {
|
func (a *CharacterGenders) Query(query string) ([]*pb.CharacterGender, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/character_genders.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/character_genders.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CharacterMugShots struct {
|
type CharacterMugShots struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CharacterMugShot]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCharacterMugShots(request func(URL string, dataBody any) (*resty.Response, error)) *CharacterMugShots {
|
|
||||||
a := &CharacterMugShots{
|
|
||||||
BaseEndpoint[pb.CharacterMugShot]{
|
|
||||||
endpointName: EPCharacterMugShots,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CharacterMugShots) Query(query string) ([]*pb.CharacterMugShot, error) {
|
func (a *CharacterMugShots) Query(query string) ([]*pb.CharacterMugShot, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/character_mug_shots.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/character_mug_shots.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CharacterSpecies struct {
|
type CharacterSpecies struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CharacterSpecie]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCharacterSpecies(request func(URL string, dataBody any) (*resty.Response, error)) *CharacterSpecies {
|
|
||||||
a := &CharacterSpecies{
|
|
||||||
BaseEndpoint[pb.CharacterSpecie]{
|
|
||||||
endpointName: EPCharacterSpecies,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CharacterSpecies) Query(query string) ([]*pb.CharacterSpecie, error) {
|
func (a *CharacterSpecies) Query(query string) ([]*pb.CharacterSpecie, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/character_species.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/character_species.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Characters struct {
|
type Characters struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Character]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCharacters(request func(URL string, dataBody any) (*resty.Response, error)) *Characters {
|
|
||||||
a := &Characters{
|
|
||||||
BaseEndpoint[pb.Character]{
|
|
||||||
endpointName: EPCharacters,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Characters) Query(query string) ([]*pb.Character, error) {
|
func (a *Characters) Query(query string) ([]*pb.Character, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/characters.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/characters.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CollectionMembershipTypes struct {
|
type CollectionMembershipTypes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CollectionMembershipType]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCollectionMembershipTypes(request func(URL string, dataBody any) (*resty.Response, error)) *CollectionMembershipTypes {
|
|
||||||
a := &CollectionMembershipTypes{
|
|
||||||
BaseEndpoint[pb.CollectionMembershipType]{
|
|
||||||
endpointName: EPCollectionMembershipTypes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CollectionMembershipTypes) Query(query string) ([]*pb.CollectionMembershipType, error) {
|
func (a *CollectionMembershipTypes) Query(query string) ([]*pb.CollectionMembershipType, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/collection_membership_types.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/collection_membership_types.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CollectionMemberships struct {
|
type CollectionMemberships struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CollectionMembership]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCollectionMemberships(request func(URL string, dataBody any) (*resty.Response, error)) *CollectionMemberships {
|
|
||||||
a := &CollectionMemberships{
|
|
||||||
BaseEndpoint[pb.CollectionMembership]{
|
|
||||||
endpointName: EPCollectionMemberships,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CollectionMemberships) Query(query string) ([]*pb.CollectionMembership, error) {
|
func (a *CollectionMemberships) Query(query string) ([]*pb.CollectionMembership, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/collection_memberships.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/collection_memberships.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CollectionRelationTypes struct {
|
type CollectionRelationTypes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CollectionRelationType]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCollectionRelationTypes(request func(URL string, dataBody any) (*resty.Response, error)) *CollectionRelationTypes {
|
|
||||||
a := &CollectionRelationTypes{
|
|
||||||
BaseEndpoint[pb.CollectionRelationType]{
|
|
||||||
endpointName: EPCollectionRelationTypes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CollectionRelationTypes) Query(query string) ([]*pb.CollectionRelationType, error) {
|
func (a *CollectionRelationTypes) Query(query string) ([]*pb.CollectionRelationType, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/collection_relation_types.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/collection_relation_types.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CollectionRelations struct {
|
type CollectionRelations struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CollectionRelation]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCollectionRelations(request func(URL string, dataBody any) (*resty.Response, error)) *CollectionRelations {
|
|
||||||
a := &CollectionRelations{
|
|
||||||
BaseEndpoint[pb.CollectionRelation]{
|
|
||||||
endpointName: EPCollectionRelations,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CollectionRelations) Query(query string) ([]*pb.CollectionRelation, error) {
|
func (a *CollectionRelations) Query(query string) ([]*pb.CollectionRelation, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/collection_relations.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/collection_relations.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CollectionTypes struct {
|
type CollectionTypes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CollectionType]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCollectionTypes(request func(URL string, dataBody any) (*resty.Response, error)) *CollectionTypes {
|
|
||||||
a := &CollectionTypes{
|
|
||||||
BaseEndpoint[pb.CollectionType]{
|
|
||||||
endpointName: EPCollectionTypes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CollectionTypes) Query(query string) ([]*pb.CollectionType, error) {
|
func (a *CollectionTypes) Query(query string) ([]*pb.CollectionType, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/collection_types.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/collection_types.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Collections struct {
|
type Collections struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Collection]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCollections(request func(URL string, dataBody any) (*resty.Response, error)) *Collections {
|
|
||||||
a := &Collections{
|
|
||||||
BaseEndpoint[pb.Collection]{
|
|
||||||
endpointName: EPCollections,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Collections) Query(query string) ([]*pb.Collection, error) {
|
func (a *Collections) Query(query string) ([]*pb.Collection, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/collections.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/collections.pb", query)
|
||||||
|
@ -5,25 +5,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Companies struct {
|
type Companies struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Company]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCompanies(request func(URL string, dataBody any) (*resty.Response, error)) *Companies {
|
|
||||||
a := &Companies{
|
|
||||||
BaseEndpoint[pb.Company]{
|
|
||||||
endpointName: EPCompanies,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Companies) Query(query string) ([]*pb.Company, error) {
|
func (a *Companies) Query(query string) ([]*pb.Company, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/companies.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/companies.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CompanyLogos struct {
|
type CompanyLogos struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CompanyLogo]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCompanyLogos(request func(URL string, dataBody any) (*resty.Response, error)) *CompanyLogos {
|
|
||||||
a := &CompanyLogos{
|
|
||||||
BaseEndpoint[pb.CompanyLogo]{
|
|
||||||
endpointName: EPCompanyLogos,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CompanyLogos) Query(query string) ([]*pb.CompanyLogo, error) {
|
func (a *CompanyLogos) Query(query string) ([]*pb.CompanyLogo, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/company_logos.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/company_logos.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CompanyStatuses struct {
|
type CompanyStatuses struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CompanyStatus]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCompanyStatuses(request func(URL string, dataBody any) (*resty.Response, error)) *CompanyStatuses {
|
|
||||||
a := &CompanyStatuses{
|
|
||||||
BaseEndpoint[pb.CompanyStatus]{
|
|
||||||
endpointName: EPCompanyStatuses,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CompanyStatuses) Query(query string) ([]*pb.CompanyStatus, error) {
|
func (a *CompanyStatuses) Query(query string) ([]*pb.CompanyStatus, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/company_statuses.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/company_statuses.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CompanyWebsites struct {
|
type CompanyWebsites struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.CompanyWebsite]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCompanyWebsites(request func(URL string, dataBody any) (*resty.Response, error)) *CompanyWebsites {
|
|
||||||
a := &CompanyWebsites{
|
|
||||||
BaseEndpoint[pb.CompanyWebsite]{
|
|
||||||
endpointName: EPCompanyWebsites,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *CompanyWebsites) Query(query string) ([]*pb.CompanyWebsite, error) {
|
func (a *CompanyWebsites) Query(query string) ([]*pb.CompanyWebsite, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/company_websites.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/company_websites.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Covers struct {
|
type Covers struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Cover]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewCovers(request func(URL string, dataBody any) (*resty.Response, error)) *Covers {
|
|
||||||
a := &Covers{
|
|
||||||
BaseEndpoint[pb.Cover]{
|
|
||||||
endpointName: EPCovers,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Covers) Query(query string) ([]*pb.Cover, error) {
|
func (a *Covers) Query(query string) ([]*pb.Cover, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/covers.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/covers.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DateFormats struct {
|
type DateFormats struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.DateFormat]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewDateFormats(request func(URL string, dataBody any) (*resty.Response, error)) *DateFormats {
|
|
||||||
a := &DateFormats{
|
|
||||||
BaseEndpoint[pb.DateFormat]{
|
|
||||||
endpointName: EPDateFormats,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *DateFormats) Query(query string) ([]*pb.DateFormat, error) {
|
func (a *DateFormats) Query(query string) ([]*pb.DateFormat, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/date_formats.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/date_formats.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type EventLogos struct {
|
type EventLogos struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.EventLogo]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewEventLogos(request func(URL string, dataBody any) (*resty.Response, error)) *EventLogos {
|
|
||||||
a := &EventLogos{
|
|
||||||
BaseEndpoint[pb.EventLogo]{
|
|
||||||
endpointName: EPEventLogos,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *EventLogos) Query(query string) ([]*pb.EventLogo, error) {
|
func (a *EventLogos) Query(query string) ([]*pb.EventLogo, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/event_logos.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/event_logos.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type EventNetworks struct {
|
type EventNetworks struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.EventNetwork]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewEventNetworks(request func(URL string, dataBody any) (*resty.Response, error)) *EventNetworks {
|
|
||||||
a := &EventNetworks{
|
|
||||||
BaseEndpoint[pb.EventNetwork]{
|
|
||||||
endpointName: EPEventNetworks,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *EventNetworks) Query(query string) ([]*pb.EventNetwork, error) {
|
func (a *EventNetworks) Query(query string) ([]*pb.EventNetwork, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/event_networks.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/event_networks.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Events struct {
|
type Events struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Event]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewEvents(request func(URL string, dataBody any) (*resty.Response, error)) *Events {
|
|
||||||
a := &Events{
|
|
||||||
BaseEndpoint[pb.Event]{
|
|
||||||
endpointName: EPEvents,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Events) Query(query string) ([]*pb.Event, error) {
|
func (a *Events) Query(query string) ([]*pb.Event, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/events.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/events.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ExternalGameSources struct {
|
type ExternalGameSources struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.ExternalGameSource]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewExternalGameSources(request func(URL string, dataBody any) (*resty.Response, error)) *ExternalGameSources {
|
|
||||||
a := &ExternalGameSources{
|
|
||||||
BaseEndpoint[pb.ExternalGameSource]{
|
|
||||||
endpointName: EPExternalGameSources,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *ExternalGameSources) Query(query string) ([]*pb.ExternalGameSource, error) {
|
func (a *ExternalGameSources) Query(query string) ([]*pb.ExternalGameSource, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/external_game_sources.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/external_game_sources.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ExternalGames struct {
|
type ExternalGames struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.ExternalGame]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewExternalGames(request func(URL string, dataBody any) (*resty.Response, error)) *ExternalGames {
|
|
||||||
a := &ExternalGames{
|
|
||||||
BaseEndpoint[pb.ExternalGame]{
|
|
||||||
endpointName: EPExternalGames,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *ExternalGames) Query(query string) ([]*pb.ExternalGame, error) {
|
func (a *ExternalGames) Query(query string) ([]*pb.ExternalGame, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/external_games.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/external_games.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Franchises struct {
|
type Franchises struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Franchise]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewFranchises(request func(URL string, dataBody any) (*resty.Response, error)) *Franchises {
|
|
||||||
a := &Franchises{
|
|
||||||
BaseEndpoint[pb.Franchise]{
|
|
||||||
endpointName: EPFranchises,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Franchises) Query(query string) ([]*pb.Franchise, error) {
|
func (a *Franchises) Query(query string) ([]*pb.Franchise, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/franchises.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/franchises.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameEngineLogos struct {
|
type GameEngineLogos struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameEngineLogo]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameEngineLogos(request func(URL string, dataBody any) (*resty.Response, error)) *GameEngineLogos {
|
|
||||||
a := &GameEngineLogos{
|
|
||||||
BaseEndpoint[pb.GameEngineLogo]{
|
|
||||||
endpointName: EPGameEngineLogos,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameEngineLogos) Query(query string) ([]*pb.GameEngineLogo, error) {
|
func (a *GameEngineLogos) Query(query string) ([]*pb.GameEngineLogo, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_engine_logos.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_engine_logos.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameEngines struct {
|
type GameEngines struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameEngine]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameEngines(request func(URL string, dataBody any) (*resty.Response, error)) *GameEngines {
|
|
||||||
a := &GameEngines{
|
|
||||||
BaseEndpoint[pb.GameEngine]{
|
|
||||||
endpointName: EPGameEngines,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameEngines) Query(query string) ([]*pb.GameEngine, error) {
|
func (a *GameEngines) Query(query string) ([]*pb.GameEngine, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_engines.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_engines.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameLocalizations struct {
|
type GameLocalizations struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameLocalization]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameLocalizations(request func(URL string, dataBody any) (*resty.Response, error)) *GameLocalizations {
|
|
||||||
a := &GameLocalizations{
|
|
||||||
BaseEndpoint[pb.GameLocalization]{
|
|
||||||
endpointName: EPGameLocalizations,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameLocalizations) Query(query string) ([]*pb.GameLocalization, error) {
|
func (a *GameLocalizations) Query(query string) ([]*pb.GameLocalization, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_localizations.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_localizations.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameModes struct {
|
type GameModes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameMode]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameModes(request func(URL string, dataBody any) (*resty.Response, error)) *GameModes {
|
|
||||||
a := &GameModes{
|
|
||||||
BaseEndpoint[pb.GameMode]{
|
|
||||||
endpointName: EPGameModes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameModes) Query(query string) ([]*pb.GameMode, error) {
|
func (a *GameModes) Query(query string) ([]*pb.GameMode, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_modes.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_modes.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameReleaseFormats struct {
|
type GameReleaseFormats struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameReleaseFormat]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameReleaseFormats(request func(URL string, dataBody any) (*resty.Response, error)) *GameReleaseFormats {
|
|
||||||
a := &GameReleaseFormats{
|
|
||||||
BaseEndpoint[pb.GameReleaseFormat]{
|
|
||||||
endpointName: EPGameReleaseFormats,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameReleaseFormats) Query(query string) ([]*pb.GameReleaseFormat, error) {
|
func (a *GameReleaseFormats) Query(query string) ([]*pb.GameReleaseFormat, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_release_formats.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_release_formats.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameStatuses struct {
|
type GameStatuses struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameStatus]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameStatuses(request func(URL string, dataBody any) (*resty.Response, error)) *GameStatuses {
|
|
||||||
a := &GameStatuses{
|
|
||||||
BaseEndpoint[pb.GameStatus]{
|
|
||||||
endpointName: EPGameStatuses,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameStatuses) Query(query string) ([]*pb.GameStatus, error) {
|
func (a *GameStatuses) Query(query string) ([]*pb.GameStatus, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_statuses.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_statuses.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameTimeToBeats struct {
|
type GameTimeToBeats struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameTimeToBeat]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameTimeToBeats(request func(URL string, dataBody any) (*resty.Response, error)) *GameTimeToBeats {
|
|
||||||
a := &GameTimeToBeats{
|
|
||||||
BaseEndpoint[pb.GameTimeToBeat]{
|
|
||||||
endpointName: EPGameTimeToBeats,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameTimeToBeats) Query(query string) ([]*pb.GameTimeToBeat, error) {
|
func (a *GameTimeToBeats) Query(query string) ([]*pb.GameTimeToBeat, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_time_to_beats.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_time_to_beats.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameTypes struct {
|
type GameTypes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameType]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameTypes(request func(URL string, dataBody any) (*resty.Response, error)) *GameTypes {
|
|
||||||
a := &GameTypes{
|
|
||||||
BaseEndpoint[pb.GameType]{
|
|
||||||
endpointName: EPGameTypes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameTypes) Query(query string) ([]*pb.GameType, error) {
|
func (a *GameTypes) Query(query string) ([]*pb.GameType, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_types.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_types.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameVersionFeatureValues struct {
|
type GameVersionFeatureValues struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameVersionFeatureValue]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameVersionFeatureValues(request func(URL string, dataBody any) (*resty.Response, error)) *GameVersionFeatureValues {
|
|
||||||
a := &GameVersionFeatureValues{
|
|
||||||
BaseEndpoint[pb.GameVersionFeatureValue]{
|
|
||||||
endpointName: EPGameVersionFeatureValues,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameVersionFeatureValues) Query(query string) ([]*pb.GameVersionFeatureValue, error) {
|
func (a *GameVersionFeatureValues) Query(query string) ([]*pb.GameVersionFeatureValue, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_version_feature_values.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_version_feature_values.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameVersionFeatures struct {
|
type GameVersionFeatures struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameVersionFeature]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameVersionFeatures(request func(URL string, dataBody any) (*resty.Response, error)) *GameVersionFeatures {
|
|
||||||
a := &GameVersionFeatures{
|
|
||||||
BaseEndpoint[pb.GameVersionFeature]{
|
|
||||||
endpointName: EPGameVersionFeatures,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameVersionFeatures) Query(query string) ([]*pb.GameVersionFeature, error) {
|
func (a *GameVersionFeatures) Query(query string) ([]*pb.GameVersionFeature, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_version_features.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_version_features.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameVersions struct {
|
type GameVersions struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameVersion]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameVersions(request func(URL string, dataBody any) (*resty.Response, error)) *GameVersions {
|
|
||||||
a := &GameVersions{
|
|
||||||
BaseEndpoint[pb.GameVersion]{
|
|
||||||
endpointName: EPGameVersions,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameVersions) Query(query string) ([]*pb.GameVersion, error) {
|
func (a *GameVersions) Query(query string) ([]*pb.GameVersion, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_versions.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_versions.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GameVideos struct {
|
type GameVideos struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.GameVideo]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGameVideos(request func(URL string, dataBody any) (*resty.Response, error)) *GameVideos {
|
|
||||||
a := &GameVideos{
|
|
||||||
BaseEndpoint[pb.GameVideo]{
|
|
||||||
endpointName: EPGameVideos,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *GameVideos) Query(query string) ([]*pb.GameVideo, error) {
|
func (a *GameVideos) Query(query string) ([]*pb.GameVideo, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/game_videos.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/game_videos.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Games struct {
|
type Games struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Game]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGames(request func(URL string, dataBody any) (*resty.Response, error)) *Games {
|
|
||||||
a := &Games{
|
|
||||||
BaseEndpoint[pb.Game]{
|
|
||||||
endpointName: EPGames,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Games) Query(query string) ([]*pb.Game, error) {
|
func (a *Games) Query(query string) ([]*pb.Game, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/games.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/games.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Genres struct {
|
type Genres struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Genre]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewGenres(request func(URL string, dataBody any) (*resty.Response, error)) *Genres {
|
|
||||||
a := &Genres{
|
|
||||||
BaseEndpoint[pb.Genre]{
|
|
||||||
endpointName: EPGenres,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Genres) Query(query string) ([]*pb.Genre, error) {
|
func (a *Genres) Query(query string) ([]*pb.Genre, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/genres.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/genres.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type InvolvedCompanies struct {
|
type InvolvedCompanies struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.InvolvedCompany]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewInvolvedCompanies(request func(URL string, dataBody any) (*resty.Response, error)) *InvolvedCompanies {
|
|
||||||
a := &InvolvedCompanies{
|
|
||||||
BaseEndpoint[pb.InvolvedCompany]{
|
|
||||||
endpointName: EPInvolvedCompanies,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *InvolvedCompanies) Query(query string) ([]*pb.InvolvedCompany, error) {
|
func (a *InvolvedCompanies) Query(query string) ([]*pb.InvolvedCompany, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/involved_companies.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/involved_companies.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Keywords struct {
|
type Keywords struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Keyword]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewKeywords(request func(URL string, dataBody any) (*resty.Response, error)) *Keywords {
|
|
||||||
a := &Keywords{
|
|
||||||
BaseEndpoint[pb.Keyword]{
|
|
||||||
endpointName: EPKeywords,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Keywords) Query(query string) ([]*pb.Keyword, error) {
|
func (a *Keywords) Query(query string) ([]*pb.Keyword, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/keywords.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/keywords.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LanguageSupportTypes struct {
|
type LanguageSupportTypes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.LanguageSupportType]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewLanguageSupportTypes(request func(URL string, dataBody any) (*resty.Response, error)) *LanguageSupportTypes {
|
|
||||||
a := &LanguageSupportTypes{
|
|
||||||
BaseEndpoint[pb.LanguageSupportType]{
|
|
||||||
endpointName: EPLanguageSupportTypes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *LanguageSupportTypes) Query(query string) ([]*pb.LanguageSupportType, error) {
|
func (a *LanguageSupportTypes) Query(query string) ([]*pb.LanguageSupportType, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/language_support_types.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/language_support_types.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LanguageSupports struct {
|
type LanguageSupports struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.LanguageSupport]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewLanguageSupports(request func(URL string, dataBody any) (*resty.Response, error)) *LanguageSupports {
|
|
||||||
a := &LanguageSupports{
|
|
||||||
BaseEndpoint[pb.LanguageSupport]{
|
|
||||||
endpointName: EPLanguageSupports,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *LanguageSupports) Query(query string) ([]*pb.LanguageSupport, error) {
|
func (a *LanguageSupports) Query(query string) ([]*pb.LanguageSupport, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/language_supports.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/language_supports.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Languages struct {
|
type Languages struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Language]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewLanguages(request func(URL string, dataBody any) (*resty.Response, error)) *Languages {
|
|
||||||
a := &Languages{
|
|
||||||
BaseEndpoint[pb.Language]{
|
|
||||||
endpointName: EPLanguages,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Languages) Query(query string) ([]*pb.Language, error) {
|
func (a *Languages) Query(query string) ([]*pb.Language, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/languages.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/languages.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MultiplayerModes struct {
|
type MultiplayerModes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.MultiplayerMode]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewMultiplayerModes(request func(URL string, dataBody any) (*resty.Response, error)) *MultiplayerModes {
|
|
||||||
a := &MultiplayerModes{
|
|
||||||
BaseEndpoint[pb.MultiplayerMode]{
|
|
||||||
endpointName: EPMultiplayerModes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *MultiplayerModes) Query(query string) ([]*pb.MultiplayerMode, error) {
|
func (a *MultiplayerModes) Query(query string) ([]*pb.MultiplayerMode, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/multiplayer_modes.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/multiplayer_modes.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NetworkTypes struct {
|
type NetworkTypes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.NetworkType]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewNetworkTypes(request func(URL string, dataBody any) (*resty.Response, error)) *NetworkTypes {
|
|
||||||
a := &NetworkTypes{
|
|
||||||
BaseEndpoint[pb.NetworkType]{
|
|
||||||
endpointName: EPNetworkTypes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *NetworkTypes) Query(query string) ([]*pb.NetworkType, error) {
|
func (a *NetworkTypes) Query(query string) ([]*pb.NetworkType, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/network_types.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/network_types.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlatformFamilies struct {
|
type PlatformFamilies struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.PlatformFamily]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPlatformFamilies(request func(URL string, dataBody any) (*resty.Response, error)) *PlatformFamilies {
|
|
||||||
a := &PlatformFamilies{
|
|
||||||
BaseEndpoint[pb.PlatformFamily]{
|
|
||||||
endpointName: EPPlatformFamilies,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *PlatformFamilies) Query(query string) ([]*pb.PlatformFamily, error) {
|
func (a *PlatformFamilies) Query(query string) ([]*pb.PlatformFamily, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/platform_families.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/platform_families.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlatformLogos struct {
|
type PlatformLogos struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.PlatformLogo]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPlatformLogos(request func(URL string, dataBody any) (*resty.Response, error)) *PlatformLogos {
|
|
||||||
a := &PlatformLogos{
|
|
||||||
BaseEndpoint[pb.PlatformLogo]{
|
|
||||||
endpointName: EPPlatformLogos,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *PlatformLogos) Query(query string) ([]*pb.PlatformLogo, error) {
|
func (a *PlatformLogos) Query(query string) ([]*pb.PlatformLogo, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/platform_logos.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/platform_logos.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlatformTypes struct {
|
type PlatformTypes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.PlatformType]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPlatformTypes(request func(URL string, dataBody any) (*resty.Response, error)) *PlatformTypes {
|
|
||||||
a := &PlatformTypes{
|
|
||||||
BaseEndpoint[pb.PlatformType]{
|
|
||||||
endpointName: EPPlatformTypes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *PlatformTypes) Query(query string) ([]*pb.PlatformType, error) {
|
func (a *PlatformTypes) Query(query string) ([]*pb.PlatformType, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/platform_types.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/platform_types.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlatformVersionCompanies struct {
|
type PlatformVersionCompanies struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.PlatformVersionCompany]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPlatformVersionCompanies(request func(URL string, dataBody any) (*resty.Response, error)) *PlatformVersionCompanies {
|
|
||||||
a := &PlatformVersionCompanies{
|
|
||||||
BaseEndpoint[pb.PlatformVersionCompany]{
|
|
||||||
endpointName: EPPlatformVersionCompanies,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *PlatformVersionCompanies) Query(query string) ([]*pb.PlatformVersionCompany, error) {
|
func (a *PlatformVersionCompanies) Query(query string) ([]*pb.PlatformVersionCompany, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/platform_version_companies.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/platform_version_companies.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlatformVersionReleaseDates struct {
|
type PlatformVersionReleaseDates struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.PlatformVersionReleaseDate]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPlatformVersionReleaseDates(request func(URL string, dataBody any) (*resty.Response, error)) *PlatformVersionReleaseDates {
|
|
||||||
a := &PlatformVersionReleaseDates{
|
|
||||||
BaseEndpoint[pb.PlatformVersionReleaseDate]{
|
|
||||||
endpointName: EPPlatformVersionReleaseDates,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *PlatformVersionReleaseDates) Query(query string) ([]*pb.PlatformVersionReleaseDate, error) {
|
func (a *PlatformVersionReleaseDates) Query(query string) ([]*pb.PlatformVersionReleaseDate, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/platform_version_release_dates.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/platform_version_release_dates.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlatformVersions struct {
|
type PlatformVersions struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.PlatformVersion]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPlatformVersions(request func(URL string, dataBody any) (*resty.Response, error)) *PlatformVersions {
|
|
||||||
a := &PlatformVersions{
|
|
||||||
BaseEndpoint[pb.PlatformVersion]{
|
|
||||||
endpointName: EPPlatformVersions,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *PlatformVersions) Query(query string) ([]*pb.PlatformVersion, error) {
|
func (a *PlatformVersions) Query(query string) ([]*pb.PlatformVersion, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/platform_versions.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/platform_versions.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlatformWebsites struct {
|
type PlatformWebsites struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.PlatformWebsite]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPlatformWebsites(request func(URL string, dataBody any) (*resty.Response, error)) *PlatformWebsites {
|
|
||||||
a := &PlatformWebsites{
|
|
||||||
BaseEndpoint[pb.PlatformWebsite]{
|
|
||||||
endpointName: EPPlatformWebsites,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *PlatformWebsites) Query(query string) ([]*pb.PlatformWebsite, error) {
|
func (a *PlatformWebsites) Query(query string) ([]*pb.PlatformWebsite, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/platform_websites.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/platform_websites.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Platforms struct {
|
type Platforms struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Platform]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPlatforms(request func(URL string, dataBody any) (*resty.Response, error)) *Platforms {
|
|
||||||
a := &Platforms{
|
|
||||||
BaseEndpoint[pb.Platform]{
|
|
||||||
endpointName: EPPlatforms,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Platforms) Query(query string) ([]*pb.Platform, error) {
|
func (a *Platforms) Query(query string) ([]*pb.Platform, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/platforms.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/platforms.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PlayerPerspectives struct {
|
type PlayerPerspectives struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.PlayerPerspective]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPlayerPerspectives(request func(URL string, dataBody any) (*resty.Response, error)) *PlayerPerspectives {
|
|
||||||
a := &PlayerPerspectives{
|
|
||||||
BaseEndpoint[pb.PlayerPerspective]{
|
|
||||||
endpointName: EPPlayerPerspectives,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *PlayerPerspectives) Query(query string) ([]*pb.PlayerPerspective, error) {
|
func (a *PlayerPerspectives) Query(query string) ([]*pb.PlayerPerspective, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/player_perspectives.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/player_perspectives.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PopularityPrimitives struct {
|
type PopularityPrimitives struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.PopularityPrimitive]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPopularityPrimitives(request func(URL string, dataBody any) (*resty.Response, error)) *PopularityPrimitives {
|
|
||||||
a := &PopularityPrimitives{
|
|
||||||
BaseEndpoint[pb.PopularityPrimitive]{
|
|
||||||
endpointName: EPPopularityPrimitives,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *PopularityPrimitives) Query(query string) ([]*pb.PopularityPrimitive, error) {
|
func (a *PopularityPrimitives) Query(query string) ([]*pb.PopularityPrimitive, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/popularity_primitives.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/popularity_primitives.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PopularityTypes struct {
|
type PopularityTypes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.PopularityType]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPopularityTypes(request func(URL string, dataBody any) (*resty.Response, error)) *PopularityTypes {
|
|
||||||
a := &PopularityTypes{
|
|
||||||
BaseEndpoint[pb.PopularityType]{
|
|
||||||
endpointName: EPPopularityTypes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *PopularityTypes) Query(query string) ([]*pb.PopularityType, error) {
|
func (a *PopularityTypes) Query(query string) ([]*pb.PopularityType, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/popularity_types.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/popularity_types.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Regions struct {
|
type Regions struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Region]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewRegions(request func(URL string, dataBody any) (*resty.Response, error)) *Regions {
|
|
||||||
a := &Regions{
|
|
||||||
BaseEndpoint[pb.Region]{
|
|
||||||
endpointName: EPRegions,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Regions) Query(query string) ([]*pb.Region, error) {
|
func (a *Regions) Query(query string) ([]*pb.Region, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/regions.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/regions.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ReleaseDateRegions struct {
|
type ReleaseDateRegions struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.ReleaseDateRegion]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewReleaseDateRegions(request func(URL string, dataBody any) (*resty.Response, error)) *ReleaseDateRegions {
|
|
||||||
a := &ReleaseDateRegions{
|
|
||||||
BaseEndpoint[pb.ReleaseDateRegion]{
|
|
||||||
endpointName: EPReleaseDateRegions,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *ReleaseDateRegions) Query(query string) ([]*pb.ReleaseDateRegion, error) {
|
func (a *ReleaseDateRegions) Query(query string) ([]*pb.ReleaseDateRegion, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/release_date_regions.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/release_date_regions.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ReleaseDateStatuses struct {
|
type ReleaseDateStatuses struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.ReleaseDateStatus]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewReleaseDateStatuses(request func(URL string, dataBody any) (*resty.Response, error)) *ReleaseDateStatuses {
|
|
||||||
a := &ReleaseDateStatuses{
|
|
||||||
BaseEndpoint[pb.ReleaseDateStatus]{
|
|
||||||
endpointName: EPReleaseDateStatuses,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *ReleaseDateStatuses) Query(query string) ([]*pb.ReleaseDateStatus, error) {
|
func (a *ReleaseDateStatuses) Query(query string) ([]*pb.ReleaseDateStatus, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/release_date_statuses.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/release_date_statuses.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ReleaseDates struct {
|
type ReleaseDates struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.ReleaseDate]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewReleaseDates(request func(URL string, dataBody any) (*resty.Response, error)) *ReleaseDates {
|
|
||||||
a := &ReleaseDates{
|
|
||||||
BaseEndpoint[pb.ReleaseDate]{
|
|
||||||
endpointName: EPReleaseDates,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *ReleaseDates) Query(query string) ([]*pb.ReleaseDate, error) {
|
func (a *ReleaseDates) Query(query string) ([]*pb.ReleaseDate, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/release_dates.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/release_dates.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Screenshots struct {
|
type Screenshots struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Screenshot]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewScreenshots(request func(URL string, dataBody any) (*resty.Response, error)) *Screenshots {
|
|
||||||
a := &Screenshots{
|
|
||||||
BaseEndpoint[pb.Screenshot]{
|
|
||||||
endpointName: EPScreenshots,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Screenshots) Query(query string) ([]*pb.Screenshot, error) {
|
func (a *Screenshots) Query(query string) ([]*pb.Screenshot, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/screenshots.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/screenshots.pb", query)
|
||||||
|
@ -10,7 +10,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
"github.com/bestnite/go-flaresolverr"
|
"github.com/bestnite/go-flaresolverr"
|
||||||
@ -23,16 +22,10 @@ var webSearchCFCookies struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Search struct {
|
type Search struct {
|
||||||
request func(URL string, dataBody any) (*resty.Response, error)
|
BaseEndpoint
|
||||||
flaresolverr *flaresolverr.Flaresolverr
|
flaresolverr *flaresolverr.Flaresolverr
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSearch(request func(URL string, dataBody any) (*resty.Response, error)) *Search {
|
|
||||||
return &Search{
|
|
||||||
request: request,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Search) Search(query string) ([]*pb.Search, error) {
|
func (a *Search) Search(query string) ([]*pb.Search, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/search.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/search.pb", query)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Themes struct {
|
type Themes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Theme]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewThemes(request func(URL string, dataBody any) (*resty.Response, error)) *Themes {
|
|
||||||
a := &Themes{
|
|
||||||
BaseEndpoint[pb.Theme]{
|
|
||||||
endpointName: EPThemes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Themes) Query(query string) ([]*pb.Theme, error) {
|
func (a *Themes) Query(query string) ([]*pb.Theme, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/themes.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/themes.pb", query)
|
||||||
|
@ -4,19 +4,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Webhooks struct {
|
type Webhooks struct{ BaseEndpoint }
|
||||||
request func(URL string, dataBody any) (*resty.Response, error)
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWebhooks(request func(URL string, dataBody any) (*resty.Response, error)) *Webhooks {
|
|
||||||
return &Webhooks{
|
|
||||||
request: request,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Webhooks) Register(endpoint EndpointName, secret, callbackUrl string) error {
|
func (a *Webhooks) Register(endpoint EndpointName, secret, callbackUrl string) error {
|
||||||
dataBody := url.Values{}
|
dataBody := url.Values{}
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type WebsiteTypes struct {
|
type WebsiteTypes struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.WebsiteType]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWebsiteTypes(request func(URL string, dataBody any) (*resty.Response, error)) *WebsiteTypes {
|
|
||||||
a := &WebsiteTypes{
|
|
||||||
BaseEndpoint[pb.WebsiteType]{
|
|
||||||
endpointName: EPWebsiteTypes,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *WebsiteTypes) Query(query string) ([]*pb.WebsiteType, error) {
|
func (a *WebsiteTypes) Query(query string) ([]*pb.WebsiteType, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/website_types.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/website_types.pb", query)
|
||||||
|
@ -4,25 +4,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
pb "github.com/bestnite/go-igdb/proto"
|
pb "github.com/bestnite/go-igdb/proto"
|
||||||
"github.com/go-resty/resty/v2"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Websites struct {
|
type Websites struct{ BaseEndpoint }
|
||||||
BaseEndpoint[pb.Website]
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewWebsites(request func(URL string, dataBody any) (*resty.Response, error)) *Websites {
|
|
||||||
a := &Websites{
|
|
||||||
BaseEndpoint[pb.Website]{
|
|
||||||
endpointName: EPWebsites,
|
|
||||||
request: request,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
a.queryFunc = a.Query
|
|
||||||
return a
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *Websites) Query(query string) ([]*pb.Website, error) {
|
func (a *Websites) Query(query string) ([]*pb.Website, error) {
|
||||||
resp, err := a.request("https://api.igdb.com/v4/websites.pb", query)
|
resp, err := a.request("https://api.igdb.com/v4/websites.pb", query)
|
||||||
|
@ -1,149 +1,358 @@
|
|||||||
package igdb
|
package igdb
|
||||||
|
|
||||||
import (
|
import "github.com/bestnite/go-igdb/endpoint"
|
||||||
"github.com/bestnite/go-igdb/endpoint"
|
|
||||||
)
|
|
||||||
|
|
||||||
func registerAllEndpoints(c *Client) {
|
func registerAllEndpoints(c *Client) {
|
||||||
c.AgeRatingCategories = endpoint.NewAgeRatingCategories(c.Request)
|
c.AgeRatingCategories = &endpoint.AgeRatingCategories{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAgeRatingCategories),
|
||||||
c.AgeRatingContentDescriptions = endpoint.NewAgeRatingContentDescriptions(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPAgeRatingCategories] = c.AgeRatingCategories
|
||||||
c.AgeRatingContentDescriptionsV2 = endpoint.NewAgeRatingContentDescriptionsV2(c.Request)
|
|
||||||
|
c.AgeRatingContentDescriptions = &endpoint.AgeRatingContentDescriptions{
|
||||||
c.AgeRatingOrganizations = endpoint.NewAgeRatingOrganizations(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAgeRatingContentDescriptions),
|
||||||
|
}
|
||||||
c.AgeRatings = endpoint.NewAgeRatings(c.Request)
|
c.EntityEndpoints[endpoint.EPAgeRatingContentDescriptions] = c.AgeRatingContentDescriptions
|
||||||
|
|
||||||
c.AlternativeNames = endpoint.NewAlternativeNames(c.Request)
|
c.AgeRatingContentDescriptionsV2 = &endpoint.AgeRatingContentDescriptionsV2{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAgeRatingContentDescriptionsV2),
|
||||||
c.Artworks = endpoint.NewArtworks(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPAgeRatingContentDescriptionsV2] = c.AgeRatingContentDescriptionsV2
|
||||||
c.CharacterGenders = endpoint.NewCharacterGenders(c.Request)
|
|
||||||
|
c.AgeRatingOrganizations = &endpoint.AgeRatingOrganizations{
|
||||||
c.CharacterMugShots = endpoint.NewCharacterMugShots(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAgeRatingOrganizations),
|
||||||
|
}
|
||||||
c.Characters = endpoint.NewCharacters(c.Request)
|
c.EntityEndpoints[endpoint.EPAgeRatingOrganizations] = c.AgeRatingOrganizations
|
||||||
|
|
||||||
c.CharacterSpecies = endpoint.NewCharacterSpecies(c.Request)
|
c.AgeRatings = &endpoint.AgeRatings{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAgeRatings),
|
||||||
c.CollectionMemberships = endpoint.NewCollectionMemberships(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPAgeRatings] = c.AgeRatings
|
||||||
c.CollectionMembershipTypes = endpoint.NewCollectionMembershipTypes(c.Request)
|
|
||||||
|
c.AlternativeNames = &endpoint.AlternativeNames{
|
||||||
c.CollectionRelations = endpoint.NewCollectionRelations(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPAlternativeNames),
|
||||||
|
}
|
||||||
c.CollectionRelationTypes = endpoint.NewCollectionRelationTypes(c.Request)
|
c.EntityEndpoints[endpoint.EPAlternativeNames] = c.AlternativeNames
|
||||||
|
|
||||||
c.Collections = endpoint.NewCollections(c.Request)
|
c.Artworks = &endpoint.Artworks{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPArtworks),
|
||||||
c.CollectionTypes = endpoint.NewCollectionTypes(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPArtworks] = c.Artworks
|
||||||
c.Companies = endpoint.NewCompanies(c.Request)
|
|
||||||
|
c.CharacterGenders = &endpoint.CharacterGenders{
|
||||||
c.CompanyLogos = endpoint.NewCompanyLogos(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCharacterGenders),
|
||||||
|
}
|
||||||
c.CompanyStatuses = endpoint.NewCompanyStatuses(c.Request)
|
c.EntityEndpoints[endpoint.EPCharacterGenders] = c.CharacterGenders
|
||||||
|
|
||||||
c.CompanyWebsites = endpoint.NewCompanyWebsites(c.Request)
|
c.CharacterMugShots = &endpoint.CharacterMugShots{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCharacterMugShots),
|
||||||
c.Covers = endpoint.NewCovers(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPCharacterMugShots] = c.CharacterMugShots
|
||||||
c.DateFormats = endpoint.NewDateFormats(c.Request)
|
|
||||||
|
c.Characters = &endpoint.Characters{
|
||||||
c.EventLogos = endpoint.NewEventLogos(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCharacters),
|
||||||
|
}
|
||||||
c.EventNetworks = endpoint.NewEventNetworks(c.Request)
|
c.EntityEndpoints[endpoint.EPCharacters] = c.Characters
|
||||||
|
|
||||||
c.Events = endpoint.NewEvents(c.Request)
|
c.CharacterSpecies = &endpoint.CharacterSpecies{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCharacterSpecies),
|
||||||
c.ExternalGames = endpoint.NewExternalGames(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPCharacterSpecies] = c.CharacterSpecies
|
||||||
c.ExternalGameSources = endpoint.NewExternalGameSources(c.Request)
|
|
||||||
|
c.CollectionMemberships = &endpoint.CollectionMemberships{
|
||||||
c.Franchises = endpoint.NewFranchises(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollectionMemberships),
|
||||||
|
}
|
||||||
c.GameEngineLogos = endpoint.NewGameEngineLogos(c.Request)
|
c.EntityEndpoints[endpoint.EPCollectionMemberships] = c.CollectionMemberships
|
||||||
|
|
||||||
c.GameEngines = endpoint.NewGameEngines(c.Request)
|
c.CollectionMembershipTypes = &endpoint.CollectionMembershipTypes{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollectionMembershipTypes),
|
||||||
c.GameLocalizations = endpoint.NewGameLocalizations(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPCollectionMembershipTypes] = c.CollectionMembershipTypes
|
||||||
c.GameModes = endpoint.NewGameModes(c.Request)
|
|
||||||
|
c.CollectionRelations = &endpoint.CollectionRelations{
|
||||||
c.GameReleaseFormats = endpoint.NewGameReleaseFormats(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollectionRelations),
|
||||||
|
}
|
||||||
c.Games = endpoint.NewGames(c.Request)
|
c.EntityEndpoints[endpoint.EPCollectionRelations] = c.CollectionRelations
|
||||||
|
|
||||||
c.GameStatuses = endpoint.NewGameStatuses(c.Request)
|
c.CollectionRelationTypes = &endpoint.CollectionRelationTypes{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollectionRelationTypes),
|
||||||
c.GameTimeToBeats = endpoint.NewGameTimeToBeats(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPCollectionRelationTypes] = c.CollectionRelationTypes
|
||||||
c.GameTypes = endpoint.NewGameTypes(c.Request)
|
|
||||||
|
c.Collections = &endpoint.Collections{
|
||||||
c.GameVersionFeatures = endpoint.NewGameVersionFeatures(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollections),
|
||||||
|
}
|
||||||
c.GameVersionFeatureValues = endpoint.NewGameVersionFeatureValues(c.Request)
|
c.EntityEndpoints[endpoint.EPCollections] = c.Collections
|
||||||
|
|
||||||
c.GameVersions = endpoint.NewGameVersions(c.Request)
|
c.CollectionTypes = &endpoint.CollectionTypes{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCollectionTypes),
|
||||||
c.GameVideos = endpoint.NewGameVideos(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPCollectionTypes] = c.CollectionTypes
|
||||||
c.Genres = endpoint.NewGenres(c.Request)
|
|
||||||
|
c.Companies = &endpoint.Companies{
|
||||||
c.InvolvedCompanies = endpoint.NewInvolvedCompanies(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCompanies),
|
||||||
|
}
|
||||||
c.Keywords = endpoint.NewKeywords(c.Request)
|
c.EntityEndpoints[endpoint.EPCompanies] = c.Companies
|
||||||
|
|
||||||
c.Languages = endpoint.NewLanguages(c.Request)
|
c.CompanyLogos = &endpoint.CompanyLogos{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCompanyLogos),
|
||||||
c.LanguageSupports = endpoint.NewLanguageSupports(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPCompanyLogos] = c.CompanyLogos
|
||||||
c.LanguageSupportTypes = endpoint.NewLanguageSupportTypes(c.Request)
|
|
||||||
|
c.CompanyStatuses = &endpoint.CompanyStatuses{
|
||||||
c.MultiplayerModes = endpoint.NewMultiplayerModes(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCompanyStatuses),
|
||||||
|
}
|
||||||
c.NetworkTypes = endpoint.NewNetworkTypes(c.Request)
|
c.EntityEndpoints[endpoint.EPCompanyStatuses] = c.CompanyStatuses
|
||||||
|
|
||||||
c.PlatformFamilies = endpoint.NewPlatformFamilies(c.Request)
|
c.CompanyWebsites = &endpoint.CompanyWebsites{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCompanyWebsites),
|
||||||
c.PlatformLogos = endpoint.NewPlatformLogos(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPCompanyWebsites] = c.CompanyWebsites
|
||||||
c.Platforms = endpoint.NewPlatforms(c.Request)
|
|
||||||
|
c.Covers = &endpoint.Covers{
|
||||||
c.PlatformTypes = endpoint.NewPlatformTypes(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPCovers),
|
||||||
|
}
|
||||||
c.PlatformVersionCompanies = endpoint.NewPlatformVersionCompanies(c.Request)
|
c.EntityEndpoints[endpoint.EPCovers] = c.Covers
|
||||||
|
|
||||||
c.PlatformVersionReleaseDates = endpoint.NewPlatformVersionReleaseDates(c.Request)
|
c.DateFormats = &endpoint.DateFormats{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPDateFormats),
|
||||||
c.PlatformVersions = endpoint.NewPlatformVersions(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPDateFormats] = c.DateFormats
|
||||||
c.PlatformWebsites = endpoint.NewPlatformWebsites(c.Request)
|
|
||||||
|
c.EventLogos = &endpoint.EventLogos{
|
||||||
c.PlayerPerspectives = endpoint.NewPlayerPerspectives(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPEventLogos),
|
||||||
|
}
|
||||||
c.PopularityPrimitives = endpoint.NewPopularityPrimitives(c.Request)
|
c.EntityEndpoints[endpoint.EPEventLogos] = c.EventLogos
|
||||||
|
|
||||||
c.PopularityTypes = endpoint.NewPopularityTypes(c.Request)
|
c.EventNetworks = &endpoint.EventNetworks{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPEventNetworks),
|
||||||
c.Regions = endpoint.NewRegions(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPEventNetworks] = c.EventNetworks
|
||||||
c.ReleaseDateRegions = endpoint.NewReleaseDateRegions(c.Request)
|
|
||||||
|
c.Events = &endpoint.Events{
|
||||||
c.ReleaseDates = endpoint.NewReleaseDates(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPEvents),
|
||||||
|
}
|
||||||
c.ReleaseDateStatuses = endpoint.NewReleaseDateStatuses(c.Request)
|
c.EntityEndpoints[endpoint.EPEvents] = c.Events
|
||||||
|
|
||||||
c.Screenshots = endpoint.NewScreenshots(c.Request)
|
c.ExternalGames = &endpoint.ExternalGames{
|
||||||
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPExternalGames),
|
||||||
c.Themes = endpoint.NewThemes(c.Request)
|
}
|
||||||
|
c.EntityEndpoints[endpoint.EPExternalGames] = c.ExternalGames
|
||||||
c.Websites = endpoint.NewWebsites(c.Request)
|
|
||||||
|
c.ExternalGameSources = &endpoint.ExternalGameSources{
|
||||||
c.WebsiteTypes = endpoint.NewWebsiteTypes(c.Request)
|
BaseEndpoint: *endpoint.NewBaseEndpoint(c.Request, endpoint.EPExternalGameSources),
|
||||||
|
}
|
||||||
c.Webhooks = endpoint.NewWebhooks(c.Request)
|
c.EntityEndpoints[endpoint.EPExternalGameSources] = c.ExternalGameSources
|
||||||
|
|
||||||
c.Search = endpoint.NewSearch(c.Request)
|
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),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user