Documentation ¶
Index ¶
- Constants
- func BuildInstallSummary(installData *InstallData) string
- func BuildPruneSummary(pruned versionmap.VersionListMap) string
- func BuildUninstallSummary(installData *InstallData) string
- func ValidateModLocation(ctx context.Context, workspacePath string) (bool, error)
- type ByteSequence
- type Change
- type ChangeOperation
- type ChangeSet
- type InstallData
- func InstallWorkspaceDependencies(ctx context.Context, opts *InstallOpts) (_ *InstallData, err error)
- func NewInstallData(workspaceLock *versionmap.WorkspaceLock, workspaceMod *modconfig.Mod) *InstallData
- func UninstallWorkspaceDependencies(ctx context.Context, opts *InstallOpts) (*InstallData, error)
- type InstallOpts
- type ModInstaller
- func (i *ModInstaller) GetModList() string
- func (i *ModInstaller) GetRequiredModVersionsFromArgs(modsArgs []string) (versionmap.VersionConstraintMap, error)
- func (i *ModInstaller) InstallWorkspaceDependencies(ctx context.Context) (err error)
- func (i *ModInstaller) Prune() (versionmap.VersionListMap, error)
- func (i *ModInstaller) UninstallWorkspaceDependencies(ctx context.Context) error
- type OperatorFunc
- type ResolvedModRef
Constants ¶
const ( VerbInstalled = "Installed" VerbUninstalled = "Uninstalled" VerbUpgraded = "Upgraded" VerbDowngraded = "Downgraded" VerbPruned = "Pruned" )
Variables ¶
This section is empty.
Functions ¶
func BuildInstallSummary ¶
func BuildInstallSummary(installData *InstallData) string
func BuildPruneSummary ¶
func BuildPruneSummary(pruned versionmap.VersionListMap) string
func BuildUninstallSummary ¶
func BuildUninstallSummary(installData *InstallData) string
func ValidateModLocation ¶ added in v0.20.0
ValidateModLocation checks whether you are running from the home directory or if you have a lot of non .sql and .sp file in your current directory, and asks for confirmation to continue
Types ¶
type ByteSequence ¶ added in v0.20.0
type ByteSequence struct {
// contains filtered or unexported fields
}
func NewByteSequence ¶ added in v0.20.0
func NewByteSequence(b []byte) *ByteSequence
func (*ByteSequence) Apply ¶ added in v0.20.0
func (bseq *ByteSequence) Apply(apply func([]byte) []byte)
Apply applies the given function on the byte sequence
func (*ByteSequence) ApplyChanges ¶ added in v0.20.0
func (b *ByteSequence) ApplyChanges(changeSet ChangeSet)
func (*ByteSequence) Bytes ¶ added in v0.20.0
func (bseq *ByteSequence) Bytes() []byte
Bytes returns the current underlying byte sequence
type Change ¶ added in v0.20.0
type Change struct { Content []byte Operation ChangeOperation OffsetStart int OffsetEnd int }
type ChangeOperation ¶ added in v0.20.0
type ChangeOperation int
const ( Insert ChangeOperation = iota Delete Replace )
type ChangeSet ¶ added in v0.20.0
type ChangeSet []*Change
func EmptyChangeSet ¶ added in v0.20.0
func EmptyChangeSet() ChangeSet
func MergeChangeSet ¶ added in v0.20.0
MergeChangeSet creates a ChangeSet by merging the given ChangeSets in order
func NewChangeSet ¶ added in v0.20.0
NewChangeSet creates a ChangeSet from the given changes
func (ChangeSet) SortByOffset ¶ added in v0.20.0
func (c ChangeSet) SortByOffset()
type InstallData ¶
type InstallData struct { // record of the full dependency tree Lock *versionmap.WorkspaceLock NewLock *versionmap.WorkspaceLock // list of dependencies installed by recent install operation Installed versionmap.DependencyVersionMap // list of dependencies which have been upgraded Upgraded versionmap.DependencyVersionMap // list of dependencies which have been downgraded Downgraded versionmap.DependencyVersionMap // list of dependencies which have been uninstalled Uninstalled versionmap.DependencyVersionMap WorkspaceMod *modconfig.Mod // contains filtered or unexported fields }
func InstallWorkspaceDependencies ¶
func InstallWorkspaceDependencies(ctx context.Context, opts *InstallOpts) (_ *InstallData, err error)
func NewInstallData ¶
func NewInstallData(workspaceLock *versionmap.WorkspaceLock, workspaceMod *modconfig.Mod) *InstallData
func UninstallWorkspaceDependencies ¶
func UninstallWorkspaceDependencies(ctx context.Context, opts *InstallOpts) (*InstallData, error)
func (*InstallData) GetAvailableUpdates ¶
func (d *InstallData) GetAvailableUpdates() (versionmap.DependencyVersionMap, error)
GetAvailableUpdates returns a map of all installed mods which are not in the lock file
func (*InstallData) GetInstalledTree ¶
func (d *InstallData) GetInstalledTree() treeprint.Tree
func (*InstallData) GetUninstalledTree ¶
func (d *InstallData) GetUninstalledTree() treeprint.Tree
func (*InstallData) GetUpdatedTree ¶
func (d *InstallData) GetUpdatedTree() treeprint.Tree
type InstallOpts ¶
type InstallOpts struct { WorkspaceMod *modconfig.Mod Command string ModArgs []string DryRun bool Force bool }
func NewInstallOpts ¶ added in v0.20.0
func NewInstallOpts(workspaceMod *modconfig.Mod, modsToInstall ...string) *InstallOpts
type ModInstaller ¶
type ModInstaller struct {
// contains filtered or unexported fields
}
func NewModInstaller ¶
func NewModInstaller(opts *InstallOpts) (*ModInstaller, error)
func (*ModInstaller) GetModList ¶
func (i *ModInstaller) GetModList() string
func (*ModInstaller) GetRequiredModVersionsFromArgs ¶
func (i *ModInstaller) GetRequiredModVersionsFromArgs(modsArgs []string) (versionmap.VersionConstraintMap, error)
func (*ModInstaller) InstallWorkspaceDependencies ¶
func (i *ModInstaller) InstallWorkspaceDependencies(ctx context.Context) (err error)
InstallWorkspaceDependencies installs all dependencies of the workspace mod
func (*ModInstaller) Prune ¶
func (i *ModInstaller) Prune() (versionmap.VersionListMap, error)
func (*ModInstaller) UninstallWorkspaceDependencies ¶
func (i *ModInstaller) UninstallWorkspaceDependencies(ctx context.Context) error
type OperatorFunc ¶ added in v0.20.0
type ResolvedModRef ¶
type ResolvedModRef struct { // the FQN of the mod - also the Git URL of the mod repo Name string // the mod version Version *semver.Version // the vestion constraint Constraint *versionhelpers.Constraints // the Git branch/tag GitReference plumbing.ReferenceName // the file path for local mods FilePath string }
ResolvedModRef is a struct to represent a resolved mod git reference
func NewResolvedModRef ¶
func NewResolvedModRef(requiredModVersion *modconfig.ModVersionConstraint, version *semver.Version) (*ResolvedModRef, error)
func (*ResolvedModRef) DependencyPath ¶ added in v0.20.0
func (r *ResolvedModRef) DependencyPath() string
DependencyPath returns name in the format <dependency name>@v<dependencyVersion>