Skip to content

Latest commit

 

History

History

official

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Official

This is a go api client for the official Age Of Empires 4 Leaderboard.

Release Build Status CodeQL Status Report codecov Go

It can be used to filter in the same manner as the website and can be useful if you wish to build go based apps and tools for displaying and working with the official data.

Useage

A quick example is shown below:

// Setup and reuse a client, this takes an http client with a configurable timeout
c := official.NewClient(aoe.NewHTTPClient())

// create a request using the client and apply filters
// always call Do to execute the request.
resp, err := c.NewRequest().
    WithRegion(official.RegionNorthAmerica).
    WithMatchType(official.MatchTypeCustom).
    WithTeamSize(official.TeamSize4v4).
    Do(context.Background()) // use a proper context in an actual app
if err != nil {
    log.Fatal(err)
}

// do something with the results
fmt.Printf("total results found %d", resp.Count)

Examples

There are a few examples under the examples folder, these show paging, different filters etc.