client-go

command module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 1 Imported by: 0

README

Build and Test

Vements Client Library for Go

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.

Documentation

See the Go API docs for more information on how to use this library.

Installation

To install the Vements Client Library for Go, use the following command:

$ go get github.com/vements/client-libs/go

Build

To build the command line tool, use the following command:

$ go build -o vements github.com/vements/client-libs/go/cmd/vements

Usage

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-libs/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)
}

Command Line Tool

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.

Build

To build the CLI:

$ go build -o ./vements-cli

The ./vements-cli path is used to avoid a name collision with the vements package. The file can be renamed to vements when moved to a directory in the PATH.

Usage
$ vements-cli --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 version
  • client-version to show the client library version

The library and CLI both support the following environment variables:

  • API_KEY to specify the API key
  • SERVER_TAGS to specify the tags used to select the server URL

Documentation

Overview

Copyright 2023 Monster Street Systems LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL