danstis/go-nitrado

View on GitHub
example/simple/main.go

Summary

Maintainability
A
0 mins
Test Coverage
package main

import (
    "fmt"
    "os"

    "github.com/danstis/go-nitrado/nitrado"
)

var token string = os.Getenv("nitradoToken")

func main() {
    api := nitrado.NewClient(token)

    services, _, err := api.Services.List()
    if err != nil {
        panic(err)
    }

    for _, s := range *services {
        gs, _, _ := api.GameServers.Get(s.ID)
        fmt.Printf("GameServer for %q: %q\n", s.Details.Name, gs.GameHuman)
    }
}