sessions

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: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListGames added in v0.2.2

func ListGames() ([]string, error)

ListGames returns a list of all game URLs in the session store.

func ListSessions

func ListSessions() (map[string][]string, error)

ListSessions returns a map of all game URLs in the session store mapped to a list of usernames.

func ListUsernames added in v0.2.2

func ListUsernames(gameURL string) ([]string, error)

ListUsernames returns a list of usernames for the game.

Types

type Session

type Session struct {
	GameURL      string `json:"-"`
	Username     string `json:"-"`
	GameId       string `json:"game_id"`
	PlayerId     string `json:"player_id"`
	PlayerSecret string `json:"player_secret"`
	Path         string `json:"-"`
}

func LoadSession

func LoadSession(gameURL, username string) (Session, error)

Load a session from the session store.

func NewSession

func NewSession(gameURL, username, gameId, playerId, playerSecret string) Session

func (Session) Remove

func (s Session) Remove() error

Remove the session from the session store.

func (Session) Save

func (s Session) Save() error

Save the session to the session store.

Jump to

Keyboard shortcuts

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