tlhist

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package tlhist is an API client for @p1nkl0bst3r's https://api.p1nkl0bst3r.xyz/tlhist/ TETRA LEAGUE history API.

Index

Constants

View Source
const Endpoint = "https://api.p1nkl0bst3r.xyz/tlhist/"
View Source
const NumFields = 10
View Source
const TimeLayout = "2006-01-02 15:04:05.999999999"

Variables

View Source
var ErrInvalidUID = errors.New("tlhist: invalid uid")
View Source
var ErrNotFound = errors.New("tlhist: not found")

Functions

func RawData

func RawData(ctx context.Context, uid string) (r io.ReadCloser, err error)

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.Reader) Reader

func (Reader) All

func (r Reader) All(skipHeader bool) ([]Record, error)

func (Reader) Next

func (r Reader) Next() (*Record, error)

Next reads, parses and returns the next Record. The memory of the returned Record is reused between calls to Next.

func (Reader) NextRaw

func (r Reader) NextRaw() ([]string, error)

type Record

type Record struct {
	UserID      string    `json:"user_id"`
	GamesPlayed int       `json:"gamesplayed"`
	GamesWon    int       `json:"gameswon"`
	Rating      float64   `json:"rating"`
	Glicko      float64   `json:"glicko"`
	Rank        string    `json:"rank"`
	APM         float64   `json:"apm"`
	PPS         float64   `json:"pps"`
	VS          float64   `json:"vs"`
	CreatedAt   time.Time `json:"created_at"`
}

func AllRecords

func AllRecords(ctx context.Context, uid string) ([]Record, error)

func (*Record) Slice

func (r *Record) Slice() []string

func (*Record) Unslice

func (r *Record) Unslice(fields []string) (err error)

Jump to

Keyboard shortcuts

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