Documentation
¶
Index ¶
- Constants
- type DependencyResolver
- type DependencyResolverError
- type DependencyResolverErrorStringer
- 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) (*LockFile, error)
- func (i *Installation) LockFilePath(ctx *GlobalContext) (string, error)
- func (i *Installation) ResolveProfile(ctx *GlobalContext) (*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 *LockFile) error
- type Installations
- type InstallationsVersion
- type LockFile
- type LockedMod
- type LockedModTarget
- type LockfileVersion
- type MockProvider
- func (m MockProvider) GetMod(_ context.Context, _ string) (*ficsit.GetModResponse, error)
- func (m MockProvider) GetModName(_ context.Context, modReference string) (*ficsit.GetModNameResponse, error)
- func (m MockProvider) IsOffline() bool
- func (m MockProvider) ModVersions(_ context.Context, modReference string, _ ficsit.VersionFilter) (*ficsit.ModVersionsResponse, error)
- func (m MockProvider) ModVersionsWithDependencies(_ context.Context, modID string) (*ficsit.ModVersionsWithDependenciesResponse, error)
- func (m MockProvider) Mods(_ context.Context, f ficsit.ModFilter) (*ficsit.ModsResponse, error)
- func (m MockProvider) SMLVersions(_ context.Context) (*ficsit.SMLVersionsResponse, error)
- type ModVersion
- 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 DependencyResolver, lockFile *LockFile, gameVersion int) (*LockFile, error)
- func (p *Profile) SetModEnabled(reference string, enabled bool)
- type ProfileMod
- type Profiles
- type ProfilesVersion
- type VersionDependency
- type VersionTarget
Constants ¶
View Source
const ( InitialLockfileVersion = LockfileVersion(iota) ModTargetsLockfileVersion CurrentLockfileVersion = nextLockfileVersion - 1 )
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 DependencyResolver ¶ added in v0.0.9
type DependencyResolver struct {
// contains filtered or unexported fields
}
func NewDependencyResolver ¶ added in v0.0.9
func NewDependencyResolver(provider provider.Provider) DependencyResolver
func (DependencyResolver) ResolveModDependencies ¶ added in v0.0.9
type DependencyResolverError ¶ added in v0.2.0
type DependencyResolverError struct {
pubgrub.SolvingError
// contains filtered or unexported fields
}
func (DependencyResolverError) Error ¶ added in v0.2.0
func (e DependencyResolverError) Error() string
type DependencyResolverErrorStringer ¶ added in v0.2.0
type DependencyResolverErrorStringer struct {
pubgrub.StandardIncompatibilityStringer
// contains filtered or unexported fields
}
func MakeDependencyResolverErrorStringer ¶ added in v0.2.0
func MakeDependencyResolverErrorStringer(provider provider.Provider, smlVersions []ficsit.SMLVersionsSmlVersionsGetSMLVersionsSml_versionsSMLVersion, gameVersion int) *DependencyResolverErrorStringer
func (*DependencyResolverErrorStringer) IncompatibilityString ¶ added in v0.2.0
func (w *DependencyResolverErrorStringer) IncompatibilityString(incompatibility *pubgrub.Incompatibility, rootPkg string) string
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) (*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) (*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 *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 LockFile ¶ added in v0.0.9
type LockFile struct {
Mods map[string]LockedMod `json:"mods"`
Version LockfileVersion `json:"version"`
}
func MakeLockfile ¶ added in v0.2.0
func MakeLockfile() *LockFile
type LockedMod ¶ added in v0.0.9
type LockedMod struct {
Dependencies map[string]string `json:"dependencies"`
Targets map[string]LockedModTarget `json:"targets"`
Version string `json:"version"`
}
type LockedModTarget ¶ added in v0.2.0
type LockfileVersion ¶ added in v0.2.0
type LockfileVersion int
type MockProvider ¶ added in v0.2.0
type MockProvider struct{}
func (MockProvider) GetMod ¶ added in v0.2.0
func (m MockProvider) GetMod(_ context.Context, _ string) (*ficsit.GetModResponse, error)
func (MockProvider) GetModName ¶ added in v0.2.0
func (m MockProvider) GetModName(_ context.Context, modReference string) (*ficsit.GetModNameResponse, error)
func (MockProvider) IsOffline ¶ added in v0.2.0
func (m MockProvider) IsOffline() bool
func (MockProvider) ModVersions ¶ added in v0.2.0
func (m MockProvider) ModVersions(_ context.Context, modReference string, _ ficsit.VersionFilter) (*ficsit.ModVersionsResponse, error)
func (MockProvider) ModVersionsWithDependencies ¶ added in v0.2.0
func (m MockProvider) ModVersionsWithDependencies(_ context.Context, modID string) (*ficsit.ModVersionsWithDependenciesResponse, error)
func (MockProvider) Mods ¶ added in v0.2.0
func (m MockProvider) Mods(_ context.Context, f ficsit.ModFilter) (*ficsit.ModsResponse, error)
func (MockProvider) SMLVersions ¶ added in v0.2.0
func (m MockProvider) SMLVersions(_ context.Context) (*ficsit.SMLVersionsResponse, error)
type ModVersion ¶ added in v0.0.9
type ModVersion struct {
ID string
Version string
Targets map[string]VersionTarget
Dependencies []VersionDependency
}
type Profile ¶
type Profile struct {
Mods map[string]ProfileMod `json:"mods"`
Name string `json:"name"`
}
func (*Profile) IsModEnabled ¶ added in v0.0.23
func (*Profile) Resolve ¶ added in v0.0.9
func (p *Profile) Resolve(resolver DependencyResolver, lockFile *LockFile, gameVersion int) (*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
type VersionDependency ¶ added in v0.0.9
type VersionTarget ¶ added in v0.2.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.