cli

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package cli has shared utilities and application logic for the forklift CLI

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPallet added in v0.3.0

func ApplyPallet(
	indent int, pallet *forklift.FSPallet, loader forklift.FSPkgLoader, parallel bool,
) error

func BulletedPrint

func BulletedPrint(indent int, a ...any)

func BulletedPrintYaml

func BulletedPrintYaml(indent int, a any) error

func BulletedPrintf

func BulletedPrintf(indent int, format string, a ...any)

func BulletedPrintln

func BulletedPrintln(indent int, a ...any)

func CacheAllRequirements added in v0.6.0

func CacheAllRequirements(
	pallet *forklift.FSPallet, repoCachePath string, loader forklift.FSPkgLoader,
	includeDisabled, parallel bool,
) (changed bool, err error)

func CheckCompatibility added in v0.4.0

func CheckCompatibility(
	pallet *forklift.FSPallet, repoLoader forklift.FSRepoLoader,
	toolVersion, repoMinVersion, palletMinVersion string, ignoreTool bool,
) error

CheckCompatibility returns an error upon any version compatibility errors between a pallet, its required pallets & repos (as loaded by repoLoader), and - unless the ignoreTool flag is set - the Forklift tool (whose version is specified as toolVersion, and whose minimum compatible Forklift versions are specified as repoMinVersion and palletMinVersion). Note that minimum versions are still enforced even if the ignoreTool flag is set.

func CheckPallet added in v0.3.0

func CheckPallet(
	indent int, pallet *forklift.FSPallet, loader forklift.FSPkgLoader,
) ([]*forklift.ResolvedDepl, []forklift.SatisfiedDeplDeps, error)

CheckPallet checks the resource constraints among package deployments in the pallet.

func CheckShallowCompatibility added in v0.4.0

func CheckShallowCompatibility(
	pallet *forklift.FSPallet, repoLoader forklift.FSRepoLoader,
	toolVersion, repoMinVersion, palletMinVersion string, ignoreTool bool,
) error

CheckShallowCompatibility returns an error upon any version compatibility errors between a pallet and - unless the ignoreTool flag is set - the Forklift tool (whose version is specified as toolVersion, and whose minimum compatible Forklift versions are specified as repoMinVersion and palletMinVersion). Note that minimum versions are still enforced even if the ignoreTool flag is set.

func CloneQueriedGitRepoUsingLocalMirror added in v0.6.0

func CloneQueriedGitRepoUsingLocalMirror(
	indent int, cachePath string, query string, destination string,
) error

func DownloadImages

func DownloadImages(
	indent int, pallet *forklift.FSPallet, loader forklift.FSPkgLoader,
	includeDisabled, parallel bool,
) error

func DownloadLockedGitRepoUsingLocalMirror added in v0.6.0

func DownloadLockedGitRepoUsingLocalMirror(
	indent int, cachePath string, gitRepoPath string, lock forklift.VersionLock,
) (downloaded bool, err error)

func DownloadQueriedGitReposUsingLocalMirrors added in v0.6.0

func DownloadQueriedGitReposUsingLocalMirrors(
	indent int, cachePath string, queries []string,
) (resolved map[string]forklift.GitRepoReq, changed map[forklift.GitRepoReq]bool, err error)

func DownloadRequiredPallets added in v0.6.0

func DownloadRequiredPallets(
	indent int, pallet *forklift.FSPallet, cachePath string,
) (changed bool, err error)

func DownloadRequiredRepos added in v0.6.0

func DownloadRequiredRepos(
	indent int, pallet *forklift.FSPallet, cachePath string,
) (changed bool, err error)

func GetPalletCache added in v0.6.0

func GetPalletCache(
	wpath string, pallet *forklift.FSPallet, ensureCache bool,
) (*forklift.FSPalletCache, error)

func GetRepoCache added in v0.6.0

func GetRepoCache(
	wpath string, pallet *forklift.FSPallet, ensureCache bool,
) (*forklift.LayeredRepoCache, *forklift.RepoOverrideCache, error)

func IndentedPrint

func IndentedPrint(indent int, a ...any)

