forked from nite/go-igdb
u
This commit is contained in:
@@ -4,11 +4,25 @@ import (
|
||||
"fmt"
|
||||
|
||||
pb "github.com/bestnite/go-igdb/proto"
|
||||
"github.com/go-resty/resty/v2"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type DateFormats struct{ BaseEndpoint }
|
||||
type DateFormats struct {
|
||||
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) {
|
||||
resp, err := a.request("https://api.igdb.com/v4/date_formats.pb", query)
|
||||
|
||||
Reference in New Issue
Block a user