modinstaller

package
v1.6.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: AGPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PersonalAccessTokenPrefix              = "ghp_"
	FineGrainedPersonalAccessTokenPrefix   = "github_pat_" //nolint:gosec // this is just the prefix
	OAuthAccessTokenPrefix                 = "gho_"
	GitHubAppUserAccessTokenPrefix         = "ghu_"
	GitHubAppInstallationAccessTokenPrefix = "ghs_"
	GitHubAppRefreshTokenPrefix            = "ghr_"
)
View Source
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 BuildUninstallSummary

func BuildUninstallSummary(installData *InstallData) string

func ValidateModLocation

func ValidateModLocation(ctx context.Context, workspacePath string) bool

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

type ByteSequence struct {
	// contains filtered or unexported fields
}

func NewByteSequence

func NewByteSequence(b []byte) *ByteSequence

func (*ByteSequence) Apply

func (b *ByteSequence) Apply(apply func([]byte) []byte)

Apply applies the given function on the byte sequence

func (*ByteSequence) ApplyChanges

func (b *ByteSequence) ApplyChanges(changeSet ChangeSet)

func (*ByteSequence) Bytes

func (b *ByteSequence) Bytes() []byte

Bytes returns the current underlying byte sequence

type Change

type Change struct {
	Content     []byte
	Operation   ChangeOperation
	OffsetStart int
	OffsetEnd   int
}

type ChangeOperation

type ChangeOperation int
const (
	Insert ChangeOperation = iota
	Delete
	Replace
)

type ChangeSet

type ChangeSet []*Change

func EmptyChangeSet

func EmptyChangeSet() ChangeSet

func MergeChangeSet

func MergeChangeSet(changeSets ...ChangeSet) ChangeSet

MergeChangeSet creates a ChangeSet by merging the given ChangeSets in order

func NewChangeSet

func NewChangeSet(changes ...*Change) ChangeSet

NewChangeSet creates a ChangeSet from the given changes

func (ChangeSet) SortByOffset

func (c ChangeSet) SortByOffset()

type DependencyMod added in v1.3.0

type DependencyMod struct {
	InstalledVersion *versionmap.InstalledModVersion
	Mod              *modconfig.Mod
}

DependencyMod is a mod which has been installed as a dependency

type GitUrlMode

type GitUrlMode int
const (
	GitUrlModeHTTPS GitUrlMode = iota
	GitUrlModeSSH
)

type InstallData

type InstallData struct {
	// record of the full dependency tree
	Lock    *versionmap.WorkspaceLock
	NewLock *versionmap.WorkspaceLock

	Installed   [][]string
	Uninstalled [][]string
	Upgraded    [][]string
	Downgraded  [][]string

	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, err error)

type InstallOpts

type InstallOpts struct {
	WorkspaceMod   *modconfig.Mod
	Command        string
	ModArgs        []string
	DryRun         bool
	Force          bool
	PluginVersions *plugin.PluginVersionMap
	UpdateStrategy string
}

func NewInstallOpts

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) (map[string]*modconfig.ModVersionConstraint, 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 (*ModInstaller) UninstallWorkspaceDependencies

func (i *ModInstaller) UninstallWorkspaceDependencies(ctx context.Context) error

type OperatorFunc

type OperatorFunc func(*Change, []byte) []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL