Documentation ¶
Index ¶
- Variables
- type AutoMirror
- type Config
- type State
- func (s *State) BinaryDir() string
- 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) DumpDB(w io.Writer) error
- func (s *State) GC(p *ui.UI, age time.Duration, ...) error
- func (s *State) PkgDir() string
- func (s *State) ReadPackageState(pkg *manifest.Package)
- func (s *State) RecordUninstall(pkg *manifest.Package, binDir string) error
- func (s *State) Resolve(l *ui.UI, mathcer 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) 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) WritePackageState(p *manifest.Package, binDir string) 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 }
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) 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) GC ¶
func (s *State) GC(p *ui.UI, age time.Duration, pkgResolver func(b *ui.UI, selector manifest.Selector, syncOnMissing bool) (*manifest.Package, error)) error
GC clears packages that have not been used for the given duration and are not referred to in any environment
func (*State) ReadPackageState ¶
ReadPackageState updates the package fields from the global database
func (*State) RecordUninstall ¶
RecordUninstall updates the package usage records of a package being uninstalled
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.