Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dimuska139/rawg-sdk-go
This is RAWG SDK GO. This library contains methods for interacting with RAWG API.
https://github.com/dimuska139/rawg-sdk-go
go rawg rawg-api sdk
Last synced: 14 days ago
JSON representation
This is RAWG SDK GO. This library contains methods for interacting with RAWG API.
- Host: GitHub
- URL: https://github.com/dimuska139/rawg-sdk-go
- Owner: dimuska139
- License: mit
- Created: 2020-10-16T15:31:37.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-28T10:05:10.000Z (over 2 years ago)
- Last Synced: 2024-07-31T20:53:21.556Z (3 months ago)
- Topics: go, rawg, rawg-api, sdk
- Language: Go
- Homepage:
- Size: 159 KB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - rawg-sdk-go - Go library for the [RAWG Video Games Database](https://rawg.io/) API (Third-party APIs / Utility/Miscellaneous)
- awesome-go-extra - rawg-sdk-go - 10-16T15:31:37Z|2022-05-28T10:05:10Z| (Third-party APIs / Fail injection)
README
# RAWG Video Games Database Golang client
[![Build Status](https://travis-ci.org/dimuska139/rawg-sdk-go.svg?branch=master)](https://travis-ci.org/dimuska139/rawg-sdk-go)
[![codecov](https://codecov.io/gh/dimuska139/rawg-sdk-go/branch/master/graph/badge.svg)](https://codecov.io/gh/dimuska139/rawg-sdk-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/dimuska139/rawg-sdk-go)](https://goreportcard.com/report/github.com/dimuska139/rawg-sdk-go)
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/dimuska139/rawg-sdk-go/blob/master/LICENSE)
[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)This is unofficial RAWG SDK GO. This library contains methods for interacting with [RAWG API](https://rawg.io/).
## Installation
```shell
go get github.com/dimuska139/rawg-sdk-go
```## Usage
```go
package mainimport (
"context"
"fmt"
"net/http"
"strings"
"time"
"github.com/dimuska139/rawg-sdk-go/v3"
)func main() {
config := rawg.Config{
ApiKey: "yourapikey", // Your personal API key (see https://rawg.io/apidocs)
Language: "ru",
Rps: 5,
}
client := rawg.NewClient(http.DefaultClient, &config)
filter := rawg.NewGamesFilter().
SetSearch("Gta5").
SetPage(1).
SetPageSize(10).
ExcludeCollection(1).
WithoutParents()
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(time.Millisecond*500))
defer cancel()
data, total, err := client.GetGames(ctx, filter)...
}
```The tests should be considered a part of the documentation. Also you can read [official docs](https://rawg.io/apidocs).
## API limitations
Only 5 requests per second allowed from one IP. The "Rps" parameter in configuration performs this limitation.
So you don't worry about it.## License
RAWG SDK GO is released under the
[MIT License](http://www.opensource.org/licenses/MIT).