Go client for the Stalcraft: X API.
go get -u github.com/kayex/stalcraft
You need to create an application to access the API. Authentication is not handled by this package.
The official demo API can be used to trial basic functionality. You can
access it by passing either of stalcraft.DemoAppAccessToken or stalcraft.DemoUserAccessToken along with
stalcraft.WithDomain(stalcraft.DemoDomain) to the client constructor.
package main
import (
"context"
"fmt"
"log"
"github.com/kayex/stalcraft"
)
func main() {
client, err := stalcraft.NewClient(stalcraft.RegionEU, "your-access-token")
if err != nil {
log.Fatal(err)
}
emission, err := client.EmissionStatus(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("Current emission start time: %v\n", emission.CurrentStart)
}All available endpoints are found in endpoints.go. Their names match the names in the API reference as closely as possible.
MIT