An unofficial Go library for integrating with TrueCoach.
Table of contents:
-
Download the module:
go get -u github.com/tobiassjosten/go-truecoach
-
Import it in your project:
import "github.com/tobiassjosten/go-truecoach"
package main
import (
"fmt"
"github.com/tobiassjosten/go-truecoach"
)
func main() {
tc := truecoach.NewService("SuperSecret123!!!")
clients, err := tc.Clients()
if err != nil {
panic(err)
}
for _, client := range clients {
metrics, err := tc.Metrics(client.ID)
if err != nil {
panic(err)
}
for _, metric := range metrics {
for _, assessment := range metric.Assessments {
for _, sample := range assessment.Samples {
fmt.Println(sample)
}
}
}
}
}
This library was developed by reverse engineering the TrueCoach API, based on their JavaScript frontend. As such, nothing is guaranteed to work and, even if it does, no future promises are made.
(Although I've been using it myself with zero problems for several years.)
Feel free to create a ticket if you want to discuss or suggest something. I'd love your input and will happily work with you to cover your use cases and explore your ideas for improvements.
Changes can be suggested directly by creating a pull request but I'd recommend starting an issue first, so you don't end up wasting your time with something I end up rejecting.