Categorygithub.com/mdp/go-statx
modulepackage
0.0.1
Repository: https://github.com/mdp/go-statx.git
Documentation: pkg.go.dev

# README

go-statx

Installation

The the CLI

go get -u github.com/mdp/go-statx/...

Just the library

go get -u github.com/mdp/go-statx

Usage

CLI

statx login +14158675309
Enter verification code from StatX and if successful you will receive API keys

Get a list of groups
statx list --apikey 12345abcdef --authtoken yourauthtoken

Get a list of Stats in a group
statx list --apikey 12345abcdef --authtoken yourauthtoken --group groupid

Update the value of a Stat
statx update --apikey 12345abcdef --authtoken yourauthtoken --group groupid --stat statid --value 47

Library

client := statx.NewAuthenticatedClient(nil, "apikey", "authtoken")
statList, _, err := client.Stats.List("GroupID")

# Update a stat
stat := &statx.Stat{Value: "47"}
updatedStat, _, err := client.Stats.Update("GroupID", statList[0].ID, stat)

# Packages

No description provided by the author

# Functions

CheckResponse checks the API response for errors, and returns them if present.
NewAuthenticatedClient returns a new Authenticted Statx API client.
NewClient returns a new Statx API client.

# Structs

AuthResponse the reponse back from /auth/login.
AuthService handles calls to /groups.
A Client manages communication with the GitHub API.
Credentials is the response from /auth/verifyCode.
Group holds the group info.
GroupList holds the list of groups from GET /groups.
GroupsService handles calls to /groups.
Response is a GitHub API response.
Stat holds generic stat data.
StatList holds stats.
StatsService handles calls to /stats.