Documentation
¶
Index ¶
- Variables
- type AutoMirror
- type Config
- type State
- func (s *State) BinaryDir() string
- func (s *State) CacheAndDigest(b *ui.Task, p *manifest.Package) (string, error)
- func (s *State) CacheAndUnpack(b *ui.Task, p *manifest.Package) error
- func (s *State) CleanCache(b ui.Logger) error
- func (s *State) CleanPackages(b *ui.UI) error
- func (s *State) Config() Config
- func (s *State) EnsureChannelIsUpToDate(l *ui.UI, pkg *manifest.Package) error
- func (s *State) PkgDir() string
- func (s *State) ReadPackageState(pkg *manifest.Package)
- func (s *State) Resolve(l *ui.UI, matcher manifest.Selector) (*manifest.Package, error)
- func (s *State) Root() string
- func (s *State) Search(l *ui.UI, glob string) (manifest.Packages, error)
- func (s *State) SearchPrefix(l *ui.UI, glob string) ([]string, error)
- func (s *State) Sources(l *ui.UI) (*sources.Sources, error)
- func (s *State) SourcesDir() string
- func (s *State) UpgradeChannel(b *ui.Task, pkg *manifest.Package) error
- func (s State) WithBinDir(dir string) *State
- func (s State) WithPackageDir(dir string) *State
- func (s *State) WritePackageState(p *manifest.Package) error
Constants ¶
This section is empty.
Variables ¶
var DefaultSources = []string{"https://github.com/cashapp/hermit-packages.git"}
DefaultSources if no others are defined.
Functions ¶
This section is empty.
Types ¶
type AutoMirror ¶
type AutoMirror struct {
// Origin URL regex to generate a mirror from. Named patterns will be substituted into mirror.
Origin string
// Mirror URL to add.
Mirror string
}
AutoMirror defines a dynamically generated mirror URL mapping.
type Config ¶
type Config struct {
// List of sources to sync packages from.
Sources []string
// Auto-generated mirrors.
AutoMirrors []AutoMirror
// Builtin sources.
Builtin *sources.BuiltInSource
LockTimeout time.Duration
}
Config for Hermit's global state.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is the global hermit state shared between all local environments
func (*State) CacheAndDigest ¶ added in v0.29.0
CacheAndDigest Utility for Caching all platform artefacts.
This method will only cache the values and get a digest.
func (*State) CacheAndUnpack ¶
CacheAndUnpack downloads a package and extracts it if it is not present.
If the package has already been extracted, this is a no-op
func (*State) CleanCache ¶
CleanCache clears the download cache
func (*State) CleanPackages ¶
CleanPackages removes all extracted packages
func (*State) EnsureChannelIsUpToDate ¶ added in v0.46.1
EnsureChannelIsUpToDate updates the package if it has an update interval, the required time since the last update check has passed, and the etag in the source has changed from the last check.
This should only be called for packages that have already been installed
func (*State) ReadPackageState ¶
ReadPackageState updates the package fields from the global database
func (*State) SearchPrefix ¶ added in v0.47.0
SearchPrefix returns package names whose name begins with the given prefix.
func (*State) SourcesDir ¶
SourcesDir returns the global directory for manifests
func (*State) UpgradeChannel ¶
UpgradeChannel checks if the given binary has changed in its channel, and if so, downloads it.
If the channel is upgraded this will return a clone of the updated manifest.
func (State) WithBinDir ¶ added in v0.45.0
WithBinDir returns a new State with the binary symlink directory set to the given directory.
func (State) WithPackageDir ¶ added in v0.45.0
WithPackageDir returns a new State with the package directory set to the given directory.