Categorygithub.com/Johnnycyan/go-tmio-sdk
repositorypackage
0.0.0-20240606062721-12f5259a437c
Repository: https://github.com/johnnycyan/go-tmio-sdk.git
Documentation: pkg.go.dev

# README

project-logo

GO-TMIO-SDK

Accelerate your trackmania coding journey with ease.

last-commit repo-top-language repo-language-count go-report-card


Overview

The go-tmio-sdk project is a robust open-source toolkit designed to streamline interactions with the Trackmania API. It offers functionalities to retrieve and cache player information efficiently, including player IDs and names. With a focus on error handling and secure environment variable management, the project enhances the overall experience of working with the TMIO API. The go-tmio-sdk project stands out for its capability to simplify data fetching, caching, and retrieval tasks, catering to developers looking to integrate Trackmania API functionalities seamlessly.


Getting Started

System Requirements:

  • Internet

Setting it Up

  1. go get the package:
$ go get github.com/Johnnycyan/go-tmio-sdk
  1. Import the package in your go file
import (
  tmio "github.com/Johnnycyan/go-tmio-sdk"
)
  1. Create a .env file for your project with:
NAME=<your-username>

Usage

Get a Player ID from a Player Name

username := "username"
playerID, err := tmio.GetPlayerID(username)
if err != nil {
  log.Println(err)
  return
}

Get a Formatted Player Name from a non-formatted Player Name

username := "username"
playerFormatted, err := tmio.GetFormattedName(username)
if err != nil {
  log.Println(err)
  return
}