API client for speedrun.com in Go
Go Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
generate
Makefile
README.md
category.go
category_collection.go
category_test.go
doc.go
game.go
game_collection.go
game_test.go
guest.go
guest_test.go
http.go
leaderboard.go
leaderboard_collection.go
level.go
level_collection.go
level_test.go
personalbest.go
personalbest_collection.go
personalbest_test.go
platform.go
platform_collection.go
platform_test.go
player.go
player_collection.go
region.go
region_collection.go
region_test.go
run.go
run_collection.go
run_test.go
series.go
series_collection.go
series_test.go
types.go
user.go
user_collection.go
user_test.go
util.go
util_test.go
variable.go
variable_collection.go
variable_test.go

README.md

speedrun.com API Client for Go

GoDoc

This Go package implements a client for the speedrun.com API. It's not 100% complete and a relatively direct mapping of API structures to Go struct values.

Installation

go get github.com/sgt-kabukiman/srapi

Usage

package main

import (
	"fmt"

	"github.com/sgt-kabukiman/srapi"
)

func main() {
	// optional sorting
	sort := &srapi.Sorting{"name", srapi.Descending}

	// optional pagination
	cursor := &srapi.Cursor{2, 2} // offset, max

	// optional embeds
	embeds := srapi.NoEmbeds

	regions, err := srapi.Regions(sort, cursor, embeds)
	if err != nil {
		panic(err) // err is an srapi.*ApiError struct, containing more information
	}

	regions.Walk(func(r *Region) bool {
		fmt.Printf("Region = %s\n", r.Name)
		return true // false to skip walking
	})
}

License

This code is licensed under the MIT license.