Documentation
¶
Index ¶
- func DisableJSON()
- func Emit(p Payload)
- func EnableJSON()
- func WaitForProcessToExit(ctx context.Context, pid int)
- type BrothBuildFile
- type BrothBuildInfo
- type BrothPatch
- type BrothPatchFile
- type BrothUpgradePath
- type BuildFolder
- type ErrorHandler
- type FinishHandler
- type InstallSource
- type Installer
- type InstallerSettings
- type InstallingUpdate
- type Log
- type Multiverse
- type MultiverseParams
- type NoUpdateAvailable
- type Payload
- type Progress
- type ProgressHandler
- type ProgressLabelHandler
- type ReadyToRelaunch
- type SourceHandler
- type UpdateFailed
- type UpdateReady
- type UpgradeResult
- type ValidateHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableJSON ¶ added in v1.0.0
func DisableJSON()
func EnableJSON ¶ added in v1.0.0
func EnableJSON()
func WaitForProcessToExit ¶ added in v1.0.0
Types ¶
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 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)
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 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 Progress ¶ added in v1.0.0
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
Click to show internal directories.
Click to hide internal directories.