Skip to content

API Client Library for Giant Bomb written in Golang

License

Notifications You must be signed in to change notification settings

coughlanio/go-giantbomb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[WIP] go-giantbomb

Go Report Card

This project was started as my own personal foray into Go development. Functionality is largely incomplete right now, with only a few endpoints implemented. Much of the groundwork is in place, so adding the remaining endpoints should be fairly trivial.

Requirements

  • Go > 1.10

Authentication

You will need a Giant Bomb API token to use this library. You can get your token from here.

Installation

go get -u github.com/coughlanio/go-giantbomb/giantbomb

Tests

Tests have been included for the majority of the endpoints already implemented. You can run the test suite using the following:

GB_API_KEY=<Giant Bomb API Token> go test ./...

Usage

package main

import (
	"fmt"
	"go-giantbomb/giantbomb"
	"os"
)

func main() {

	client := giantbomb.NewClient(os.Getenv("GB_API_KEY"))

	games, err := client.Game.List(nil)

	if err != nil {
		fmt.Println(err)
		return
	}

	guid := games.Results[0].GUID

	fmt.Printf("Fetching Game Info: %s\n", guid)

	game, err := client.Game.Get(guid, nil)

	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Printf("Result: %#v\n", game)

}

About

API Client Library for Giant Bomb written in Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages