manager

package
v3.2.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: MIT Imports: 18 Imported by: 3

Documentation

Index

Constants

View Source
const (
	SortByTitleAsc = "title"
	SortByDateDesc = "date"
)

Variables

This section is empty.

Functions

func FilterRepositoryName

func FilterRepositoryName(name string) (filteredName string, e error)

Types

type Game

type Game RepositoryGame

func FilterGames

func FilterGames(games []Game, keyword *string, repository *string, lang *string, onlyInstalled bool) []Game

func FindGameById

func FindGameById(games []Game, id string) *Game

func FindGamesByName

func FindGamesByName(games []Game, name string) (foundGames []Game)

func ReadLocalGameInfo

func ReadLocalGameInfo(path string, info os.FileInfo) Game

func (*Game) HumanSize

func (g *Game) HumanSize() string

func (*Game) HumanVersion

func (g *Game) HumanVersion() string

func (*Game) IsUpdateAvailable

func (g *Game) IsUpdateAvailable() bool

type Manager

type Manager struct {
	Config            *configurator.InsteadmanConfig
	InterpreterFinder *interpreterfinder.InterpreterFinder
	CurrentRunningCmd *exec.Cmd
}

func (*Manager) CacheDir

func (m *Manager) CacheDir() string

func (*Manager) ClearCache

func (m *Manager) ClearCache() error

func (*Manager) FindLangs

func (m *Manager) FindLangs(games []Game) []string

func (*Manager) GetGameImage

func (m *Manager) GetGameImage(game *Game) (imagePath string, e error)

func (*Manager) GetInstalledGames

func (m *Manager) GetInstalledGames() ([]Game, error)

func (*Manager) GetMergedGames

func (m *Manager) GetMergedGames() ([]Game, error)

func (*Manager) GetRepositories

func (m *Manager) GetRepositories() []configurator.Repository

func (*Manager) GetRepositoryGames

func (m *Manager) GetRepositoryGames() ([]Game, error)

func (*Manager) GetSortedGames

func (m *Manager) GetSortedGames() ([]Game, error)

func (*Manager) GetSortedGamesBy

func (m *Manager) GetSortedGamesBy(sortBy string) ([]Game, error)

func (*Manager) GetSortedGamesByDateDesc

func (m *Manager) GetSortedGamesByDateDesc() ([]Game, error)

func (*Manager) HasDownloadedRepositories

func (m *Manager) HasDownloadedRepositories() bool

func (*Manager) InstallGame

func (m *Manager) InstallGame(game *Game, progressF func(uint64)) error

func (*Manager) InterpreterCommand

func (m *Manager) InterpreterCommand() string

func (*Manager) IsBuiltinInterpreterCommand

func (m *Manager) IsBuiltinInterpreterCommand() bool

func (*Manager) RemoveGame

func (m *Manager) RemoveGame(game *Game) error

func (*Manager) RunGame

func (m *Manager) RunGame(game *Game) error

func (*Manager) StopRunningGame

func (m *Manager) StopRunningGame() error

func (*Manager) UpdateRepositories

func (m *Manager) UpdateRepositories() []error

type RepositoryGame

type RepositoryGame struct {
	// XMLName xml.Name `xml:"game"`
	Name             string   `xml:"name"`
	Title            string   `xml:"title"`
	Version          string   `xml:"version"`
	Url              string   `xml:"url"`
	Size             int      `xml:"size"`
	Lang             string   `xml:"lang"`
	Descurl          string   `xml:"descurl"`
	Author           string   `xml:"author"`
	Description      string   `xml:"description"`
	Image            string   `xml:"image"`
	Langs            []string `xml:"langs>lang"`
	Date             string   `xml:"date"`
	Timestamp        int64    `xml:"-"`
	InstalledVersion string   `xml:"-"`
	RepositoryName   string   `xml:"-"`
	Installed        bool     `xml:"-"`
	OnlyInstalled    bool     `xml:"-"`
	//IsUpdateExist    bool     `xml:"-"`
	Languages []string `xml:"-"`
	Id        string   `xml:"-"`
}

type RepositoryGameList

type RepositoryGameList struct {
	// XMLName xml.Name `xml:"game_list"`
	GameList []RepositoryGame `xml:"game"`
}

type WriteCounter

type WriteCounter struct {
	Total uint64
	// contains filtered or unexported fields
}

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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