func IndentedPrintYaml

func IndentedPrintYaml(indent int, a any) error

func IndentedPrintf

func IndentedPrintf(indent int, format string, a ...any)

func IndentedPrintln

func IndentedPrintln(indent int, a ...any)

func PrintCachedPallet added in v0.6.0

func PrintCachedPallet(indent int, cache core.Pather, pallet *forklift.FSPallet) error

func PrintCachedRepo added in v0.6.0

func PrintCachedRepo(indent int, cache core.Pather, repo *core.FSRepo) error

func PrintDeplInfo

func PrintDeplInfo(
	indent int, pallet *forklift.FSPallet, cache forklift.PathedRepoCache, deplName string,
) error

func PrintDeplPkgPath added in v0.5.0

func PrintDeplPkgPath(
	indent int, pallet *forklift.FSPallet, cache forklift.PathedRepoCache, deplName string,
	allowDisabled bool,
) error

func PrintDeplSpec

func PrintDeplSpec(indent int, spec core.PkgDeplSpec)

func PrintFeatureSpec added in v0.4.0

func PrintFeatureSpec(indent int, name string, spec core.PkgFeatureSpec)

func PrintFeatureSpecs

func PrintFeatureSpecs(indent int, features map[string]core.PkgFeatureSpec)

func PrintPalletDepls added in v0.3.0

func PrintPalletDepls(indent int, pallet *forklift.FSPallet, loader forklift.FSPkgLoader) error

func PrintPalletInfo added in v0.2.0

func PrintPalletInfo(indent int, pallet *forklift.FSPallet) error

func PrintPalletPkgs added in v0.3.0

func PrintPalletPkgs(indent int, pallet *forklift.FSPallet, loader forklift.FSPkgLoader) error

func PrintPalletRepos added in v0.3.0

func PrintPalletRepos(indent int, pallet *forklift.FSPallet) error

func PrintPkg

func PrintPkg(indent int, cache forklift.PathedRepoCache, pkg *core.FSPkg)

func PrintPkgInfo

func PrintPkgInfo(
	indent int, pallet *forklift.FSPallet, cache forklift.PathedRepoCache, pkgPath string,
) error

func PrintPkgSpec

func PrintPkgSpec(indent int, spec core.PkgSpec)

func PrintReadme added in v0.2.0

func PrintReadme(indent int, readme []byte, widthLimit int)

func PrintRepoInfo

func PrintRepoInfo(
	indent int, pallet *forklift.FSPallet, cache forklift.PathedRepoCache, repoPath string,
) error

func ResolveQueriesUsingLocalMirrors added in v0.6.0

func ResolveQueriesUsingLocalMirrors(
	indent int, cachePath string, queries []string,
) (resolved map[string]forklift.GitRepoReq, err error)

func ValidateGitRepoQueries added in v0.6.0

func ValidateGitRepoQueries(queries []string) error

Types

type ReconciliationChange added in v0.5.0

type ReconciliationChange struct {
	Name string
	Type string
	Depl *forklift.ResolvedDepl // this is nil for an app to be removed
	App  api.Stack              // this is empty for an app which does not yet exist
}

func PlanPallet added in v0.3.0

func PlanPallet(
	indent int, pallet *forklift.FSPallet, loader forklift.FSPkgLoader, parallel bool,
) (
	changeDeps structures.Digraph[*ReconciliationChange], serialization []*ReconciliationChange,
	err error,
)

PlanPallet builds a plan for changes to make to the Docker host in order to reconcile it with the desired state as expressed by the pallet. The plan is expressed as a dependency graph which can be used to build a partial ordering of the changes (where each change is a node in the graph) for concurrent execution, and - if serial execution is required either because the parallel arg is set to true or because a dependency cycle was detected - a total ordering of the changes for serial (rather than concurrent) execution.

func (*ReconciliationChange) PlanString added in v0.5.0

func (c *ReconciliationChange) PlanString() string

func (*ReconciliationChange) String added in v0.5.0

func (c *ReconciliationChange) String() string

Jump to

Keyboard shortcuts

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