lichess

package
v0.0.0-...-5fa4e64 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BaseURL is the base URL for the Lichess API.
	BaseURL = "https://lichess.org"

	// BroadcastsURL is the URL for the Lichess broadcasts API.
	BroadcastsURL = BaseURL + "/api/broadcast/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcast

type Broadcast struct {
	Tour   Tour    `json:"tour"`
	Rounds []Round `json:"rounds"`
}

func GetBroadcast

func GetBroadcast(ctx context.Context, id string) (Broadcast, error)

func (Broadcast) String

func (b Broadcast) String() string

type Game

type Game struct {
	ID        string   `json:"id"`
	Name      string   `json:"name"`
	Status    string   `json:"status"`
	Players   []Player `json:"players"`
	ThinkTime int      `json:"thinkTime"`
}

type Player

type Player struct {
	Name   string `json:"name"`
	Title  string `json:"title"`
	Fed    string `json:"fed"`
	Rating int    `json:"rating"`
}

type Round

type Round struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Slug      string `json:"slug"`
	URL       string `json:"url"`
	CreatedAt int64  `json:"createdAt"`
	StartsAt  int64  `json:"startsAt"` // Unix timestamp
}

func (Round) String

func (r Round) String() string

type RoundDetails

type RoundDetails struct {
	Tour  Tour   `json:"tour"`
	Games []Game `json:"games"`
	Round Round  `json:"round"`
	Study Study  `json:"study"`
}

func GetRound

func GetRound(ctx context.Context, id string) (RoundDetails, error)

type Study

type Study struct {
	Writeable bool `json:"writeable"`
}

type Tour

type Tour struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
	URL         string `json:"url"`
	CreatedAt   int64  `json:"createdAt"`
}

func (Tour) String

func (t Tour) String() string

Jump to

Keyboard shortcuts

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