Documentation ¶
Index ¶
- Constants
- Variables
- func CachePath(app, version, url string) string
- func GetDefaultScoopDir() (string, error)
- func ParseAppIdentifier(name string) (string, string, string)
- type App
- func (a *App) AvailableVersions() ([]string, error)
- func (a *App) AvailableVersionsN(maxVersions int) ([]string, error)
- func (a *App) LoadDetails(fields ...string) error
- func (a *App) LoadDetailsWithIter(iter *jsoniter.Iterator, fields ...string) error
- func (a *App) ManifestForVersion(targetVersion string) (io.ReadCloser, error)
- func (a App) ManifestPath() string
- type Architecture
- type ArchitectureItem
- type ArchitectureKey
- type Bin
- type Bucket
- type Dependencies
- type Dependency
- type EnvVar
- type InstalledApp
- type Installer
- type KnownBucket
- type OutdatedApp
- type Scoop
- func (scoop *Scoop) DependencyTree(a *App) (*Dependencies, error)
- func (scoop *Scoop) GetAppsDir() string
- func (scoop *Scoop) GetAvailableApp(name string) (*App, error)
- func (scoop *Scoop) GetBucket(name string) *Bucket
- func (scoop *Scoop) GetBucketsDir() string
- func (scoop *Scoop) GetCacheDir() string
- func (scoop *Scoop) GetInstalledApp(name string) (*InstalledApp, error)
- func (scoop *Scoop) GetInstalledApps() ([]*InstalledApp, error)
- func (scoop *Scoop) GetKnownBuckets() ([]KnownBucket, error)
- func (scoop *Scoop) GetLocalBuckets() ([]*Bucket, error)
- func (scoop *Scoop) GetOutdatedApps() ([]*OutdatedApp, error)
- func (scoop *Scoop) GetScoopInstallationDir() string
- func (scoop *Scoop) Install(apps []string, arch ArchitectureKey) error
- func (scoop *Scoop) LookupCache(app, version string) ([]string, error)
- func (scoop *Scoop) ReverseDependencyTree(apps []*App, app *App) *Dependencies
Constants ¶
const ( DetailFieldBin = "bin" DetailFieldShortcuts = "shortcuts" DetailFieldUrl = "url" DetailFieldArchitecture = "architecture" DetailFieldDescription = "description" DetailFieldVersion = "version" DetailFieldNotes = "notes" DetailFieldDepends = "depends" DetailFieldEnvSet = "env_set" DetailFieldEnvAddPath = "env_add_path" DetailFieldExtractDir = "extract_dir" DetailFieldExtractTo = "extract_to" DetailFieldPostInstall = "post_install" DetailFieldPreInstall = "pre_install" DetailFieldInstaller = "installer" DetailFieldInnoSetup = "innosetup" )
Variables ¶
var ErrBucketNoGitDir = errors.New(".git dir at path not found")
var ErrBucketNotFound = errors.New("bucket not found")
Functions ¶
func CachePath ¶
CachePath generates a path given the app, a version and the target URL. The rules defined here are taken from the scoop code.
func GetDefaultScoopDir ¶ added in v0.0.3
Types ¶
type App ¶
type App struct { Name string `json:"name"` Description string `json:"description"` Version string `json:"version"` Notes string `json:"notes"` Bin []Bin `json:"bin"` Shortcuts []Bin `json:"shortcuts"` EnvAddPath []string `json:"env_add_path"` EnvSet []EnvVar `json:"env_set"` Depends []Dependency `json:"depends"` URL []string `json:"url"` Architecture map[ArchitectureKey]*Architecture `json:"architecture"` InnoSetup bool `json:"innosetup"` Installer *Installer `json:"installer"` PreInstall []string `json:"pre_install"` PostInstall []string `json:"post_install"` ExtractTo []string `json:"extract_to"` // ExtractDir specifies which dir should be extracted from the downloaded // archive. However, there might be more URLs than there are URLs. ExtractDir []string `json:"extract_dir"` Bucket *Bucket `json:"-"` // contains filtered or unexported fields }
App represents an application, which may or may not be installed and may or may not be part of a bucket. "Headless" manifests are also a thing, for example when you are using an auto-generated manifest for a version that's not available anymore. In that case, scoop will lose the bucket information.
func (*App) AvailableVersions ¶ added in v0.0.3
func (*App) AvailableVersionsN ¶ added in v0.0.4
func (*App) LoadDetails ¶
LoadDetails will load additional data regarding the manifest, such as description and version information. This causes IO on your drive and therefore isn't done by default.
func (*App) LoadDetailsWithIter ¶ added in v0.0.3
LoadDetails will load additional data regarding the manifest, such as description and version information. This causes IO on your drive and therefore isn't done by default.
func (*App) ManifestForVersion ¶ added in v0.0.3
func (a *App) ManifestForVersion(targetVersion string) (io.ReadCloser, error)
ManifestForVersion will search through history til a version equal to the desired version is found. Note that we compare the versions and stop searching if a lower version is encountered. This function is expected to be very slow, be warned!
func (App) ManifestPath ¶
type Architecture ¶ added in v0.0.3
type Architecture struct { Items []ArchitectureItem `json:"items"` Bin []Bin Shortcuts []Bin // Installer replaces MSI Installer Installer // PreInstall contains a list of commands to execute before installation. // Note that PreUninstall isn't supported in ArchitectureItem, even though // Uninstaller is supported. PreInstall []string // PreInstall contains a list of commands to execute after installation. // Note that PostUninstall isn't supported in ArchitectureItem, even though // Uninstaller is supported. PostInstall []string }
type ArchitectureItem ¶ added in v0.0.3
type ArchitectureKey ¶ added in v0.0.3
type ArchitectureKey string
const ( // Architecture32Bit is for x386 (intel/amd). It is the default if no arch // has been specified. ArchitectureKey32Bit ArchitectureKey = "32bit" // Architecture32Bit is for x686 (intel/amd) ArchitectureKey64Bit ArchitectureKey = "64bit" ArchitectureKeyARM64 ArchitectureKey = "arm64" )
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
func (*Bucket) AvailableApps ¶
AvailableApps returns unloaded app manifests. You need to call App.LoadDetails on each one. This allows for optimisation by parallelisation where desired.
func (*Bucket) Dir ¶
Dir is the bucket directory, which contains the subdirectory "bucket" with the manifests.
func (*Bucket) ManifestDir ¶
ManifestDir is the directory path of the bucket without a leading slash.
type Dependencies ¶ added in v0.0.3
type Dependencies struct { App *App Values []*Dependencies }
type Dependency ¶ added in v0.0.3
type InstalledApp ¶ added in v0.0.3
type KnownBucket ¶ added in v0.0.4
type OutdatedApp ¶ added in v0.0.3
type OutdatedApp struct { *InstalledApp ManifestDeleted bool LatestVersion string }
type Scoop ¶ added in v0.0.3
type Scoop struct {
// contains filtered or unexported fields
}
func NewCustomScoop ¶ added in v0.0.3
func (*Scoop) DependencyTree ¶ added in v0.0.3
func (scoop *Scoop) DependencyTree(a *App) (*Dependencies, error)
func (*Scoop) GetAppsDir ¶ added in v0.0.3
func (*Scoop) GetAvailableApp ¶ added in v0.0.3
func (*Scoop) GetBucket ¶ added in v0.0.3
GetBucket constructs a new bucket object pointing at the given bucket. At this point, the bucket might not necessarily exist.
func (*Scoop) GetBucketsDir ¶ added in v0.0.3
func (*Scoop) GetCacheDir ¶ added in v0.0.3
func (*Scoop) GetInstalledApp ¶ added in v0.0.3
func (scoop *Scoop) GetInstalledApp(name string) (*InstalledApp, error)
func (*Scoop) GetInstalledApps ¶ added in v0.0.3
func (scoop *Scoop) GetInstalledApps() ([]*InstalledApp, error)
func (*Scoop) GetKnownBuckets ¶ added in v0.0.3
func (scoop *Scoop) GetKnownBuckets() ([]KnownBucket, error)
GetKnownBuckets returns the list of available "default" buckets that are available, but might have not necessarily been installed locally.
func (*Scoop) GetLocalBuckets ¶ added in v0.0.3
GetLocalBuckets is an API representation of locally installed buckets.
func (*Scoop) GetOutdatedApps ¶ added in v0.0.3
func (scoop *Scoop) GetOutdatedApps() ([]*OutdatedApp, error)
func (*Scoop) GetScoopInstallationDir ¶ added in v0.0.3
func (*Scoop) Install ¶ added in v0.0.3
func (scoop *Scoop) Install(apps []string, arch ArchitectureKey) error
func (*Scoop) LookupCache ¶ added in v0.0.3
LookupCache will check the cache dir for matching entries. Note that the `app` parameter must be non-empty, but the version is optional.
func (*Scoop) ReverseDependencyTree ¶ added in v0.0.3
func (scoop *Scoop) ReverseDependencyTree(apps []*App, app *App) *Dependencies