appstate

package
v0.0.0-...-b5fa7f3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SvPresenceChangeEvent = "sv.PresenceChange"
	SvConfigChangeEvent   = "sv.ConfigChange"
	SvErrorChangeEvent    = "sv.ErrorChange"
	SvServerInfoChange    = "sv.ServerInfoChange"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppError

type AppError struct {
	Fatal   bool   `json:"fatal"`
	Message string `json:"message"`
}

func AppErr

func AppErr(pfx string, err error) *AppError

func (*AppError) Error

func (e *AppError) Error() string

type AppState

type AppState struct {
	LastUpdate time.Time `json:"lastUpdate"`
	Presence   Presence  `json:"presence"`
	Error      AppError  `json:"error"`

	config.Config
}

func (AppState) Merge

func (s AppState) Merge(p AppState) (_ AppState, events []string)

type Presence

type Presence struct {
	InGame      bool                         `json:"inGame"`
	Error       string                       `json:"error"`
	UserID      steam.ID                     `json:"userID"`
	AvatarURI   string                       `json:"avatarURL"`
	Username    string                       `json:"username"`
	Clan        string                       `json:"clan"`
	Name        string                       `json:"name"`
	GameID      steam.ID                     `json:"gameID"`
	GameIconURI string                       `json:"gameIconURI"`
	GameHeroURI string                       `json:"gameHeroURI"`
	GameDir     string                       `json:"gameDir"`
	Humans      data.SliceSet[steam.Profile] `json:"humans"`
	Bots        data.SliceSet[steam.Profile] `json:"bots"`
	Server      string                       `json:"server"`
	Ts          time.Time                    `json:"ts"`
}

type Reducer

type Reducer func(p AppState) AppState

Jump to

Keyboard shortcuts

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