Documentation ¶
Index ¶
- Constants
- type GlobalContext
- type InstallUpdate
- type InstallUpdateItem
- type InstallUpdateType
- type Installation
- func (i *Installation) BasePath() string
- func (i *Installation) GetDisk() (disk.Disk, error)
- func (i *Installation) GetGameVersion(ctx *GlobalContext) (int, error)
- func (i *Installation) GetPlatform(ctx *GlobalContext) (*Platform, error)
- func (i *Installation) Install(ctx *GlobalContext, updates chan<- InstallUpdate) error
- func (i *Installation) LockFile(ctx *GlobalContext) (*resolver.LockFile, error)
- func (i *Installation) LockFilePath(ctx *GlobalContext) (string, error)
- func (i *Installation) ResolveProfile(ctx *GlobalContext) (*resolver.LockFile, error)
- func (i *Installation) SetProfile(ctx *GlobalContext, profile string) error
- func (i *Installation) UpdateMods(ctx *GlobalContext, mods []string) error
- func (i *Installation) Validate(ctx *GlobalContext) error
- func (i *Installation) Wipe() error
- func (i *Installation) WriteLockFile(ctx *GlobalContext, lockfile *resolver.LockFile) error
- type Installations
- type InstallationsVersion
- type MockProvider
- func (m MockProvider) GetMod(_ context.Context, _ string) (*ficsit.GetModResponse, error)
- func (m MockProvider) IsOffline() bool
- func (m MockProvider) ModVersionsWithDependencies(ctx context.Context, modID string) ([]resolver.ModVersion, error)
- func (m MockProvider) Mods(_ context.Context, f ficsit.ModFilter) (*ficsit.ModsResponse, error)
- type Platform
- type Profile
- func (p *Profile) AddMod(reference string, version string) error
- func (p *Profile) HasMod(reference string) bool
- func (p *Profile) IsModEnabled(reference string) bool
- func (p *Profile) RemoveMod(reference string)
- func (p *Profile) Resolve(resolver resolver.DependencyResolver, lockFile *resolver.LockFile, ...) (*resolver.LockFile, error)
- func (p *Profile) SetModEnabled(reference string, enabled bool)
- type ProfileMod
- type Profiles
- type ProfilesVersion
Constants ¶
View Source
const DefaultProfileName = "Default"
View Source
const (
InitialInstallationsVersion = InstallationsVersion(iota)
)
View Source
const (
InitialProfilesVersion = ProfilesVersion(iota)
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalContext ¶
type GlobalContext struct { Installations *Installations Profiles *Profiles APIClient graphql.Client Provider provider.Provider }
func InitCLI ¶
func InitCLI(apiOnly bool) (*GlobalContext, error)
func (*GlobalContext) ReInit ¶ added in v0.2.0
func (g *GlobalContext) ReInit() error
ReInit will initialize the context
Used only by tests
func (*GlobalContext) Save ¶
func (g *GlobalContext) Save() error
func (*GlobalContext) Wipe ¶ added in v0.2.0
func (g *GlobalContext) Wipe() error
Wipe will remove any trace of ficsit anywhere
type InstallUpdate ¶ added in v0.0.9
type InstallUpdate struct { Type InstallUpdateType Item InstallUpdateItem Progress utils.GenericProgress }
type InstallUpdateItem ¶ added in v0.2.0
type InstallUpdateType ¶ added in v0.2.0
type InstallUpdateType string
var ( InstallUpdateTypeOverall InstallUpdateType = "overall" InstallUpdateTypeModDownload InstallUpdateType = "download" InstallUpdateTypeModExtract InstallUpdateType = "extract" InstallUpdateTypeModComplete InstallUpdateType = "complete" )
type Installation ¶
type Installation struct { DiskInstance disk.Disk `json:"-"` Path string `json:"path"` Profile string `json:"profile"` Vanilla bool `json:"vanilla"` }
func (*Installation) BasePath ¶ added in v0.1.0
func (i *Installation) BasePath() string
func (*Installation) GetGameVersion ¶ added in v0.0.9
func (i *Installation) GetGameVersion(ctx *GlobalContext) (int, error)
func (*Installation) GetPlatform ¶ added in v0.0.9
func (i *Installation) GetPlatform(ctx *GlobalContext) (*Platform, error)
func (*Installation) Install ¶
func (i *Installation) Install(ctx *GlobalContext, updates chan<- InstallUpdate) error
func (*Installation) LockFile ¶ added in v0.0.9
func (i *Installation) LockFile(ctx *GlobalContext) (*resolver.LockFile, error)
func (*Installation) LockFilePath ¶ added in v0.0.9
func (i *Installation) LockFilePath(ctx *GlobalContext) (string, error)
func (*Installation) ResolveProfile ¶ added in v0.2.0
func (i *Installation) ResolveProfile(ctx *GlobalContext) (*resolver.LockFile, error)
func (*Installation) SetProfile ¶ added in v0.0.9
func (i *Installation) SetProfile(ctx *GlobalContext, profile string) error
func (*Installation) UpdateMods ¶ added in v0.2.0
func (i *Installation) UpdateMods(ctx *GlobalContext, mods []string) error
func (*Installation) Validate ¶
func (i *Installation) Validate(ctx *GlobalContext) error
func (*Installation) Wipe ¶ added in v0.2.0
func (i *Installation) Wipe() error
func (*Installation) WriteLockFile ¶ added in v0.0.9
func (i *Installation) WriteLockFile(ctx *GlobalContext, lockfile *resolver.LockFile) error
type Installations ¶
type Installations struct { SelectedInstallation string `json:"selected_installation"` Installations []*Installation `json:"installations"` Version InstallationsVersion `json:"version"` }
func InitInstallations ¶
func InitInstallations() (*Installations, error)
func (*Installations) AddInstallation ¶
func (i *Installations) AddInstallation(ctx *GlobalContext, installPath string, profile string) (*Installation, error)
func (*Installations) DeleteInstallation ¶ added in v0.0.9
func (i *Installations) DeleteInstallation(installPath string) error
func (*Installations) GetInstallation ¶
func (i *Installations) GetInstallation(installPath string) *Installation
func (*Installations) Save ¶
func (i *Installations) Save() error
type InstallationsVersion ¶
type InstallationsVersion int
type MockProvider ¶ added in v0.2.0
type MockProvider struct {
resolver.MockProvider
}
func (MockProvider) GetMod ¶ added in v0.2.0
func (m MockProvider) GetMod(_ context.Context, _ string) (*ficsit.GetModResponse, error)
func (MockProvider) IsOffline ¶ added in v0.2.0
func (m MockProvider) IsOffline() bool
func (MockProvider) ModVersionsWithDependencies ¶ added in v0.2.0
func (m MockProvider) ModVersionsWithDependencies(ctx context.Context, modID string) ([]resolver.ModVersion, error)
func (MockProvider) Mods ¶ added in v0.2.0
func (m MockProvider) Mods(_ context.Context, f ficsit.ModFilter) (*ficsit.ModsResponse, error)
type Profile ¶
type Profile struct { Mods map[string]ProfileMod `json:"mods"` Name string `json:"name"` RequiredTargets []resolver.TargetName `json:"required_targets"` }
func (*Profile) IsModEnabled ¶ added in v0.0.23
func (*Profile) Resolve ¶ added in v0.0.9
func (p *Profile) Resolve(resolver resolver.DependencyResolver, lockFile *resolver.LockFile, gameVersion int) (*resolver.LockFile, error)
Resolve resolves all mods and their dependencies.
An optional lockfile can be passed if one exists.
Returns an error if resolution is impossible.
func (*Profile) SetModEnabled ¶ added in v0.0.23
type ProfileMod ¶
type Profiles ¶
type Profiles struct { Profiles map[string]*Profile `json:"profiles"` SelectedProfile string `json:"selected_profile"` Version ProfilesVersion `json:"version"` }
func InitProfiles ¶
func (*Profiles) AddProfile ¶
AddProfile adds a new profile with the given name to the profiles list.
func (*Profiles) DeleteProfile ¶
DeleteProfile deletes the profile with the given name.
func (*Profiles) GetProfile ¶
GetProfile returns the profile with the given name or nil if it doesn't exist.
func (*Profiles) RenameProfile ¶ added in v0.0.7
func (p *Profiles) RenameProfile(ctx *GlobalContext, oldName string, newName string) error
type ProfilesVersion ¶
type ProfilesVersion int
Source Files ¶
Click to show internal directories.
Click to hide internal directories.