Documentation ¶
Overview ¶
Package forklift provides the core functionality of the forklift tool
Index ¶
- Constants
- func CheckDeplDeps(depls []*ResolvedDepl) (satisfiedDeps []SatisfiedDeplDeps, missingDeps []MissingDeplDeps, err error)
- func CompareGitRepoReqs(r, s GitRepoReq) int
- func ComparePallets(r, s Pallet) int
- func CopyFS(fsys core.PathedFS, dest string) error
- func DirExists(dirPath string) bool
- func EnsureExists(dirPath string) error
- func EnsureFSStageStore(fsys core.PathedFS, subdirPath, newStateStoreVersion string) error
- func FileExists(filePath string) bool
- func GetCommitTimestamp(c CommitTimeGetter, hash string) (string, error)
- func LoadFSRepos(fsys core.PathedFS, searchPattern string, palletLoader FSPalletLoader) ([]*core.FSRepo, error)
- func LoadRequiredFSPallet(palletReqLoader PalletReqLoader, palletLoader FSPalletLoader, ...) (*FSPallet, PalletReq, error)
- func ReadLink(fsys fs.FS, name string) (string, error)
- func ResolveDeps(satisfiedDeps []SatisfiedDeplDeps, skipNonblocking bool) structures.Digraph[string]
- func ShortCommit(commit string) string
- func StatLink(fsys fs.FS, name string) (fs.FileInfo, error)
- func ToTimestamp(t time.Time) string
- type Bundle
- type BundleInclusionOverride
- type BundleInclusions
- type BundleManifest
- type BundlePallet
- type BundlePalletInclusion
- type BundleRepoInclusion
- type CommitTimeGetter
- type Depl
- type DeplConflict
- func (c DeplConflict) HasConflict() bool
- func (c DeplConflict) HasFileExportConflict() bool
- func (c DeplConflict) HasFilesetConflict() bool
- func (c DeplConflict) HasListenerConflict() bool
- func (c DeplConflict) HasNameConflict() bool
- func (c DeplConflict) HasNetworkConflict() bool
- func (c DeplConflict) HasServiceConflict() bool
- type DeplDef
- type FSBundle
- func (b *FSBundle) AddResolvedDepl(depl *ResolvedDepl) (err error)
- func (b *FSBundle) LoadDepl(name string) (Depl, error)
- func (b *FSBundle) LoadDepls(searchPattern string) ([]Depl, error)
- func (b *FSBundle) LoadFSPkg(pkgPath string, version string) (*core.FSPkg, error)
- func (b *FSBundle) LoadFSPkgs(searchPattern string) ([]*core.FSPkg, error)
- func (b *FSBundle) LoadFSRepo(repoPath string, version string) (*core.FSRepo, error)
- func (b *FSBundle) LoadFSRepos(searchPattern string) ([]*core.FSRepo, error)
- func (b *FSBundle) LoadPkgReq(pkgPath string) (r PkgReq, err error)
- func (b *FSBundle) LoadResolvedDepl(name string) (depl *ResolvedDepl, err error)
- func (b *FSBundle) Path() string
- func (b *FSBundle) SetBundledPallet(pallet *FSPallet) error
- func (b *FSBundle) WriteFileExports(dlCache *FSDownloadCache) error
- func (b *FSBundle) WriteManifestFile() error
- func (b *FSBundle) WriteRepoDefFile() error
- type FSDownloadCache
- func (c *FSDownloadCache) Exists() bool
- func (c *FSDownloadCache) GetFilePath(downloadURL string) (string, error)
- func (c *FSDownloadCache) GetOCIImagePath(imageName string) (string, error)
- func (c *FSDownloadCache) HasFile(downloadURL string) (bool, error)
- func (c *FSDownloadCache) HasOCIImage(imageName string) (bool, error)
- func (c *FSDownloadCache) LoadFile(downloadURL string) ([]byte, error)
- func (c *FSDownloadCache) OpenFile(downloadURL string) (fs.File, error)
- func (c *FSDownloadCache) OpenOCIImage(imageName string) (fs.File, error)
- func (c *FSDownloadCache) Path() string
- func (c *FSDownloadCache) Remove() error
- type FSMirrorCache
- type FSPallet
- func LoadFSPallet(fsys core.PathedFS, subdirPath string) (p *FSPallet, err error)
- func LoadFSPalletContaining(path string) (*FSPallet, error)
- func LoadFSPallets(fsys core.PathedFS, searchPattern string) ([]*FSPallet, error)
- func MergeFSPallet(shallow *FSPallet, palletLoader FSPalletLoader, ...) (merged *FSPallet, err error)
- func (p *FSPallet) Exists() bool
- func (p *FSPallet) GetDeplsFS() (core.PathedFS, error)
- func (p *FSPallet) GetFeaturesFS() (core.PathedFS, error)
- func (p *FSPallet) GetPalletReqsFS() (core.PathedFS, error)
- func (p *FSPallet) GetRepoReqsFS() (core.PathedFS, error)
- func (p *FSPallet) LoadDepl(name string) (depl Depl, err error)
- func (p *FSPallet) LoadDepls(searchPattern string) ([]Depl, error)
- func (p *FSPallet) LoadFSPalletReq(palletPath string) (r *FSPalletReq, err error)
- func (p *FSPallet) LoadFSPalletReqs(searchPattern string) ([]*FSPalletReq, error)
- func (p *FSPallet) LoadFSPkg(pkgSubdir string) (pkg *core.FSPkg, err error)
- func (p *FSPallet) LoadFSPkgs(searchPattern string) ([]*core.FSPkg, error)
- func (p *FSPallet) LoadFSRepoReq(repoPath string) (r *FSRepoReq, err error)
- func (p *FSPallet) LoadFSRepoReqs(searchPattern string) ([]*FSRepoReq, error)
- func (p *FSPallet) LoadFeature(name string, loader FSPalletLoader) (imp Import, err error)
- func (p *FSPallet) LoadFeatures(searchPattern string) ([]Import, error)
- func (p *FSPallet) LoadImport(name string) (imp Import, err error)
- func (p *FSPallet) LoadImports(searchPattern string) ([]Import, error)
- func (p *FSPallet) LoadPalletReq(palletPath string) (r PalletReq, err error)
- func (p *FSPallet) LoadPkgReq(pkgPath string) (r PkgReq, err error)
- func (p *FSPallet) LoadReadme() ([]byte, error)
- func (p *FSPallet) Path() string
- func (p *FSPallet) Remove() error
- type FSPalletCache
- type FSPalletLoader
- type FSPalletReq
- type FSPkgLoader
- type FSRepoCache
- func (c *FSRepoCache) Exists() bool
- func (c *FSRepoCache) LoadFSPkg(pkgPath string, version string) (*core.FSPkg, error)
- func (c *FSRepoCache) LoadFSPkgs(searchPattern string) ([]*core.FSPkg, error)
- func (c *FSRepoCache) LoadFSRepo(repoPath string, version string) (*core.FSRepo, error)
- func (c *FSRepoCache) LoadFSRepos(searchPattern string) ([]*core.FSRepo, error)
- func (c *FSRepoCache) Path() string
- func (c *FSRepoCache) Remove() error
- type FSRepoLoader
- type FSRepoReq
- type FSStageStore
- func (s *FSStageStore) AllocateNew() (index int, err error)
- func (s *FSStageStore) CommitState() error
- func (s *FSStageStore) Exists() bool
- func (s *FSStageStore) GetBundlePath(index int) string
- func (s *FSStageStore) GetCurrent() (index int, ok bool)
- func (s *FSStageStore) GetNext() (index int, ok bool)
- func (s *FSStageStore) GetPending() (index int, ok bool)
- func (s *FSStageStore) GetRollback() (index int, ok bool)
- func (s *FSStageStore) IdentifyHighest() (index int, err error)
- func (s *FSStageStore) List() (indices []int, err error)
- func (s *FSStageStore) LoadFSBundle(index int) (*FSBundle, error)
- func (s *FSStageStore) NextFailed() bool
- func (s *FSStageStore) Path() string
- func (s *FSStageStore) RecordNextSuccess(succeeded bool)
- func (s *FSStageStore) Remove() error
- func (s *FSStageStore) RemoveBundleHistory(index int)
- func (s *FSStageStore) RemoveBundleNames(index int)
- func (s *FSStageStore) SetNext(index int)
- type FSWorkspace
- func (w *FSWorkspace) CommitCurrentPalletUpgrades(query GitRepoQuery) error
- func (w *FSWorkspace) GetCurrentPallet() (*FSPallet, error)
- func (w *FSWorkspace) GetCurrentPalletPath() string
- func (w *FSWorkspace) GetCurrentPalletUpgrades() (GitRepoQuery, error)
- func (w *FSWorkspace) GetDataPath() string
- func (w *FSWorkspace) GetDownloadCache() (*FSDownloadCache, error)
- func (w *FSWorkspace) GetDownloadCachePath() string
- func (w *FSWorkspace) GetMirrorCache() (*FSMirrorCache, error)
- func (w *FSWorkspace) GetMirrorCachePath() string
- func (w *FSWorkspace) GetPalletCache() (*FSPalletCache, error)
- func (w *FSWorkspace) GetPalletCachePath() string
- func (w *FSWorkspace) GetRepoCache() (*FSRepoCache, error)
- func (w *FSWorkspace) GetRepoCachePath() string
- func (w *FSWorkspace) GetStageStore(newStateStoreVersion string) (*FSStageStore, error)
- func (w *FSWorkspace) GetStageStorePath() string
- type FileRef
- type GitRepoQuery
- type GitRepoReq
- type Import
- type ImportDef
- type ImportModifier
- type LayeredPalletCache
- type LayeredRepoCache
- func (c *LayeredRepoCache) LoadFSPkg(pkgPath string, version string) (*core.FSPkg, error)
- func (c *LayeredRepoCache) LoadFSPkgs(searchPattern string) ([]*core.FSPkg, error)
- func (c *LayeredRepoCache) LoadFSRepo(repoPath string, version string) (*core.FSRepo, error)
- func (c *LayeredRepoCache) LoadFSRepos(searchPattern string) ([]*core.FSRepo, error)
- func (c *LayeredRepoCache) Path() string
- type MergeFS
- func (f *MergeFS) ListImports() (map[string]FileRef, error)
- func (f *MergeFS) Open(name string) (fs.File, error)
- func (f *MergeFS) Path() string
- func (f *MergeFS) ReadDir(name string) (entries []fs.DirEntry, err error)
- func (f *MergeFS) ReadFile(name string) ([]byte, error)
- func (f *MergeFS) ReadLink(name string) (string, error)
- func (f *MergeFS) Resolve(name string) (string, error)
- func (f *MergeFS) Stat(name string) (fs.FileInfo, error)
- func (f *MergeFS) StatLink(name string) (fs.FileInfo, error)
- func (f *MergeFS) Sub(dir string) (core.PathedFS, error)
- type MissingDeplDeps
- type OverlayPalletCache
- type OverlayRepoCache
- type Pallet
- type PalletCache
- type PalletDef
- type PalletOverrideCache
- func (c *PalletOverrideCache) IncludesFSPallet(palletPath string, version string) bool
- func (c *PalletOverrideCache) LoadFSPallet(palletPath string, version string) (*FSPallet, error)
- func (c *PalletOverrideCache) LoadFSPallets(searchPattern string) ([]*FSPallet, error)
- func (c *PalletOverrideCache) SetVersions(palletPath string, versions structures.Set[string])
- type PalletReq
- type PalletReqLoader
- type PalletSpec
- type PathedPalletCache
- type PathedRepoCache
- type PkgReq
- type PkgReqLoader
- type ReadLinkFS
- type RepoCache
- type RepoOverrideCache
- func (c *RepoOverrideCache) IncludesFSPkg(pkgPath string, version string) bool
- func (c *RepoOverrideCache) IncludesFSRepo(repoPath string, version string) bool
- func (c *RepoOverrideCache) LoadFSPkg(pkgPath string, version string) (*core.FSPkg, error)
- func (c *RepoOverrideCache) LoadFSPkgs(searchPattern string) ([]*core.FSPkg, error)
- func (c *RepoOverrideCache) LoadFSRepo(repoPath string, version string) (*core.FSRepo, error)
- func (c *RepoOverrideCache) LoadFSRepos(searchPattern string) ([]*core.FSRepo, error)
- func (c *RepoOverrideCache) SetVersions(repoPath string, versions structures.Set[string])
- type RepoReq
- type ResolvedDepl
- func (d *ResolvedDepl) Check() (errs []error)
- func (d *ResolvedDepl) CheckAllConflicts(candidates []*ResolvedDepl) (conflicts []DeplConflict, err error)
- func (d *ResolvedDepl) CheckConflicts(candidate *ResolvedDepl) (DeplConflict, error)
- func (d *ResolvedDepl) CheckDeps(candidates []*ResolvedDepl) (satisfied SatisfiedDeplDeps, missing MissingDeplDeps, err error)
- func (d *ResolvedDepl) DefinesApp() (bool, error)
- func (d *ResolvedDepl) DisabledFeatures() map[string]core.PkgFeatureSpec
- func (d *ResolvedDepl) EnabledFeatures() (enabled map[string]core.PkgFeatureSpec, err error)
- func (d *ResolvedDepl) GetComposeFilenames() ([]string, error)
- func (d *ResolvedDepl) GetDownloadURLs() ([]string, error)
- func (d *ResolvedDepl) GetFileExportTargets() ([]string, error)
- func (d *ResolvedDepl) GetFileExports() ([]core.FileExportRes, error)
- func (d *ResolvedDepl) GetHTTPFileDownloadURLs() ([]string, error)
- func (d *ResolvedDepl) GetOCIImageDownloadNames() ([]string, error)
- type ResolvedImport
- type SatisfiedDeplDeps
- type StageStoreManifest
- type StagesSpec
- type VersionLock
- type VersionLockDef
Constants ¶
const ( // DeplsDirName is the directory in a pallet which contains deployment declarations. DeplsDirName = "deployments" // DeplsFileExt is the file extension for deployment declaration files. DeplDefFileExt = ".deploy.yml" )
const ( ImportModifierTypeAdd = "add" ImportModifierTypeRemove = "remove" ImportModifierTypeAddFeature = "add-feature" ImportModifierTypeRemoveFeature = "remove-feature" )
const ( // FeaturesDirName is the directory in a pallet containing declarations of file import groups // which can be referenced by name in file import groups. FeaturesDirName = "features" // FeatureDefFileExt is the file extension for import group files. FeatureDefFileExt = ".feature.yml" )
const ( StageStoreManifestFile = "forklift-stage-store.yml" StageStoreManifestSwapFile = "forklift-stage-store-swap.yml" )
const ( LockTypeVersion = "version" LockTypePseudoversion = "pseudoversion" )
const BundleManifestFile = "forklift-bundle.yml"
BundleManifestFile is the name of the file describing each Forklift pallet bundle.
const (
// ImportDefFileExt is the file extension for import group files.
ImportDefFileExt = ".imports.yml"
)
const PalletDefFile = "forklift-pallet.yml"
PalletDefFile is the name of the file defining each Forklift pallet.
const ReqsDirName = "requirements"
ReqsDirName is the directory in a Forklift pallet which contains requirement declarations.
const ( // ReqsPalletsDirName is the subdirectory in the requirements directory of a Forklift pallet which // contains pallet requirement declarations. ReqsPalletsDirName = "pallets" )
const ( // ReqsReposDirName is the subdirectory in the requirements directory of a Forklift pallet which // contains repo requirement declarations. ReqsReposDirName = "repositories" )
const Timestamp = "20060102150405"
const VersionLockDefFile = "forklift-version-lock.yml"
VersionLockDefFile is the name of the file defining each version lock of a repo.
Variables ¶
This section is empty.
Functions ¶
func CheckDeplDeps ¶ added in v0.2.0
func CheckDeplDeps( depls []*ResolvedDepl, ) (satisfiedDeps []SatisfiedDeplDeps, missingDeps []MissingDeplDeps, err error)
CheckDeplDeps produces reports of all satisfied and unsatisfied resource dependencies among all provided ResolvedDepl instances.
func CompareGitRepoReqs ¶ added in v0.6.0
func CompareGitRepoReqs(r, s GitRepoReq) int
CompareGitRepoReqs returns an integer comparing two RepoReq instances according to their paths and versions. The result will be 0 if the r and s have the same paths and versions; -1 if r has a path which alphabetically comes before the path of s or if the paths are the same but r has a lower version than s; or +1 if r has a path which alphabetically comes after the path of s or if the paths are the same but r has a higher version than s.
func ComparePallets ¶ added in v0.6.0
ComparePallets returns an integer comparing two Pallet instances according to their paths and versions. The result will be 0 if the r and s have the same paths and versions; -1 if r has a path which alphabetically comes before the path of s or if the paths are the same but r has a lower version than s; or +1 if r has a path which alphabetically comes after the path of s or if the paths are the same but r has a higher version than s.
func EnsureExists ¶ added in v0.1.8
func EnsureFSStageStore ¶ added in v0.7.0
EnsureFSStageStore initializes a FSStageStore at the specified directory path in the provided base filesystem, if a stage store is not already initialized there.
func FileExists ¶
func GetCommitTimestamp ¶ added in v0.1.8
func GetCommitTimestamp(c CommitTimeGetter, hash string) (string, error)
func LoadFSRepos ¶
func LoadFSRepos( fsys core.PathedFS, searchPattern string, palletLoader FSPalletLoader, ) ([]*core.FSRepo, error)
LoadFSRepos loads all FSRepos from the provided base filesystem matching the specified search pattern, appropriately handling repos defined (implicitly or explicitly) as potentially-layered pallets. The search pattern should be a doublestar pattern, such as `**`, matching repo directories to search for. In the embedded [Repo] of each loaded FSRepo, the version is *not* initialized.
func LoadRequiredFSPallet ¶
func LoadRequiredFSPallet( palletReqLoader PalletReqLoader, palletLoader FSPalletLoader, palletPath string, ) (*FSPallet, PalletReq, error)
LoadRequiredFSPallet loads the specified pallet from the cache according to the specifications in the pallet requirements provided by the pallet requirement loader for the provided pallet path.
func ReadLink ¶
ReadLink returns the destination of the named symbolic link.
If fsys does not implement ReadLinkFS, then ReadLink returns an error.
func ResolveDeps ¶ added in v0.5.0
func ResolveDeps( satisfiedDeps []SatisfiedDeplDeps, skipNonblocking bool, ) structures.Digraph[string]
ResolveDeps returns a digraph where each node is the name of a deployment and each edge goes from a deployment which requires some resource to a deployment which provides that resource. Thus, the returned graph is a graph of direct dependencies among deployments, excluding deployments with no dependency relationships. If the skipNonblocking arg is set, then nonblocking resource requirements are ignored as if they didn't exist.
func ShortCommit ¶
func StatLink ¶
StatLink returns a fs.FileInfo describing the file without following any symbolic links.
If fsys does not implement ReadLinkFS, then ReadLink returns an error.
func ToTimestamp ¶
Types ¶
type Bundle ¶ added in v0.7.0
type Bundle struct { // Manifest is the Forklift bundle manifest for the pallet bundle. Manifest BundleManifest }
A Bundle is a Forklift pallet bundle, a complete compilation of all files (except container images) needed for a pallet to be applied to a Docker host. Required repos & pallets are included directly in the bundle.
type BundleInclusionOverride ¶ added in v0.7.0
type BundleInclusionOverride struct { // Path is the path of the override. This should be a filesystem path. Path string `yaml:"path"` // Version is the version or pseudoversion of the override, if one can be determined. Version string `yaml:"version"` // Clean indicates whether the override has been determined to have no changes beyond its latest // Git commit, if the it's version-controlled with Git. Clean bool `yaml:"clean"` }
type BundleInclusions ¶ added in v0.7.0
type BundleInclusions struct { // Pallets describes external pallets used to build the bundled pallet. Pallets map[string]BundlePalletInclusion `yaml:"pallets,omitempty"` // Repos describes package repositories used to build the bundled pallet. Repos map[string]BundleRepoInclusion `yaml:"repositories,omitempty"` }
BundleInclusions describes the requirements used to build the bundled pallet.
func (*BundleInclusions) HasInclusions ¶ added in v0.7.0
func (i *BundleInclusions) HasInclusions() bool
func (*BundleInclusions) HasOverrides ¶ added in v0.7.0
func (i *BundleInclusions) HasOverrides() bool
type BundleManifest ¶ added in v0.7.0
type BundleManifest struct { // ForkliftVersion indicates that the pallet bundle was created assuming the semantics of a given // version of Forklift. The version must be a valid Forklift version, and it sets the minimum // version of Forklift required to use the pallet bundle. The Forklift tool refuses to use pallet // bundles declaring newer Forklift versions for any operations beyond printing information. The // Forklift version of the pallet bundle must be greater than or equal to the Forklift version of // every required Forklift repo or pallet bundle. ForkliftVersion string `yaml:"forklift-version"` // Pallet describes the basic metadata for the bundled pallet. Pallet BundlePallet `yaml:"pallet"` // Includes describes repos and pallets used to define the bundle's package deployments. Includes BundleInclusions `yaml:"includes,omitempty"` // Imports lists the files imported from required pallets and the fully-qualified paths of those // source files (relative to their respective source pallets). Keys are the target paths of the // files, while values are lists showing the chain of provenance of the respective files (with // the deepest ancestor at the end of each list). Imports map[string][]string `yaml:"imports,omitempty"` // Downloads lists the URLs of files and OCI images downloaded for export by the bundle's // deployments. Keys are names of the bundle's deployments which export downloaded files. Downloads map[string][]string `yaml:"downloads,omitempty"` // Deploys describes deployments provided by the bundle. Keys are names of deployments. Deploys map[string]DeplDef `yaml:"deploys,omitempty"` // Exports lists the target paths of file exports provided by the bundle's deployments. Keys are // names of the bundle's deployments which provide file exports. Exports map[string][]string `yaml:"exports,omitempty"` }
A BundleManifest describes a Forklift pallet bundle.
type BundlePallet ¶ added in v0.7.0
type BundlePallet struct { // Path is the pallet bundle's path, which acts as the canonical name for the pallet bundle. It // should just be the path of the VCS repository for the bundled pallet. Path string `yaml:"path"` // Version is the version or pseudoversion of the bundled pallet, if one can be determined. Version string `yaml:"version"` // Clean indicates whether the bundled pallet has been determined to have no changes beyond its // latest Git commit, if the pallet is version-controlled with Git. This does not account for // overrides of required repos/pallets - those should be checked in BundleInclusions instead. Clean bool `yaml:"clean"` // Description is a short description of the bundled pallet to be shown to users. Description string `yaml:"description,omitempty"` }
BundlePallet describes a bundle's bundled pallet.
type BundlePalletInclusion ¶ added in v0.7.0
type BundlePalletInclusion struct { Req PalletReq `yaml:"requirement,inline"` // Override describes the pallet used to override the required pallet, if an override was // specified for the pallet when building the bundled pallet. Override BundleInclusionOverride `yaml:"override,omitempty"` // Includes describes pallets used to define the pallet, omitting information about file imports. Includes map[string]BundlePalletInclusion `yaml:"includes,omitempty"` // Imports lists the files imported from the pallet, organized by import group. Keys are the names // of the import groups, and values are the results of evaluating the respective import groups - // i.e. maps whose keys are target file paths (where the files are imported to) and whose values // are source file paths (where the files are imported from). Imports map[string]map[string]string `yaml:"imports,omitempty"` }
BundlePalletInclusion describes a pallet used to build the bundled pallet.
type BundleRepoInclusion ¶ added in v0.7.0
type BundleRepoInclusion struct { Req RepoReq `yaml:"requirement,inline"` // Override describes the pallet used to override the required pallet, if an override was // specified for the pallet when building the bundled pallet. Override BundleInclusionOverride `yaml:"override,omitempty"` }
BundleRepoInclusion describes a package repository used to build the bundled pallet.
type CommitTimeGetter ¶ added in v0.1.8
type Depl ¶
type Depl struct { // Name is the name of the package depoyment. Name string // Def is the Forklift package deployment definition for the deployment. Def DeplDef }
A Depl is a package deployment, a complete declaration of how a package is to be deployed on a Docker host.
func FilterDeplsForEnabled ¶ added in v0.4.0
FilterDeplsForEnabled filters a slice of Depls to only include those which are not disabled.
func (*Depl) ResAttachmentSource ¶ added in v0.2.0
ResAttachmentSource returns the source path for resources under the Depl instance. The resulting slice is useful for constructing core.AttachedRes instances.
type DeplConflict ¶ added in v0.1.8
type DeplConflict struct { First *ResolvedDepl Second *ResolvedDepl // Possible conflicts Name bool Listeners []core.ResConflict[core.ListenerRes] Networks []core.ResConflict[core.NetworkRes] Services []core.ResConflict[core.ServiceRes] Filesets []core.ResConflict[core.FilesetRes] FileExports []core.ResConflict[core.FileExportRes] }
func CheckDeplConflicts ¶ added in v0.1.8
func CheckDeplConflicts(depls []*ResolvedDepl) (conflicts []DeplConflict, err error)
CheckDeplConflicts produces a slice of reports of all resource conflicts among all provided ResolvedDepl instances.
func (DeplConflict) HasConflict ¶ added in v0.1.8
func (c DeplConflict) HasConflict() bool
func (DeplConflict) HasFileExportConflict ¶ added in v0.7.0
func (c DeplConflict) HasFileExportConflict() bool
func (DeplConflict) HasFilesetConflict ¶ added in v0.5.2
func (c DeplConflict) HasFilesetConflict() bool
func (DeplConflict) HasListenerConflict ¶ added in v0.1.8
func (c DeplConflict) HasListenerConflict() bool
func (DeplConflict) HasNameConflict ¶ added in v0.1.8
func (c DeplConflict) HasNameConflict() bool
func (DeplConflict) HasNetworkConflict ¶ added in v0.1.8
func (c DeplConflict) HasNetworkConflict() bool
func (DeplConflict) HasServiceConflict ¶ added in v0.1.8
func (c DeplConflict) HasServiceConflict() bool
type DeplDef ¶ added in v0.1.8
type DeplDef struct { // Package is the package path of the package to deploy. Package string `yaml:"package"` // Features is a list of features from the package which should be enabled in the deployment. Features []string `yaml:"features,omitempty"` // Disabled represents whether the deployment should be ignored. Disabled bool `yaml:"disabled,omitempty"` }
A DeplDef defines a package deployment.
type FSBundle ¶ added in v0.7.0
type FSBundle struct { // Bundle is the pallet bundle at the root of the filesystem. Bundle // FS is a filesystem which contains the bundle's contents. FS core.PathedFS }
A FSBundle is a Forklift pallet bundle stored at the root of a fs.FS filesystem.
func LoadFSBundle ¶ added in v0.7.0
LoadFSBundle loads a FSBundle from a specified directory path in the provided base filesystem.
func NewFSBundle ¶ added in v0.7.0
func (*FSBundle) AddResolvedDepl ¶ added in v0.7.0
func (b *FSBundle) AddResolvedDepl(depl *ResolvedDepl) (err error)
func (*FSBundle) LoadFSPkgs ¶ added in v0.7.0
func (*FSBundle) LoadFSRepo ¶ added in v0.7.0
func (*FSBundle) LoadFSRepos ¶ added in v0.7.0
func (*FSBundle) LoadPkgReq ¶ added in v0.7.0
func (*FSBundle) LoadResolvedDepl ¶ added in v0.7.0
func (b *FSBundle) LoadResolvedDepl(name string) (depl *ResolvedDepl, err error)
func (*FSBundle) SetBundledPallet ¶ added in v0.7.0
func (*FSBundle) WriteFileExports ¶ added in v0.7.0
func (b *FSBundle) WriteFileExports(dlCache *FSDownloadCache) error
func (*FSBundle) WriteManifestFile ¶ added in v0.7.0
func (*FSBundle) WriteRepoDefFile ¶ added in v0.7.0
WriteRepoDefFile creates a repo definition file at the packages path, so that all loaded packages are associated with a repo.
type FSDownloadCache ¶ added in v0.7.2
type FSDownloadCache struct { // FS is the filesystem which corresponds to the cache of downloads. FS core.PathedFS }
FSDownloadCache is a source of downloaded files saved on the filesystem.
func (*FSDownloadCache) Exists ¶ added in v0.7.2
func (c *FSDownloadCache) Exists() bool
Exists checks whether the cache actually exists on the OS's filesystem.
func (*FSDownloadCache) GetFilePath ¶ added in v0.7.2
func (c *FSDownloadCache) GetFilePath(downloadURL string) (string, error)
GetFilePath returns the path where the file from the specified URL should be stored in the cache's filesystem, if it is in the cache.
func (*FSDownloadCache) GetOCIImagePath ¶ added in v0.7.2
func (c *FSDownloadCache) GetOCIImagePath(imageName string) (string, error)
GetOCIImagePath returns the path where the OCI container image with the specified image name should be stored in the cache's filesystem, if it is in the cache.
func (*FSDownloadCache) HasFile ¶ added in v0.7.2
func (c *FSDownloadCache) HasFile(downloadURL string) (bool, error)
HasFile checks whether the file from the specified URL is stored in the cache.
func (*FSDownloadCache) HasOCIImage ¶ added in v0.7.2
func (c *FSDownloadCache) HasOCIImage(imageName string) (bool, error)
HasOCIImage checks whether the OCI container image with the specified image name is stored in the cache.
func (*FSDownloadCache) LoadFile ¶ added in v0.7.2
func (c *FSDownloadCache) LoadFile(downloadURL string) ([]byte, error)
LoadFile loads the file downloaded from the specified URL.
func (*FSDownloadCache) OpenFile ¶ added in v0.7.2
func (c *FSDownloadCache) OpenFile(downloadURL string) (fs.File, error)
OpenFile opens the file downloaded from the specified URL.
func (*FSDownloadCache) OpenOCIImage ¶ added in v0.7.2
func (c *FSDownloadCache) OpenOCIImage(imageName string) (fs.File, error)
OpenOCIImage opens the OCI container image downloaded from the specified image name.
func (*FSDownloadCache) Path ¶ added in v0.7.2
func (c *FSDownloadCache) Path() string
Path returns the path of the cache's filesystem.
func (*FSDownloadCache) Remove ¶ added in v0.7.2
func (c *FSDownloadCache) Remove() error
Remove deletes the cache from the OS's filesystem, if it exists.
type FSMirrorCache ¶
type FSMirrorCache struct { // FS is the filesystem which corresponds to the cache of pallets. FS core.PathedFS }
FSMirrorCache is a PathedPalletCache implementation with git repository mirrors stored in a core.PathedFS filesystem.
func (*FSMirrorCache) Exists ¶
func (c *FSMirrorCache) Exists() bool
Exists checks whether the cache actually exists on the OS's filesystem.
func (*FSMirrorCache) Path ¶
func (c *FSMirrorCache) Path() string
Path returns the path of the cache's filesystem.
func (*FSMirrorCache) Remove ¶
func (c *FSMirrorCache) Remove() error
Remove deletes the cache from the OS's filesystem, if it exists.
type FSPallet ¶ added in v0.3.0
type FSPallet struct { // Pallet is the pallet at the root of the filesystem. Pallet // Repo is the package repository at the root of the filesystem. It may be defined either // explicitly or implicitly. Repo *core.FSRepo // FS is a filesystem which contains the pallet's contents. FS core.PathedFS }
A FSPallet is a Forklift pallet stored at the root of a fs.FS filesystem.
func LoadFSPallet ¶ added in v0.3.0
LoadFSPallet loads a FSPallet from the specified directory path in the provided base filesystem.
func LoadFSPalletContaining ¶ added in v0.3.0
LoadFSPalletContaining loads the FSPallet containing the specified sub-directory path in the provided base filesystem. The provided path should use the host OS's path separators. The sub-directory path does not have to actually exist.
func LoadFSPallets ¶ added in v0.6.0
LoadFSPallets loads all FSPallets from the provided base filesystem matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching pallet directories to search for. In the embedded Pallet of each loaded FSPallet, the version is *not* initialized.
func MergeFSPallet ¶
func MergeFSPallet( shallow *FSPallet, palletLoader FSPalletLoader, prohibitedPallets structures.Set[string], ) (merged *FSPallet, err error)
MergeFSPallet creates a new FSPallet with a virtual (read-only) filesystem created by evaluating the pallet's file imports with its required pallets (which should be loadable using the provided loader).
func (*FSPallet) Exists ¶ added in v0.3.0
Exists checks whether the pallet actually exists on the OS's filesystem.
func (*FSPallet) GetDeplsFS ¶ added in v0.7.2
GetDeplsFS returns the fs.FS in the pallet which contains package deployment declarations.
func (*FSPallet) GetFeaturesFS ¶
GetFeaturesFS returns the fs.FS in the pallet which contains pallet feature flag declarations.
func (*FSPallet) GetPalletReqsFS ¶ added in v0.6.0
GetPalletReqsFS returns the fs.FS in the pallet which contains pallet requirement definitions.
func (*FSPallet) GetRepoReqsFS ¶ added in v0.3.0
GetRepoReqsFS returns the fs.FS in the pallet which contains repo requirement definitions.
func (*FSPallet) LoadDepl ¶ added in v0.3.0
LoadDepl loads the Depl with the specified name from the pallet.
func (*FSPallet) LoadDepls ¶ added in v0.3.0
LoadDepls loads all package deployment declarations matching the specified search pattern. The search pattern should not include the file extension for deployment specification files - the file extension will be appended to the search pattern by LoadDepls.
func (*FSPallet) LoadFSPalletReq ¶ added in v0.6.0
func (p *FSPallet) LoadFSPalletReq(palletPath string) (r *FSPalletReq, err error)
LoadFSPalletReq loads the FSPalletReq from the pallet for the pallet with the specified path.
func (*FSPallet) LoadFSPalletReqs ¶ added in v0.6.0
func (p *FSPallet) LoadFSPalletReqs(searchPattern string) ([]*FSPalletReq, error)
LoadFSPalletReqs loads all FSPalletReqs from the pallet matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching the pallet paths to search for.
func (*FSPallet) LoadFSPkg ¶
LoadFSPkg loads a package at the specified filesystem path from the FSPallet instance The loaded package is fully initialized.
func (*FSPallet) LoadFSPkgs ¶
LoadFSPkgs loads all packages in the FSPallet instance. The loaded packages are fully initialized.
func (*FSPallet) LoadFSRepoReq ¶ added in v0.3.0
LoadFSRepoReq loads the FSRepoReq from the pallet for the repo with the specified path.
func (*FSPallet) LoadFSRepoReqs ¶ added in v0.3.0
LoadFSRepoReqs loads all FSRepoReqs from the pallet matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching the repo paths to search for.
func (*FSPallet) LoadFeature ¶
func (p *FSPallet) LoadFeature(name string, loader FSPalletLoader) (imp Import, err error)
LoadFeature loads the Import declared by the specified feature flag name. The feature name is assumed to be either a path relative to the root of the pallet's filesystem, beginning with a "/", or (if the provided pallet loader is non-nil) a fully-qualified path in the form "github.com/repo-owner/repo-name/feature-subdir-path" (e.g. "github.com/PlanktoScope/pallet-standard/features/all").
func (*FSPallet) LoadFeatures ¶
LoadFeatures loads all Imports from the pallet matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching the feature paths to search for (but excluding the file extension for feature declaration files).
func (*FSPallet) LoadImport ¶
LoadImport loads the Import with the specified name from the pallet.
func (*FSPallet) LoadImports ¶
LoadImports loads all package deployment declarations matching the specified search pattern. The search pattern should not include the file extension for import group files - the file extension will be appended to the search pattern by LoadImports.
func (*FSPallet) LoadPalletReq ¶
LoadPalletReq loads the PalletReq from the pallet with the specified pallet path.
func (*FSPallet) LoadPkgReq ¶ added in v0.3.0
LoadPkgReq loads the PkgReq from the pallet for the package with the specified package path.
func (*FSPallet) LoadReadme ¶ added in v0.4.0
LoadReadme loads the readme file defined by the pallet.
type FSPalletCache ¶ added in v0.2.0
type FSPalletCache struct { // FS is the filesystem which corresponds to the cache of pallets. FS core.PathedFS }
FSPalletCache is a PathedPalletCache implementation with copies of pallets stored in a core.PathedFS filesystem.
func (*FSPalletCache) Exists ¶ added in v0.2.0
func (c *FSPalletCache) Exists() bool
Exists checks whether the cache actually exists on the OS's filesystem.
func (*FSPalletCache) LoadFSPallet ¶ added in v0.2.0
func (c *FSPalletCache) LoadFSPallet(pltPath string, version string) (*FSPallet, error)
LoadFSPallet loads the FSPallet with the specified path and version. The loaded FSPallet instance is fully initialized.
func (*FSPalletCache) LoadFSPallets ¶ added in v0.2.0
func (c *FSPalletCache) LoadFSPallets(searchPattern string) ([]*FSPallet, error)
LoadFSPallets loads all FSPallets from the cache matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching pallet directories to search for. The loaded FSPallet instances are fully initialized.
func (*FSPalletCache) Path ¶ added in v0.2.0
func (c *FSPalletCache) Path() string
Path returns the path of the cache's filesystem.
func (*FSPalletCache) Remove ¶ added in v0.2.0
func (c *FSPalletCache) Remove() error
Remove deletes the cache from the OS's filesystem, if it exists.
type FSPalletLoader ¶ added in v0.2.0
type FSPalletLoader interface { // LoadFSPallet loads the FSPallet with the specified path and version. LoadFSPallet(palletPath string, version string) (*FSPallet, error) // LoadFSPallets loads all FSPallets matching the specified search pattern. LoadFSPallets(searchPattern string) ([]*FSPallet, error) }
FSPalletLoader is a source of [FSPallet]s indexed by path and version.
type FSPalletReq ¶ added in v0.2.0
type FSPalletReq struct { // PalletReq is the pallet requirement at the root of the filesystem. PalletReq // FS is a filesystem which contains the pallet requirement's contents. FS core.PathedFS }
A FSPalletReq is a pallet requirement stored at the root of a fs.FS filesystem.
func LoadFSPalletReqContaining ¶
func LoadFSPalletReqContaining(fsys core.PathedFS, subdirPath string) (*FSPalletReq, error)
LoadFSPalletReqContaining loads the FSPalletReq containing the specified sub-directory path in the provided base filesystem. The sub-directory path does not have to actually exist; however, it would usually be provided as a package path.
type FSPkgLoader ¶ added in v0.1.8
type FSPkgLoader interface { // LoadFSPkg loads the FSPkg with the specified path and version. LoadFSPkg(pkgPath string, version string) (*core.FSPkg, error) // LoadFSPkgs loads all FSPkgs matching the specified search pattern. LoadFSPkgs(searchPattern string) ([]*core.FSPkg, error) }
FSPkgLoader is a source of [core.FSPkg]s indexed by path and version.
type FSRepoCache ¶ added in v0.3.0
type FSRepoCache struct { // FS is the filesystem which corresponds to the cache of repos. FS core.PathedFS }
FSRepoCache is a PathedRepoCache implementation with copies of repos (and thus of packages too) stored in a core.PathedFS filesystem.
func (*FSRepoCache) Exists ¶ added in v0.3.0
func (c *FSRepoCache) Exists() bool
Exists checks whether the cache actually exists on the OS's filesystem.
func (*FSRepoCache) LoadFSPkg ¶ added in v0.3.0
LoadFSPkg loads the FSPkg with the specified path and version. The loaded FSPkg instance is fully initialized.
func (*FSRepoCache) LoadFSPkgs ¶ added in v0.3.0
func (c *FSRepoCache) LoadFSPkgs(searchPattern string) ([]*core.FSPkg, error)
LoadFSPkgs loads all FSPkgs from the cache matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching package directories to search for. The loaded FSPkg instances are fully initialized.
func (*FSRepoCache) LoadFSRepo ¶ added in v0.3.0
LoadFSRepo loads the FSRepo with the specified path and version. The loaded FSRepo instance is fully initialized.
func (*FSRepoCache) LoadFSRepos ¶ added in v0.3.0
func (c *FSRepoCache) LoadFSRepos(searchPattern string) ([]*core.FSRepo, error)
LoadFSRepos loads all FSRepos from the cache matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching repo directories to search for. The loaded FSRepo instances are fully initialized.
func (*FSRepoCache) Path ¶ added in v0.3.0
func (c *FSRepoCache) Path() string
Path returns the path of the cache's filesystem.
func (*FSRepoCache) Remove ¶ added in v0.3.0
func (c *FSRepoCache) Remove() error
Remove deletes the cache from the OS's filesystem, if it exists.
type FSRepoLoader ¶ added in v0.1.8
type FSRepoLoader interface { // LoadFSRepo loads the FSRepo with the specified path and version. LoadFSRepo(repoPath string, version string) (*core.FSRepo, error) // LoadFSRepos loads all FSRepos matching the specified search pattern. LoadFSRepos(searchPattern string) ([]*core.FSRepo, error) }
FSRepoLoader is a source of [core.FSRepo]s indexed by path and version.
type FSRepoReq ¶ added in v0.1.8
type FSRepoReq struct { // RepoReq is the repo requirement at the root of the filesystem. RepoReq // FS is a filesystem which contains the repo requirement's contents. FS core.PathedFS }
A FSRepoReq is a repo requirement stored at the root of a fs.FS filesystem.
func LoadFSRepoReqContaining ¶ added in v0.7.2
LoadFSRepoReqContaining loads the FSRepoReq containing the specified sub-directory path in the provided base filesystem. The sub-directory path does not have to actually exist; however, it would usually be provided as a package path.
type FSStageStore ¶ added in v0.7.0
type FSStageStore struct { // Manifest is the Forklift stage store's manifest. Manifest StageStoreManifest // FS is the filesystem which corresponds to the store of staged pallets. FS core.PathedFS }
FSStageStore is a source of bundles rooted at a single path, with bundles stored as incrementally-numbered directories within a core.PathedFS filesystem.
func LoadFSStageStore ¶ added in v0.7.0
func LoadFSStageStore(fsys core.PathedFS, subdirPath string) (s *FSStageStore, err error)
LoadFSStageStore loads a FSStageStore from the specified directory path in the provided base filesystem.
func (*FSStageStore) AllocateNew ¶ added in v0.7.0
func (s *FSStageStore) AllocateNew() (index int, err error)
AllocateNew creates a new directory for a staged pallet in the store with a new highest index.
func (*FSStageStore) CommitState ¶ added in v0.7.0
func (s *FSStageStore) CommitState() error
CommitState atomically updates the stage store's manifest file. Warning: on non-Unix platforms, the update is not entirely atomic!
func (*FSStageStore) Exists ¶ added in v0.7.0
func (s *FSStageStore) Exists() bool
Exists checks whether the store actually exists on the OS's filesystem.
func (*FSStageStore) GetBundlePath ¶ added in v0.7.0
func (s *FSStageStore) GetBundlePath(index int) string
GetBundlePath returns the full filesystem path of the pallet bundle at the specified index, whether or not a bundle actually exists on the filesystem at that index.
func (*FSStageStore) GetCurrent ¶ added in v0.7.0
func (s *FSStageStore) GetCurrent() (index int, ok bool)
GetCurrent returns the last stage which was successfully applied. It returns not-`ok` if no stage has been successfully applied so far.
func (*FSStageStore) GetNext ¶ added in v0.7.0
func (s *FSStageStore) GetNext() (index int, ok bool)
GetNext returns the next stage to be applied. It returns not-`ok` if no stage is to be applied.
func (*FSStageStore) GetPending ¶ added in v0.7.0
func (s *FSStageStore) GetPending() (index int, ok bool)
GetPending returns the next stage to be applied, if it's different from the last stage which was successfully applied. It returns not-`ok` if there is no next stage to be applied or if the two stages are identical.
func (*FSStageStore) GetRollback ¶ added in v0.7.0
func (s *FSStageStore) GetRollback() (index int, ok bool)
GetRollback returns the previous stage which was successfully applied before the last stage which was successfully applied. It returns not-`ok` if no such stage exists.
func (*FSStageStore) IdentifyHighest ¶ added in v0.7.0
func (s *FSStageStore) IdentifyHighest() (index int, err error)
IdentifyHighest identifies the staged pallet in the store with the highest index. Only positive indices are considered. If the cache is empty, an error is returned with zero as an index.
func (*FSStageStore) List ¶ added in v0.7.0
func (s *FSStageStore) List() (indices []int, err error)
List returns a numerically-sorted (in ascending order) list of staged pallet bundles in the store. Only positive indices are included.
func (*FSStageStore) LoadFSBundle ¶ added in v0.7.0
func (s *FSStageStore) LoadFSBundle(index int) (*FSBundle, error)
LoadFSBundle loads the FSBundle with the specified index. The loaded FSBundle instance is fully initialized.
func (*FSStageStore) NextFailed ¶ added in v0.7.0
func (s *FSStageStore) NextFailed() bool
NextFailed returns whether the next stage to be applied has encountered a failed application.
func (*FSStageStore) Path ¶ added in v0.7.0
func (s *FSStageStore) Path() string
Path returns the path of the store's filesystem.
func (*FSStageStore) RecordNextSuccess ¶ added in v0.7.0
func (s *FSStageStore) RecordNextSuccess(succeeded bool)
RecordNextSuccess records the whether stage which was to be applied had a successful application.
func (*FSStageStore) Remove ¶ added in v0.7.0
func (s *FSStageStore) Remove() error
Remove deletes the store from the OS's filesystem, if it exists.
func (*FSStageStore) RemoveBundleHistory ¶ added in v0.7.0
func (s *FSStageStore) RemoveBundleHistory(index int)
RemoveBundleHistory removes the specified bundle from the history.
func (*FSStageStore) RemoveBundleNames ¶ added in v0.7.0
func (s *FSStageStore) RemoveBundleNames(index int)
RemoveBundleNames removes all names for the specified bundle.
func (*FSStageStore) SetNext ¶ added in v0.7.0
func (s *FSStageStore) SetNext(index int)
SetNext sets the specified stage as the next one to be applied and resets the flag tracking whether the next stage to be applied has failed. It assumes that the specified stage actually exists. Setting a value of 0 will clear the state of the next stage to be applied, so no stage will be applied next.
type FSWorkspace ¶ added in v0.1.8
func LoadWorkspace ¶ added in v0.1.8
func LoadWorkspace(dirPath string) (*FSWorkspace, error)
LoadWorkspace loads the workspace at the specified path. The workspace is usually just a home directory, e.g. $HOME; directories in the workspace are organized with the same structure as the default structure described by the [XDG base directory spec](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). The provided path must use the host OS's path separators.
func (*FSWorkspace) CommitCurrentPalletUpgrades ¶
func (w *FSWorkspace) CommitCurrentPalletUpgrades(query GitRepoQuery) error
CommitCurrentPalletUpgrades atomoically updates the current pallet upgrades file. Warning: on non-Unix platforms, the update is not entirely atomic!
func (*FSWorkspace) GetCurrentPallet ¶ added in v0.3.0
func (w *FSWorkspace) GetCurrentPallet() (*FSPallet, error)
func (*FSWorkspace) GetCurrentPalletPath ¶ added in v0.3.0
func (w *FSWorkspace) GetCurrentPalletPath() string
func (*FSWorkspace) GetCurrentPalletUpgrades ¶
func (w *FSWorkspace) GetCurrentPalletUpgrades() (GitRepoQuery, error)
func (*FSWorkspace) GetDataPath ¶ added in v0.6.0
func (w *FSWorkspace) GetDataPath() string
func (*FSWorkspace) GetDownloadCache ¶ added in v0.7.2
func (w *FSWorkspace) GetDownloadCache() (*FSDownloadCache, error)
func (*FSWorkspace) GetDownloadCachePath ¶ added in v0.7.2
func (w *FSWorkspace) GetDownloadCachePath() string
func (*FSWorkspace) GetMirrorCache ¶
func (w *FSWorkspace) GetMirrorCache() (*FSMirrorCache, error)
func (*FSWorkspace) GetMirrorCachePath ¶
func (w *FSWorkspace) GetMirrorCachePath() string
func (*FSWorkspace) GetPalletCache ¶ added in v0.2.0
func (w *FSWorkspace) GetPalletCache() (*FSPalletCache, error)
func (*FSWorkspace) GetPalletCachePath ¶ added in v0.2.0
func (w *FSWorkspace) GetPalletCachePath() string
func (*FSWorkspace) GetRepoCache ¶ added in v0.3.0
func (w *FSWorkspace) GetRepoCache() (*FSRepoCache, error)
func (*FSWorkspace) GetRepoCachePath ¶ added in v0.3.0
func (w *FSWorkspace) GetRepoCachePath() string
func (*FSWorkspace) GetStageStore ¶ added in v0.7.0
func (w *FSWorkspace) GetStageStore(newStateStoreVersion string) (*FSStageStore, error)
GetStageStore loads the workspace's stage store from the path, initializing a state file (which has the specified minimum supported Forklift tool version) if it does not already exist.
func (*FSWorkspace) GetStageStorePath ¶ added in v0.7.0
func (w *FSWorkspace) GetStageStorePath() string
type FileRef ¶
type FileRef struct { // Ordered identifiers of the sources of the file reference, e.g. the pallet at the root of the FS Sources []string // The FS which the file can be loaded from FS core.PathedFS // The path where the file exists relative to the root of the FS Path string }
A FileRef is a reference to a file in a core.PathedFS by its file path.
type GitRepoQuery ¶
type GitRepoQuery struct { // Path is the path of the pallet or Forklift repo being queried // (e.g. github.com/PlanktoScope/pallet-standard) Path string `yaml:"path"` // VersionQuery is the version query of the pallet or Forklift repo being queried // (e.g. edge or stable or v2024.0.0-beta.0) VersionQuery string `yaml:"version-query"` }
A GitRepoQuery holds settings for upgrading the locked version of a Git repo from the refs (branches & tags) in its origin.
func (GitRepoQuery) Complete ¶
func (q GitRepoQuery) Complete() bool
func (GitRepoQuery) Overlay ¶
func (q GitRepoQuery) Overlay(r GitRepoQuery) GitRepoQuery
func (GitRepoQuery) String ¶
func (q GitRepoQuery) String() string
func (GitRepoQuery) Write ¶
func (q GitRepoQuery) Write(outputPath string) error
type GitRepoReq ¶ added in v0.6.0
type GitRepoReq struct { // GitRepoPath is the path of the required Git repository. RequiredPath string `yaml:"-"` // VersionLock specifies the version of the required Git repository. VersionLock VersionLock `yaml:"version-lock"` }
A GitRepoReq is a requirement for a specific Git repository (e.g. a pallet or Forklift repo) at a specific version.
func (GitRepoReq) GetQueryPath ¶ added in v0.6.0
func (r GitRepoReq) GetQueryPath() string
GetQueryPath returns the path of the Git repo in version queries, which is of form gitRepoPath@version (e.g. github.com/PlanktoScope/pallets/core@v0.1.0).
func (GitRepoReq) Path ¶ added in v0.6.0
func (r GitRepoReq) Path() string
Path returns the path of the required Git repo.
type Import ¶
type Import struct { // Name is the name of the file import group. Name string // Def is the file import definition for the file import group. Def ImportDef }
An Import is an import group, a declaration of a group of files to import from a required pallet.
func FilterImportsForEnabled ¶
FilterImportsForEnabled filters a slice of Imports to only include those which are not disabled.
type ImportDef ¶
type ImportDef struct { // Description is a short description of the import group to be shown to users. Description string `yaml:"description,omitempty"` // Modifiers is a list of modifiers evaluated in the provided order to build up a set of files to // import. Modifiers []ImportModifier `yaml:"modifiers"` // Disabled represents whether the import should be ignored. Disabled bool `yaml:"disabled,omitempty"` // Deprecated is a deprecation notice which, if specified as a non-empty string, causes warnings // to be issued whenever the file import group is used via a feature flag. Deprecated string `yaml:"deprecated,omitempty"` }
A ImportDef defines a file import group.
func (ImportDef) AddDefaults ¶
func (ImportDef) RemoveDefaults ¶
type ImportModifier ¶
type ImportModifier struct { // Description is a short description of the import modifier to be shown to users. Description string `yaml:"description,omitempty"` // Type is either `add` (for adding one or more files to the set of files to import), `remove` // (for removing one or more files from the set of files to import), `add-feature` (for adding // files specified by a feature flag to the set of files to import), or `remove-feature` (for // removing one or more files specified by a feature flag from the set of files to import). Type string `yaml:"type,omitempty"` // Source is the path in the required pallet of the file/directory to be imported, for an `add` // modifier; or the name of a feature flag, for an `add-feature` or `remove-feature` modifier. If // omitted, the source path will be inferred from the Target path. Source string `yaml:"source,omitempty"` // Target is the path which the file/directory will be imported as, for an `add` modifier; or the // path of the file/directory which will be removed from the set of files to import, for a // `remove` modifier. Target string `yaml:"target,omitempty"` // OnlyMatchingAny is, if the source is a directory, a list of glob patterns (relative to the // source path) of files which will be added/removed (depending on modifier type). Any file which // matches none of patterns provided in this field will be ignored for the add/remove modifier. If // omitted, no files in the source directory will be ignored. OnlyMatchingAny []string `yaml:"only-matching-any,omitempty"` }
An ImportModifier defines an operation for transforming a set of files for importing into a different set of files for importing.
func (ImportModifier) CheckDeprecations ¶
func (m ImportModifier) CheckDeprecations( pallet *FSPallet, loader FSPalletLoader, ) (deprecations []error, err error)
CheckDeprecations returns a list of [error]s for any directly-referenced or transitively-referenced features in the specified pallet which are deprecated.
type LayeredPalletCache ¶ added in v0.2.0
type LayeredPalletCache struct { // Underlay is the underlying cache. Underlay PathedPalletCache // Overlay is the overlying cache which is used instead of the underlying cache for pallets // covered by the overlying cache. Overlay OverlayPalletCache }
LayeredPalletCache is a PathedPalletCache implementation where selected pallets can be overridden by an OverlayPalletCache, for loading pallets. The path of the LayeredPalletCache instance is just the path of the underlying cache.
func (*LayeredPalletCache) LoadFSPallet ¶ added in v0.2.0
func (c *LayeredPalletCache) LoadFSPallet(pltPath string, version string) (*FSPallet, error)
LoadFSPallet loads the FSPallet with the specified path and version. The loaded FSPallet instance is fully initialized. If the overlay cache expects to have the pallet, it will attempt to load the pallet; otherwise, the underlay cache will attempt to load the pallet.
func (*LayeredPalletCache) LoadFSPallets ¶ added in v0.2.0
func (c *LayeredPalletCache) LoadFSPallets(searchPattern string) ([]*FSPallet, error)
LoadFSPallets loads all FSPallets from the cache matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching pallet directories to search for. The loaded FSPallet instances are fully initialized. All matching pallets from the overlay cache will be included; all matching pallets from the underlay cache will also be included, except for those pallets which the overlay cache expected to have.
func (*LayeredPalletCache) Path ¶ added in v0.2.0
func (c *LayeredPalletCache) Path() string
Path returns the path of the underlying cache.
type LayeredRepoCache ¶ added in v0.3.0
type LayeredRepoCache struct { // Underlay is the underlying cache. Underlay PathedRepoCache // Overlay is the overlying cache which is used instead of the underlying cache for repos and // packages covered by the overlying cache. Overlay OverlayRepoCache }
LayeredRepoCache is a PathedRepoCache implementation where selected repos can be overridden by an OverlayRepoCache, for loading repos and packages. The path of the LayeredRepoCache instance is just the path of the underlying cache.
func (*LayeredRepoCache) LoadFSPkg ¶ added in v0.3.0
LoadFSPkg loads the FSPkg with the specified path and version. The loaded FSPkg instance is fully initialized. If the overlay cache expects to have the package, it will attempt to load the package; otherwise, the underlay cache will attempt to load the package.
func (*LayeredRepoCache) LoadFSPkgs ¶ added in v0.3.0
func (c *LayeredRepoCache) LoadFSPkgs(searchPattern string) ([]*core.FSPkg, error)
LoadFSPkgs loads all FSPkgs from the cache matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching package directories to search for. The loaded FSPkg instances are fully initialized. All matching packages from the overlay cache will be included; all matching packages from the underlay cache will also be included, except for those packages which the overlay cache expected to have.
func (*LayeredRepoCache) LoadFSRepo ¶ added in v0.3.0
LoadFSRepo loads the FSRepo with the specified path and version. The loaded FSRepo instance is fully initialized. If the overlay cache expects to have the repo, it will attempt to load the repo; otherwise, the underlay cache will attempt to load the repo.
func (*LayeredRepoCache) LoadFSRepos ¶ added in v0.3.0
func (c *LayeredRepoCache) LoadFSRepos(searchPattern string) ([]*core.FSRepo, error)
LoadFSRepos loads all FSRepos from the cache matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching repo directories to search for. The loaded FSRepo instances are fully initialized. All matching repos from the overlay cache will be included; all matching repos from the underlay cache will also be included, except for those repos which the overlay cache expected to have.
func (*LayeredRepoCache) Path ¶ added in v0.3.0
func (c *LayeredRepoCache) Path() string
Path returns the path of the underlying cache.
type MergeFS ¶
type MergeFS struct { // Ordered identifiers of the source(s) of the MergeFS, e.g. the pallet at the root of the FS Overlay core.PathedFS // contains filtered or unexported fields }
A MergeFS is an FS constructed by combining a core.PathedFS as an overlay over an underlay constructed as a collection of references to files in other core.PathedFS instances. The path of the FS is the path of the overlay.
func (*MergeFS) Open ¶
Open opens the named file from the overlay (if it exists in the overlay), or else from an underlay filesystem depending on which one is recorded to have that file.
func (*MergeFS) ReadDir ¶
ReadDir reads the named directory and returns a list of directory entries sorted by filename.
func (*MergeFS) ReadFile ¶
ReadFile returns the contents from reading the named file from the overlay (if it exists in the overlay), or else from an underlay filesystem depending on which one is recorded to have that file.
func (*MergeFS) Resolve ¶
Resolve returns the path of the named file from the overlay (if it exists in the overlay), or else from an underlay filesystem depending on which one is recorded to have that file.
func (*MergeFS) Stat ¶
Stat returns a fs.FileInfo describing the file from the overlay (if it exists in the overlay), or else from an underlay filesystem depending on which one is recorded to have that file.
type MissingDeplDeps ¶ added in v0.2.0
type MissingDeplDeps struct { Depl *ResolvedDepl Networks []core.MissingResDep[core.NetworkRes] Services []core.MissingResDep[core.ServiceRes] Filesets []core.MissingResDep[core.FilesetRes] }
func (MissingDeplDeps) HasMissingDep ¶ added in v0.2.0
func (d MissingDeplDeps) HasMissingDep() bool
func (MissingDeplDeps) HasMissingFilesetDep ¶ added in v0.5.2
func (d MissingDeplDeps) HasMissingFilesetDep() bool
func (MissingDeplDeps) HasMissingNetworkDep ¶ added in v0.2.0
func (d MissingDeplDeps) HasMissingNetworkDep() bool
func (MissingDeplDeps) HasMissingServiceDep ¶ added in v0.2.0
func (d MissingDeplDeps) HasMissingServiceDep() bool
type OverlayPalletCache ¶ added in v0.2.0
type OverlayPalletCache interface { PalletCache // IncludesFSPallet reports whether the cache expects to have the specified pallet. // This result does not necessarily correspond to whether the cache actually has it. IncludesFSPallet(palletPath string, version string) bool }
OverlayPalletCache is a PalletCache which can report whether it includes any particular pallet.
type OverlayRepoCache ¶ added in v0.3.0
type OverlayRepoCache interface { RepoCache // IncludesFSRepo reports whether the cache expects to have the specified repo. // This result does not necessarily correspond to whether the cache actually has it. IncludesFSRepo(repoPath string, version string) bool // IncludesFSPkg reports whether the cache expects to have the specified package. // This result does not necessarily correspond to whether the cache actually has it. IncludesFSPkg(pkgPath string, version string) bool }
OverlayRepoCache is a RepoCache which can report whether it includes any particular repo or package.
type Pallet ¶ added in v0.3.0
type Pallet struct { // Def is the Forklift pallet definition for the pallet. Def PalletDef // Version is the version or pseudoversion of the pallet. Version string }
A Pallet is a Forklift pallet, a complete specification of all package deployments which should be active on a Docker host.
func (Pallet) VersionQuery ¶ added in v0.6.0
VersionQuery represents the Pallet instance as a version query.
type PalletCache ¶ added in v0.2.0
type PalletCache interface { FSPalletLoader }
PalletCache is a source of pallets.
type PalletDef ¶ added in v0.3.0
type PalletDef struct { // ForkliftVersion indicates that the pallet was written assuming the semantics of a given version // of Forklift. The version must be a valid Forklift version, and it sets the minimum version of // Forklift required to use the pallet. The Forklift tool refuses to use pallets declaring newer // Forklift versions for any operations beyond printing information. The Forklift version of the // pallet must be greater than or equal to the Forklift version of every required Forklift repo or // pallet. ForkliftVersion string `yaml:"forklift-version"` // Pallet defines the basic metadata for the pallet. Pallet PalletSpec `yaml:"pallet,omitempty"` }
A PalletDef defines a Forklift pallet.
type PalletOverrideCache ¶ added in v0.2.0
type PalletOverrideCache struct {
// contains filtered or unexported fields
}
PalletOverrideCache is an OverlayPalletCache implementation containing a set of pallets which can be retrieved from the root of the cache. A pallet from the cache will be retrieved if it is stored in the cache with a matching version, regardless of whether the pallet's own version actually matches - in other words, pallets can be stored with fictional versions.
func NewPalletOverrideCache ¶ added in v0.2.0
func NewPalletOverrideCache( overridePallets []*FSPallet, palletVersions map[string][]string, ) (*PalletOverrideCache, error)
NewPalletOverrideCache instantiates a new PalletOverrideCache with a given list of pallets, and a map associating pallet paths with lists of versions which the respective pallets will be associated with.
func (*PalletOverrideCache) IncludesFSPallet ¶ added in v0.2.0
func (c *PalletOverrideCache) IncludesFSPallet(palletPath string, version string) bool
IncludesFSPallet reports whether the PalletOverrideCache instance has a pallet with the specified path and version.
func (*PalletOverrideCache) LoadFSPallet ¶ added in v0.2.0
func (c *PalletOverrideCache) LoadFSPallet(palletPath string, version string) (*FSPallet, error)
LoadFSPallet loads the FSPallet with the specified path, if the version matches any of versions for the pallet in the cache. The loaded FSPallet instance is fully initialized.
func (*PalletOverrideCache) LoadFSPallets ¶ added in v0.2.0
func (c *PalletOverrideCache) LoadFSPallets(searchPattern string) ([]*FSPallet, error)
LoadFSPallets loads all FSPallets matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching pallets to search for. The loaded FSPallet instances are fully initialized.
func (*PalletOverrideCache) SetVersions ¶ added in v0.2.0
func (c *PalletOverrideCache) SetVersions(palletPath string, versions structures.Set[string])
SetVersions configures the cache to cover the specified versions of the specified pallet.
type PalletReq ¶ added in v0.2.0
type PalletReq struct {
GitRepoReq `yaml:",inline"`
}
A PalletReq is a requirement for a specific pallet at a specific version.
func (PalletReq) GetCachePath ¶ added in v0.2.0
GetCachePath returns the path of the pallet in caches, which is of form palletPath@version (e.g. github.com/PlanktoScope/pallets@v0.1.0/core).
func (PalletReq) GetQueryPath ¶ added in v0.2.0
GetQueryPath returns the path of the pallet in version queries, which is of form palletPath@version (e.g. github.com/PlanktoScope/pallets/core@v0.1.0).
type PalletReqLoader ¶
PalletReqLoader is a source of pallet requirements.
type PalletSpec ¶ added in v0.3.0
type PalletSpec struct { // Path is the pallet path, which acts as the canonical name for the pallet. It should just be the // path of the VCS repository for the pallet. Path string `yaml:"path"` // Description is a short description of the pallet to be shown to users. Description string `yaml:"description"` // ReadmeFile is the name of a readme file to be shown to users. ReadmeFile string `yaml:"readme-file"` }
PalletSpec defines the basic metadata for a Forklift pallet.
func (PalletSpec) Check ¶ added in v0.6.0
func (s PalletSpec) Check() (errs []error)
Check looks for errors in the construction of the pallet spec.
type PathedPalletCache ¶ added in v0.2.0
type PathedPalletCache interface { PalletCache core.Pather }
PathedPalletCache is a PalletCache rooted at a single path.
type PathedRepoCache ¶ added in v0.3.0
PathedRepoCache is a RepoCache rooted at a single path.
type PkgReq ¶ added in v0.1.8
type PkgReq struct { // PkgSubdir is the package subdirectory in the repo which should provide the required package. PkgSubdir string // Repo is the repo which should provide the required package. Repo RepoReq }
A PkgReq is a requirement for a package at a specific version.
func LoadRequiredFSPkg ¶ added in v0.1.8
func LoadRequiredFSPkg( pkgReqLoader PkgReqLoader, pkgLoader FSPkgLoader, pkgPath string, ) (*core.FSPkg, PkgReq, error)
LoadRequiredFSPkg loads the specified package from the cache according to the specifications in the package requirements provided by the package requirement loader for the provided package path.
func (PkgReq) GetCachePath ¶ added in v0.1.8
GetCachePath returns the path of the package in caches, which is of form repoPath@version/pkgSubdir (e.g. github.com/PlanktoScope/pallets@v0.1.0/core/infrastructure/caddy-ingress).
func (PkgReq) GetQueryPath ¶ added in v0.1.8
GetQueryPath returns the path of the package in version queries, which is of form repoPath/pkgSubdir@version (e.g. github.com/PlanktoScope/pallets/core/infrastructure/caddy-ingress@v0.1.0).
type PkgReqLoader ¶ added in v0.1.8
PkgReqLoader is a source of package requirements.
type ReadLinkFS ¶
type ReadLinkFS interface { core.PathedFS // ReadLink returns the destination of the named symbolic link. ReadLink(name string) (string, error) // StatLink returns a [fs.FileInfo] describing the file without following any symbolic links. // If there is an error, it should be of type [*fs.PathError]. StatLink(name string) (fs.FileInfo, error) }
ReadLinkFS is the interface implemented by a file system that supports symbolic links. This is a stopgap until https://github.com/golang/go/issues/49580 is implemented.
func DirFS ¶
func DirFS(dir string) ReadLinkFS
DirFS returns a filesystem (a ReadLinkFS) for a tree of files rooted at the directory dir.
type RepoCache ¶ added in v0.3.0
type RepoCache interface { FSRepoLoader FSPkgLoader }
RepoCache is a source of repos and packages.
type RepoOverrideCache ¶ added in v0.1.8
type RepoOverrideCache struct {
// contains filtered or unexported fields
}
RepoOverrideCache is an OverlayRepoCache implementation containing a set of repos which can be retrieved from the root of the cache. A repo from the cache will be retrieved if it is stored in the cache with a matching version, regardless of whether the repo's own version actually matches - in other words, repos can be stored with fictional versions.
func NewRepoOverrideCache ¶ added in v0.1.8
func NewRepoOverrideCache( overrideRepos []*core.FSRepo, repoVersions map[string][]string, ) (*RepoOverrideCache, error)
NewRepoOverrideCache instantiates a new RepoOverrideCache with a given list of repos, and a map associating repo paths with lists of versions which the respective repos will be associated with.
func (*RepoOverrideCache) IncludesFSPkg ¶ added in v0.1.8
func (c *RepoOverrideCache) IncludesFSPkg(pkgPath string, version string) bool
IncludesFSPkg reports whether the RepoOverrideCache instance has a repo with the specified version which covers the specified package path.
func (*RepoOverrideCache) IncludesFSRepo ¶ added in v0.1.8
func (c *RepoOverrideCache) IncludesFSRepo(repoPath string, version string) bool
IncludesFSRepo reports whether the RepoOverrideCache instance has a repo with the specified path and version.
func (*RepoOverrideCache) LoadFSPkg ¶ added in v0.1.8
LoadFSPkg loads the FSPkg with the specified path, if the version matches any of versions for the package's repo in the cache. The loaded FSPkg instance is fully initialized.
func (*RepoOverrideCache) LoadFSPkgs ¶ added in v0.1.8
func (c *RepoOverrideCache) LoadFSPkgs(searchPattern string) ([]*core.FSPkg, error)
LoadFSPkgs loads all FSPkgs matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching package directories to search for. The loaded FSPkg instances are fully initialized.
func (*RepoOverrideCache) LoadFSRepo ¶ added in v0.1.8
LoadFSRepo loads the FSRepo with the specified path, if the version matches any of versions for the repo in the cache. The loaded FSRepo instance is fully initialized.
func (*RepoOverrideCache) LoadFSRepos ¶ added in v0.1.8
func (c *RepoOverrideCache) LoadFSRepos(searchPattern string) ([]*core.FSRepo, error)
LoadFSRepos loads all FSRepos matching the specified search pattern. The search pattern should be a doublestar pattern, such as `**`, matching repos to search for. The loaded FSRepo instances are fully initialized.
func (*RepoOverrideCache) SetVersions ¶ added in v0.1.8
func (c *RepoOverrideCache) SetVersions(repoPath string, versions structures.Set[string])
SetVersions configures the cache to cover the specified versions of the specified repo.
type RepoReq ¶ added in v0.1.8
type RepoReq struct {
GitRepoReq `yaml:",inline"`
}
A RepoReq is a requirement for a specific repo at a specific version.
func (RepoReq) GetCachePath ¶ added in v0.1.8
GetCachePath returns the path of the repo in caches, which is of form repoPath@version (e.g. github.com/PlanktoScope/pallets@v0.1.0/core).
func (RepoReq) GetPkgSubdir ¶ added in v0.1.8
GetPkgSubdir returns the package subdirectory within the required repo for the provided package path.
type ResolvedDepl ¶ added in v0.1.8
type ResolvedDepl struct { // Depl is the declared deployment of the package represented by Pkg. Depl // PkgReq is the package requirement for the deployment. PkgReq PkgReq // Pkg is the package to be deployed. Pkg *core.FSPkg }
A ResolvedDepl is a deployment with a loaded package.
func ResolveDepl ¶ added in v0.1.8
func ResolveDepl( pkgReqLoader PkgReqLoader, pkgLoader FSPkgLoader, depl Depl, ) (resolved *ResolvedDepl, err error)
ResolveDepl loads the package from the FSPkgLoader instance based on the requirements in the provided deployment and the package requirement loader.
func ResolveDepls ¶ added in v0.1.8
func ResolveDepls( pkgReqLoader PkgReqLoader, pkgLoader FSPkgLoader, depls []Depl, ) (resolved []*ResolvedDepl, err error)
ResolveDepls loads the packages from the FSPkgLoader instance based on the requirements in the provided deployments and the package requirement loader.
func (*ResolvedDepl) Check ¶ added in v0.1.8
func (d *ResolvedDepl) Check() (errs []error)
func (*ResolvedDepl) CheckAllConflicts ¶ added in v0.1.8
func (d *ResolvedDepl) CheckAllConflicts( candidates []*ResolvedDepl, ) (conflicts []DeplConflict, err error)
CheckAllConflicts produces a slice of reports of all resource conflicts between the ResolvedDepl instance and each candidate ResolvedDepl.
func (*ResolvedDepl) CheckConflicts ¶ added in v0.1.8
func (d *ResolvedDepl) CheckConflicts(candidate *ResolvedDepl) (DeplConflict, error)
CheckConflicts produces a report of all resource conflicts between the ResolvedDepl instance and a candidate ResolvedDepl.
func (*ResolvedDepl) CheckDeps ¶ added in v0.2.0
func (d *ResolvedDepl) CheckDeps( candidates []*ResolvedDepl, ) (satisfied SatisfiedDeplDeps, missing MissingDeplDeps, err error)
CheckDeps produces a report of all resource requirements from the ResolvedDepl instance and which were and were not met by any candidate ResolvedDepl.
func (*ResolvedDepl) DefinesApp ¶ added in v0.4.0
func (d *ResolvedDepl) DefinesApp() (bool, error)
DefinesApp determines whether the deployment defines a Docker Compose app to be deployed.
func (*ResolvedDepl) DisabledFeatures ¶ added in v0.1.8
func (d *ResolvedDepl) DisabledFeatures() map[string]core.PkgFeatureSpec
DisabledFeatures returns a map of the package features not enabled by the deployment's declaration, with feature names as the keys of the map.
func (*ResolvedDepl) EnabledFeatures ¶ added in v0.1.8
func (d *ResolvedDepl) EnabledFeatures() (enabled map[string]core.PkgFeatureSpec, err error)
EnabledFeatures returns a map of the package features enabled by the deployment's declaration, with feature names as the keys of the map.
func (*ResolvedDepl) GetComposeFilenames ¶ added in v0.4.0
func (d *ResolvedDepl) GetComposeFilenames() ([]string, error)
GetComposeFilenames returns a list of the paths of the Compose files which must be merged into the Compose app, with feature-flagged Compose files ordered based on the alphabetical order of enabled feature flags.
func (*ResolvedDepl) GetDownloadURLs ¶ added in v0.7.2
func (d *ResolvedDepl) GetDownloadURLs() ([]string, error)
GetDownloadURLs returns a list of the URLs of files and OCI container images to be downloaded for export by the package deployment, with all URLs sorted alphabetically.
func (*ResolvedDepl) GetFileExportTargets ¶ added in v0.7.0
func (d *ResolvedDepl) GetFileExportTargets() ([]string, error)
GetFileExportTargets returns a list of the target paths of the files to be exported by the package deployment, with all target file paths sorted alphabetically.
func (*ResolvedDepl) GetFileExports ¶ added in v0.7.0
func (d *ResolvedDepl) GetFileExports() ([]core.FileExportRes, error)
GetFileExports returns a list of file exports to be exported by the package deployment, with file export objects sorted alphabetically by their target file paths, and (if multiple source files are specified for a target path) preserving precedence of feature flags over the deployment section, and preserving precedence among feature flags by alphabetical ordering of feature flags.
func (*ResolvedDepl) GetHTTPFileDownloadURLs ¶ added in v0.7.2
func (d *ResolvedDepl) GetHTTPFileDownloadURLs() ([]string, error)
GetHTTPFileDownloadURLs returns a list of the HTTP(s) URLs of files to be downloaded for export by the package deployment, with all URLs sorted alphabetically.
func (*ResolvedDepl) GetOCIImageDownloadNames ¶ added in v0.7.2
func (d *ResolvedDepl) GetOCIImageDownloadNames() ([]string, error)
GetOCIImageDownloadNames returns a list of the image names of OCI container images to be downloaded for export by the package deployment, with all names sorted alphabetically.
type ResolvedImport ¶
type ResolvedImport struct { // Import is the declared file import group. Import // Pallet is the pallet which files will be imported from Pallet *FSPallet }
A ResolvedImport is a file import group with a loaded pallet.
func ResolveImport ¶
func ResolveImport( pallet *FSPallet, palletLoader FSPalletLoader, imp Import, ) (resolved *ResolvedImport, err error)
ResolveImport loads the import from a pallet loaded from the FSPalletLoader instance based on the requirements in the provided file import group and the pallet.
func ResolveImports ¶
func ResolveImports( pallet *FSPallet, palletLoader FSPalletLoader, imps []Import, ) (resolved []*ResolvedImport, err error)
ResolveImports loads the packages from the FSPkgLoader instance based on the requirements in the provided deployments and the package requirement loader.
func (*ResolvedImport) CheckDeprecations ¶
func (i *ResolvedImport) CheckDeprecations( loader FSPalletLoader, ) (deprecations []error, err error)
CheckDeprecations returns a list of [error]s for any directly-referenced or transitively-referenced features which are deprecated.
func (*ResolvedImport) Evaluate ¶
func (i *ResolvedImport) Evaluate(loader FSPalletLoader) (map[string]string, error)
Evaluate returns a list of target file paths and a mapping between target file paths and source file paths relative to the attached pallet's FS member. Directories are excluded from this mapping.
type SatisfiedDeplDeps ¶ added in v0.2.0
type SatisfiedDeplDeps struct { Depl *ResolvedDepl Networks []core.SatisfiedResDep[core.NetworkRes] Services []core.SatisfiedResDep[core.ServiceRes] Filesets []core.SatisfiedResDep[core.FilesetRes] }
func (SatisfiedDeplDeps) HasSatisfiedDep ¶ added in v0.2.0
func (d SatisfiedDeplDeps) HasSatisfiedDep() bool
func (SatisfiedDeplDeps) HasSatisfiedFilesetDep ¶ added in v0.5.2
func (d SatisfiedDeplDeps) HasSatisfiedFilesetDep() bool
func (SatisfiedDeplDeps) HasSatisfiedNetworkDep ¶ added in v0.2.0
func (d SatisfiedDeplDeps) HasSatisfiedNetworkDep() bool
func (SatisfiedDeplDeps) HasSatisfiedServiceDep ¶ added in v0.2.0
func (d SatisfiedDeplDeps) HasSatisfiedServiceDep() bool
type StageStoreManifest ¶ added in v0.7.0
type StageStoreManifest struct { // ForkliftVersion indicates that the stage store manifest was written assuming the semantics of // a given version of Forklift. The version must be a valid Forklift version, and it sets the // minimum version of Forklift required to use the stage store. The Forklift tool refuses to use // stage stores declaring newer Forklift versions for any operations beyond printing information. ForkliftVersion string `yaml:"forklift-version"` // Stages keeps track of special stages Stages StagesSpec `yaml:"staged"` }
A StageStoreManifest holds the state of the stage store.
func (StageStoreManifest) Write ¶ added in v0.7.0
func (m StageStoreManifest) Write(outputPath string) error
type StagesSpec ¶ added in v0.7.0
type StagesSpec struct { // Next is the index of the next staged pallet bundle which should be applied. Once it's applied // successfully, it'll be pushed onto the History stack. Next int `yaml:"next,omitempty"` // NextFailed records whether the next staged pallet bundle had failed to be applied. NextFailed bool `yaml:"next-failed,omitempty"` // History is the stack of staged pallet bundles which have been applied successfully, with the // most-recently-applied bundle last. The most-recently-applied bundle can be used as a fallback // If the next staged pallet bundle (if it exists) is not applied successfully. History []int `yaml:"history,omitempty"` // Names is a list of aliases for staged pallet bundles. Names map[string]int `yaml:"names,omitempty"` }
StagesSpec describes the state of a stage store.
type VersionLock ¶ added in v0.1.8
type VersionLock struct { // Def is the version lock definition. Def VersionLockDef `yaml:",inline"` // Version is the version string corresponding to the configured version. Version string `yaml:"-"` }
A VersionLock is a specification of a particular version of a repo or package.
func (VersionLock) Check ¶ added in v0.1.8
func (l VersionLock) Check() (errs []error)
Check looks for errors in the construction of the version lock.
type VersionLockDef ¶ added in v0.1.8
type VersionLockDef struct { // Type specifies the type of version lock (either "version" or "pseudoversion") Type string `yaml:"type"` // Tag specifies the VCS repository tag associated with the version or pseudoversion, if it // exists. If the type is "version", the tag should point to the commit corresponding to the // version; if the type is "pseudoversion", the tag should be the highest-versioned tag in the // ancestry of the commit corresponding to the version (and it is used as a "base version"). Tag string `yaml:"tag,omitempty"` // Timestamp specifies the commit time (in UTC) of the commit corresponding to the version, as // a 14-character string. Timestamp string `yaml:"timestamp"` // Commit specifies the full hash of the commit corresponding to the version. Commit string `yaml:"commit"` }
A VersionLockDef defines a requirement for a repo or package at a specific version.
func (VersionLockDef) IsCommitLocked ¶ added in v0.1.8
func (l VersionLockDef) IsCommitLocked() bool
func (VersionLockDef) ParseVersion ¶ added in v0.1.8
func (l VersionLockDef) ParseVersion() (semver.Version, error)
func (VersionLockDef) Pseudoversion ¶ added in v0.1.8
func (l VersionLockDef) Pseudoversion() (string, error)
func (VersionLockDef) ShortCommit ¶ added in v0.1.8
func (l VersionLockDef) ShortCommit() string
func (VersionLockDef) Version ¶ added in v0.1.8
func (l VersionLockDef) Version() (string, error)
Source Files ¶
- bundles-models.go
- bundles.go
- caching-downloads.go
- caching-mirrors.go
- caching-models.go
- caching-pallets.go
- caching-repositories.go
- config-models.go
- config.go
- constraints-models.go
- constraints.go
- fs.go
- pallets-deployments.go
- pallets-imports.go
- pallets-merging.go
- pallets-models.go
- pallets-requirements.go
- pallets.go
- repositories.go
- staging-models.go
- staging.go
- versioning-models.go
- versioning.go
- workspace-models.go
- workspace.go