Version: v1.26.0 Latest Latest

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

Go to latest
Published: Apr 22, 2021 License: MIT Imports: 34 Imported by: 0




This section is empty.


This section is empty.


func DisableJSON added in v1.0.0

func DisableJSON()

func Emit added in v1.0.0

func Emit(p Payload)

func EnableJSON added in v1.0.0

func EnableJSON()

func WaitForProcessToExit added in v1.0.0

func WaitForProcessToExit(ctx context.Context, pid int)


type BrothBuildFile added in v1.0.0

type BrothBuildFile struct {
	Type    itchio.BuildFileType    `json:"type"`
	SubType itchio.BuildFileSubType `json:"subType"`
	Size    int64                   `json:"size"`

type BrothBuildInfo added in v1.0.0

type BrothBuildInfo struct {
	Version string            `json:"version"`
	Files   []*BrothBuildFile `json:"files"`

type BrothPatch added in v1.0.0

type BrothPatch struct {
	Version string            `json:"version"`
	Files   []*BrothPatchFile `json:"files"`

func (*BrothPatch) FindSubType added in v1.0.0

func (bp *BrothPatch) FindSubType(subType itchio.BuildFileSubType) *BrothPatchFile

type BrothPatchFile added in v1.0.0

type BrothPatchFile struct {
	SubType itchio.BuildFileSubType `json:"subType"`
	Size    int64                   `json:"size"`

type BrothUpgradePath added in v1.0.0

type BrothUpgradePath struct {
	Patches []*BrothPatch `json:"patches"`

type BuildFolder added in v1.0.0

type BuildFolder struct {
	Version string
	Path    string

type ErrorHandler

type ErrorHandler func(err error)

type FinishHandler

type FinishHandler func(source InstallSource)

type InstallSource

type InstallSource struct {
	Version string

type Installer

type Installer struct {
	// contains filtered or unexported fields

func NewInstaller

func NewInstaller(settings InstallerSettings) *Installer

func (*Installer) Install

func (i *Installer) Install(mv Multiverse)

func (*Installer) Upgrade added in v1.0.0

func (i *Installer) Upgrade(mv Multiverse) (*UpgradeResult, error)

func (*Installer) WarmUp added in v1.0.0

func (i *Installer) WarmUp()

type InstallerSettings

type InstallerSettings struct {
	AppName         string
	Localizer       *localize.Localizer
	OnError         ErrorHandler
	OnProgressLabel ProgressLabelHandler
	OnProgress      ProgressHandler
	OnFinish        FinishHandler
	OnSource        SourceHandler

type InstallingUpdate added in v1.0.0

type InstallingUpdate struct {
	Version string `json:"version"`

func (InstallingUpdate) GetType added in v1.0.0

func (p InstallingUpdate) GetType() string

type Log added in v1.0.0

type Log struct {
	Level   string `json:"level"`
	Message string `json:"message"`

func (Log) GetType added in v1.0.0

func (p Log) GetType() string

type Multiverse

type Multiverse interface {
	// Called on launch, or when upgrading
	GetCurrentVersion() *BuildFolder

	// Called when we start patching
	MakeStagingFolder() (string, error)
	// defer'd at the end of patching
	CleanStagingFolder() error

	// Record a freshly-patched build as ready
	QueueReady(build *BuildFolder) error

	// Returns true if we have a ready build pending
	HasReadyPending() bool

	// Returns true if the ready pending version is 'version'
	ReadyPendingIs(version string) bool

	// Make the ready build current.
	MakeReadyCurrent() error

	// Validates the current build (can be used after heal)
	ValidateCurrent() error

	// Returns a human-friendly representation of the state of this multiverse
	String() string

func NewMultiverse

func NewMultiverse(params *MultiverseParams) (Multiverse, error)

type MultiverseParams

type MultiverseParams struct {
	// `itch`, `kitch`
	AppName string

	// on Linux, `~/.itch`
	// on Windows, `%LOCALAPPDATA%/itch`
	// on macOS, `~/Library/Application Support/itch-setup`
	BaseDir string

	// If non-empty, this is where we'll store current
	// on macOS, this is `~/Applications`
	ApplicationsDir string

	// This is called with a folder before making it the current version
	OnValidate ValidateHandler

type NoUpdateAvailable added in v1.0.0

type NoUpdateAvailable struct{}

func (NoUpdateAvailable) GetType added in v1.0.0

func (p NoUpdateAvailable) GetType() string

type Payload added in v1.0.0

type Payload interface {
	GetType() string

type Progress added in v1.0.0

type Progress struct {
	Progress float64 `json:"progress"`
	BPS      float64 `json:"bps"`
	ETA      float64 `json:"eta"`

func (Progress) GetType added in v1.0.0

func (p Progress) GetType() string

type ProgressHandler

type ProgressHandler func(progress float64)

type ProgressLabelHandler

type ProgressLabelHandler func(label string)

type ReadyToRelaunch added in v1.0.0

type ReadyToRelaunch struct{}

func (ReadyToRelaunch) GetType added in v1.0.0

func (p ReadyToRelaunch) GetType() string

type SourceHandler

type SourceHandler func(source InstallSource)

type UpdateFailed added in v1.0.0

type UpdateFailed struct {
	Message string `json:"message"`

func (UpdateFailed) GetType added in v1.0.0

func (p UpdateFailed) GetType() string

type UpdateReady added in v1.0.0

type UpdateReady struct {
	Version string `json:"version"`

func (UpdateReady) GetType added in v1.0.0

func (p UpdateReady) GetType() string

type UpgradeResult added in v1.5.0

type UpgradeResult struct {
	DidUpgrade bool

type ValidateHandler added in v1.0.0

type ValidateHandler func(dir string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL