server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(url string) (*API, error)

func (*API) BaseURL

func (a *API) BaseURL() string

func (*API) FetchGameInfo

func (a *API) FetchGameInfo() (GameInfo, error)

func (*API) GetCGEFile

func (a *API) GetCGEFile() (string, error)

func (*API) GetPlayers added in v0.2.4

func (a *API) GetPlayers(gameId string) (map[string]string, error)

func (*API) ListGames added in v0.2.8

func (a *API) ListGames(onlyUnprotected, onlyProtected bool) (private int, public []GameListEntry, err error)

type GameInfo

type GameInfo struct {
	Name          string `json:"name"`
	CGVersion     string `json:"cg_version"`
	DisplayName   string `json:"display_name"`
	Description   string `json:"description"`
	Version       string `json:"version"`
	RepositoryURL string `json:"repository_url"`
}

type GameListEntry added in v0.2.8

type GameListEntry struct {
	Id        string `json:"id"`
	Players   int    `json:"players"`
	Protected bool   `json:"protected"`
}

Jump to

Keyboard shortcuts

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