Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

API client for speedrun.com in Go

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages