Documentation
¶
Index ¶
- Constants
- func CacheMirrorOptionsFromConfig(cfg *cfgpkg.File) cachemirror.Options
- func NewDefaultSDKService(cfg *cfgpkg.File, noProxyOpt ...bool) (sdk.Service, error)
- func ResolvePackageConfig(repo, name string, opts install.Options) (string, string, install.Options, error)
- func ResolvePackageName(repo, name string) (string, error)
- func ResolvePackageNameWithConfig(cfg *cfgpkg.File, repo, name string) (string, error)
- type ConfigInfoResult
- type ConfigPathResult
- type ConfigService
- func (s ConfigService) AddPackage(repo, name string, opts install.Options) error
- func (s ConfigService) AddSDKConfig(opts SDKConfigAddOptions) (SDKConfigAddResult, error)
- func (s ConfigService) ConfigExport(out io.Writer, withGlobal bool) error
- func (s ConfigService) ConfigGet(key string) (any, error)
- func (s ConfigService) ConfigImport(sourcePath string) (string, error)
- func (s ConfigService) ConfigImportCheck(sourcePath string) error
- func (s ConfigService) ConfigInfo() (ConfigInfoResult, error)
- func (s ConfigService) ConfigInit() (string, error)
- func (s ConfigService) ConfigList() (*cfgpkg.File, error)
- func (s ConfigService) ConfigPathInfo(target string) (ConfigPathResult, error)
- func (s ConfigService) ConfigSet(key, value string) error
- type DefaultExecutableReplacer
- type ExecutableReplacer
- type ExternalProvider
- type InstallAllResult
- type InstallExtras
- type InstalledLoader
- type InstalledStore
- type Installer
- type LatestCheckTarget
- type LatestInfo
- type LatestInfoFunc
- type ListItem
- type ListService
- func (s ListService) FindPackage(name string) (*ListItem, error)
- func (s ListService) ListGUIPackages(all bool) ([]ListItem, error)
- func (s ListService) ListInstalledPackages() ([]ListItem, error)
- func (s ListService) ListOutdatedPackages() ([]OutdatedItem, []OutdatedCheckFailure, int, error)
- func (s ListService) ListPackages() ([]ListItem, error)
- type ManagersSelection
- type OutdatedCheckFailure
- type OutdatedItem
- type PackageAdder
- type QueryAsset
- type QueryClient
- type QueryOptions
- type QueryRelease
- type QueryRepoInfo
- type QueryResult
- type QueryService
- type QueryURLInfo
- type ReleaseInfoFunc
- type RemovableInstalledStore
- type RepoMetadata
- type RunResult
- type Runner
- type SDKConfigAddItem
- type SDKConfigAddOptions
- type SDKConfigAddResult
- type SearchClient
- type SearchOptions
- type SearchRepo
- type SearchResult
- type SearchService
- type SelfReplaceResult
- type SelfUpdateInstaller
- type SelfUpdateOptions
- type SelfUpdateResult
- type SelfUpdateService
- type Service
- type ShowResult
- type ShowService
- type UninstallOptions
- type UninstallResult
- type UninstallService
- type UpdatePackageResult
- type UpdateResult
- type UpdateService
- func (s UpdateService) ListUpdateCandidates() ([]OutdatedItem, []OutdatedCheckFailure, int, error)
- func (s UpdateService) ListUpdateCandidatesForTargets(targets []string) ([]OutdatedItem, []OutdatedCheckFailure, int, error)
- func (s UpdateService) UpdateAllPackages(cli install.Options) ([]UpdateResult, error)
- func (s UpdateService) UpdateCandidates(candidates []OutdatedItem, cli install.Options) ([]UpdateResult, error)
- func (s UpdateService) UpdatePackage(nameOrRepo string, cli install.Options) (RunResult, error)
- func (s UpdateService) UpdatePackageStatus(nameOrRepo string, cli install.Options) (UpdatePackageResult, error)
Constants ¶
const ( ManagersModeOff = "off" ManagersModeWith = "with" ManagersModeOnly = "only" )
Managers modes decide which external packages take part in list and update. The zero value (or "off") keeps eget's behavior unchanged.
const ( SDKConfigActionAdded = "added" SDKConfigActionUpdated = "updated" SDKConfigActionSkipped = "skipped" )
const SelfUpdateRepo = "inherelab/eget"
Variables ¶
This section is empty.
Functions ¶
func CacheMirrorOptionsFromConfig ¶ added in v1.7.5
func CacheMirrorOptionsFromConfig(cfg *cfgpkg.File) cachemirror.Options
func NewDefaultSDKService ¶ added in v1.7.0
func ResolvePackageConfig ¶ added in v1.6.0
func ResolvePackageName ¶ added in v1.6.0
Types ¶
type ConfigInfoResult ¶
type ConfigPathResult ¶ added in v1.7.3
type ConfigService ¶
type ConfigService struct {
ConfigPath string
Load func() (*cfgpkg.File, error)
Save func(path string, file *cfgpkg.File) error
RepoMetadata func(repo string) (RepoMetadata, error)
}
func (ConfigService) AddPackage ¶
func (s ConfigService) AddPackage(repo, name string, opts install.Options) error
func (ConfigService) AddSDKConfig ¶ added in v1.7.0
func (s ConfigService) AddSDKConfig(opts SDKConfigAddOptions) (SDKConfigAddResult, error)
func (ConfigService) ConfigExport ¶ added in v1.9.0
func (s ConfigService) ConfigExport(out io.Writer, withGlobal bool) error
ConfigExport writes the current configuration as portable TOML.
func (ConfigService) ConfigImport ¶ added in v1.9.0
func (s ConfigService) ConfigImport(sourcePath string) (string, error)
ConfigImport validates and replaces the writable configuration file.
func (ConfigService) ConfigImportCheck ¶ added in v1.9.0
func (s ConfigService) ConfigImportCheck(sourcePath string) error
ConfigImportCheck validates an import without changing the target file.
func (ConfigService) ConfigInfo ¶
func (s ConfigService) ConfigInfo() (ConfigInfoResult, error)
func (ConfigService) ConfigInit ¶
func (s ConfigService) ConfigInit() (string, error)
func (ConfigService) ConfigList ¶
func (s ConfigService) ConfigList() (*cfgpkg.File, error)
func (ConfigService) ConfigPathInfo ¶ added in v1.7.3
func (s ConfigService) ConfigPathInfo(target string) (ConfigPathResult, error)
func (ConfigService) ConfigSet ¶
func (s ConfigService) ConfigSet(key, value string) error
type DefaultExecutableReplacer ¶ added in v1.7.2
type DefaultExecutableReplacer struct{}
func (DefaultExecutableReplacer) Replace ¶ added in v1.7.2
func (DefaultExecutableReplacer) Replace(currentPath, replacementPath string) (SelfReplaceResult, error)
type ExecutableReplacer ¶ added in v1.7.2
type ExecutableReplacer interface {
Replace(currentPath, replacementPath string) (SelfReplaceResult, error)
}
type ExternalProvider ¶ added in v1.10.0
type ExternalProvider interface {
List(ctx context.Context, only ...string) ([]extpkg.Package, []extpkg.Failure, error)
Outdated(ctx context.Context, only ...string) ([]extpkg.Package, []extpkg.Failure, error)
Upgrade(ctx context.Context, managerName string, names []string) (extpkg.UpgradeResult, error)
Manager(name string) (extpkg.Manager, bool)
Names() []string
}
ExternalProvider lists and upgrades packages owned by external managers. It is implemented by extpkg.Service; the manager name list filters the work so a single-manager selection does not run every manager.
type InstallAllResult ¶ added in v1.6.0
type InstallExtras ¶
type InstalledLoader ¶
type InstalledStore ¶
type LatestCheckTarget ¶ added in v1.7.0
type LatestInfo ¶ added in v1.6.0
type LatestInfoFunc ¶ added in v1.7.0
type LatestInfoFunc func(target LatestCheckTarget) (LatestInfo, error)
type ListItem ¶
type ListItem struct {
Name string
Repo string
SourcePath string
Package cfgpkg.Section
Target string
Tag string
Version string
InstalledTag string
Installed bool
InstalledAt time.Time
Asset string
AssetID int64
AssetSize int64
AssetUpdatedAt time.Time
AssetDigest string
URL string
IsGUI bool
InstallMode string
Prerelease bool
IgnoreUpdate bool
// Manager is the external package manager that owns this package, empty for
// packages eget installed itself.
Manager string
}
type ListService ¶
type ListService struct {
LoadConfig func() (*cfgpkg.File, error)
LoadInstalled func() (*storepkg.Config, error)
LatestInfo LatestInfoFunc
OnCheckDone func(checked, total int)
// External and Managers add packages owned by external managers. Both are
// optional: with a zero ManagersSelection nothing external runs at all.
External ExternalProvider
Managers ManagersSelection
// OnExternalFailure reports a manager-level failure while listing. It is a
// callback because list has no failure channel of its own.
OnExternalFailure func(extpkg.Failure)
}
func (ListService) FindPackage ¶ added in v1.5.1
func (s ListService) FindPackage(name string) (*ListItem, error)
func (ListService) ListGUIPackages ¶ added in v1.5.2
func (s ListService) ListGUIPackages(all bool) ([]ListItem, error)
func (ListService) ListInstalledPackages ¶ added in v1.5.2
func (s ListService) ListInstalledPackages() ([]ListItem, error)
func (ListService) ListOutdatedPackages ¶ added in v1.5.1
func (s ListService) ListOutdatedPackages() ([]OutdatedItem, []OutdatedCheckFailure, int, error)
func (ListService) ListPackages ¶
func (s ListService) ListPackages() ([]ListItem, error)
type ManagersSelection ¶ added in v1.10.0
type ManagersSelection struct {
Mode string
// Managers restricts the selection to these manager names. Empty while Mode
// is not off means "every configured manager".
Managers []string
}
ManagersSelection is the resolved choice of which external managers take part in list/update. It is produced by the CLI from its flags and [global] ext_package_mode, so config can only yield off and with.
func (ManagersSelection) Enabled ¶ added in v1.10.0
func (s ManagersSelection) Enabled() bool
Enabled reports whether any external manager takes part.
func (ManagersSelection) OnlyManagers ¶ added in v1.10.0
func (s ManagersSelection) OnlyManagers() bool
OnlyManagers reports whether eget's own packages are excluded.
type OutdatedCheckFailure ¶ added in v1.5.1
type OutdatedItem ¶ added in v1.5.1
type PackageAdder ¶
type QueryAsset ¶ added in v1.5.1
type QueryClient ¶ added in v1.5.1
type QueryClient interface {
RepoInfo(repo string) (QueryRepoInfo, error)
LatestRelease(repo string, includePrerelease bool) (QueryRelease, error)
ListReleases(repo string, limit int, includePrerelease bool) ([]QueryRelease, error)
ResolveTag(repo, tag string, includePrerelease bool) (string, error)
ReleaseAssets(repo, tag string) ([]QueryAsset, error)
}
type QueryOptions ¶ added in v1.5.1
type QueryRelease ¶ added in v1.5.1
type QueryRepoInfo ¶ added in v1.5.1
type QueryResult ¶ added in v1.5.1
type QueryResult struct {
Action string `json:"action"`
Repo string `json:"repo"`
Tag string `json:"tag,omitempty"`
Info *QueryRepoInfo `json:"info,omitempty"`
Latest *QueryRelease `json:"latest,omitempty"`
Releases []QueryRelease `json:"releases,omitempty"`
Assets []QueryAsset `json:"assets,omitempty"`
URLInfo *QueryURLInfo `json:"url_info,omitempty"`
}
func (QueryResult) JSONString ¶ added in v1.5.1
func (r QueryResult) JSONString() (string, error)
type QueryService ¶ added in v1.5.1
type QueryService struct {
Client QueryClient
SourceForgeLatest func(project, sourcePath string) (sourcesf.LatestInfo, error)
SourceForgeReleases func(project, sourcePath string, limit int, includePrerelease bool) ([]sourcesf.LatestInfo, error)
SourceForgeAssets func(project, sourcePath, tag string) ([]string, error)
URLInfo func(rawURL string) (QueryURLInfo, error)
}
func (QueryService) Query ¶ added in v1.5.1
func (s QueryService) Query(opts QueryOptions) (QueryResult, error)
type QueryURLInfo ¶ added in v1.9.5
type RemovableInstalledStore ¶
type RepoMetadata ¶ added in v1.7.0
type SDKConfigAddItem ¶ added in v1.7.0
type SDKConfigAddOptions ¶ added in v1.7.0
type SDKConfigAddResult ¶ added in v1.7.0
type SDKConfigAddResult struct {
Items []SDKConfigAddItem
}
type SearchClient ¶ added in v1.5.2
type SearchClient interface {
SearchRepositories(query string, limit int, sort, order string) (SearchResult, error)
}
type SearchOptions ¶ added in v1.5.2
type SearchRepo ¶ added in v1.5.2
type SearchRepo = client.SearchRepo
type SearchResult ¶ added in v1.5.2
type SearchResult = client.SearchResult
type SearchService ¶ added in v1.5.2
type SearchService struct {
Client SearchClient
}
func (SearchService) Search ¶ added in v1.5.2
func (s SearchService) Search(opts SearchOptions) (SearchResult, error)
type SelfReplaceResult ¶ added in v1.7.2
type SelfReplaceResult struct {
Deferred bool
}
type SelfUpdateInstaller ¶ added in v1.7.2
type SelfUpdateOptions ¶ added in v1.7.2
type SelfUpdateResult ¶ added in v1.7.2
type SelfUpdateService ¶ added in v1.7.2
type SelfUpdateService struct {
CurrentVersion string
LatestInfo LatestInfoFunc
SourceLatestInfo func(source string, opts install.Options) (LatestInfo, error)
Installer SelfUpdateInstaller
Replacer ExecutableReplacer
RuntimeGOOS string
RuntimeGOARCH string
TempDir func() (string, error)
ExecutablePath func() (string, error)
}
func (SelfUpdateService) Update ¶ added in v1.7.2
func (s SelfUpdateService) Update(opts SelfUpdateOptions) (SelfUpdateResult, error)
type Service ¶
type Service struct {
Runner Runner
Store InstalledStore
Config PackageAdder
Now func() time.Time
ReleaseInfo ReleaseInfoFunc
RepoMetadata func(repo string) (RepoMetadata, error)
LoadConfig func() (*cfgpkg.File, error)
}
func (Service) DownloadTarget ¶
func (Service) InstallAllPackages ¶ added in v1.6.0
func (s Service) InstallAllPackages(cli install.Options) ([]InstallAllResult, error)
func (Service) InstallTarget ¶
type ShowResult ¶ added in v1.7.0
type ShowResult struct {
Name string
Repo string
Desc string
Homepage string
RepoURL string
Configured bool
Installed bool
ConfigTarget string
InstallTarget string
Version string
Tag string
TagPolicy string
InstalledAt time.Time
UpdatedAt time.Time
Asset string
AssetURL string
Tool string
ExtractedFiles []string
IsGUI bool
InstallMode string
SourcePath string
Options map[string]any
}
type ShowService ¶ added in v1.7.0
type ShowService struct {
LoadConfig func() (*cfgpkg.File, error)
LoadInstalled func() (*storepkg.Config, error)
}
func (ShowService) ShowPackage ¶ added in v1.7.0
func (s ShowService) ShowPackage(target string) (ShowResult, error)
type UninstallOptions ¶ added in v1.7.8
type UninstallOptions struct {
Purge bool
}
type UninstallResult ¶
type UninstallService ¶
type UninstallService struct {
Store RemovableInstalledStore
LoadConfig func() (*cfgpkg.File, error)
SaveConfig func(*cfgpkg.File) error
}
func (UninstallService) Uninstall ¶
func (s UninstallService) Uninstall(target string) (UninstallResult, error)
func (UninstallService) UninstallWithOptions ¶ added in v1.7.8
func (s UninstallService) UninstallWithOptions(target string, opts UninstallOptions) (UninstallResult, error)
type UpdatePackageResult ¶ added in v1.7.6
type UpdateResult ¶
type UpdateService ¶
type UpdateService struct {
Install Installer
LoadConfig func() (*cfgpkg.File, error)
LoadInstalled func() (*storepkg.Config, error)
LatestInfo LatestInfoFunc
OnCheckDone func(checked, total int)
OnUpdateStart func(index, total int, name string)
// OnUpdateDone reports every finished candidate update. External
// candidates are silent otherwise: their manager output is captured, not
// printed like the installer's own progress. Concurrent batch updates
// call it from several goroutines.
OnUpdateDone func(item OutdatedItem, result RunResult, err error)
// External and Managers let updates reach packages owned by external
// managers. Both are optional: with a zero ManagersSelection only explicit
// "manager:pkg" targets work.
External ExternalProvider
Managers ManagersSelection
}
func (UpdateService) ListUpdateCandidates ¶ added in v1.5.2
func (s UpdateService) ListUpdateCandidates() ([]OutdatedItem, []OutdatedCheckFailure, int, error)
func (UpdateService) ListUpdateCandidatesForTargets ¶ added in v1.7.3
func (s UpdateService) ListUpdateCandidatesForTargets(targets []string) ([]OutdatedItem, []OutdatedCheckFailure, int, error)
func (UpdateService) UpdateAllPackages ¶
func (s UpdateService) UpdateAllPackages(cli install.Options) ([]UpdateResult, error)
func (UpdateService) UpdateCandidates ¶ added in v1.5.2
func (s UpdateService) UpdateCandidates(candidates []OutdatedItem, cli install.Options) ([]UpdateResult, error)
func (UpdateService) UpdatePackage ¶
func (UpdateService) UpdatePackageStatus ¶ added in v1.7.6
func (s UpdateService) UpdatePackageStatus(nameOrRepo string, cli install.Options) (UpdatePackageResult, error)
Source Files
¶
- cache_mirror_options.go
- config.go
- install.go
- install_all.go
- install_options.go
- install_record.go
- install_resolve.go
- list.go
- query.go
- sdk.go
- sdk_config.go
- search.go
- self_replace.go
- self_replace_common.go
- self_replace_default.go
- self_update.go
- show.go
- tag_semantics.go
- uninstall.go
- update.go
- update_batch.go
- update_candidates.go
- update_options.go
- update_target.go