The Vements Client Library for Go is a client library for accessing the Vements API from applications written in the Go language. It also includes a command line tool that can be used to interact with the API in scripts or in a terminal.
See the Getting Started Guide for more information on how to use this library.
To install the Vements Client Library for Go, use the following command:
$ go get github.com/vements/client-go@v0.0.3
To build the command line tool, use the following command:
$ go build -o vements github.com/vements/client-go
The following example shows how to use the Vements Client Library for Go to create a new Vements client, and then use that client to create a new Vements scoreboard.
package main
import (
"fmt"
"log"
vements " github.com/vements/client-go"
)
func init() {
var client *vements.Client = vements.NewClient("YOUR_API_KEY")
var scoreboard *vements.Scoreboard = client.CreateScoreboard(display: "My Scoreboard", rankDir: "desc", public: false)
}
The Vements Client Library for C# includes a command line tool that can be used to interact with the Vements API. The command line tool supports all of the same operations as the API.
$ vements --help
The Go CLI tool supports all of the same operations as the CLI tool in other languages:
- achievement CRUD, list, leaderboard, record progress
- participant CRUD, list, progress, scores
- scoreboard CRUD, list, scoreboard, record score
The above commands all support the following options:
--api-key
to specify the API key--verbose
to show verbose output
In addition to resource commands, these common commands are also supported:
api-version
to show the API versionclient-version
to show the client library version
The library and CLI both support the following environment variables:
API_KEY
to specify the API keySERVER_TAGS
to specify the tags used to select the server URL