Documentation
¶
Index ¶
- Variables
- func AddBucket(name, repo string)
- func CurrentVersion(app string, isGlobal bool) (string, error)
- func Error(a string)
- func FindBucketDir(name string) (string, error)
- func FindBucketDirectory(name string) string
- func FindManifest(app, bucket string)
- func GetAppFilePath(app, file string) string
- func GetArchitecture() string
- func GetHelperPath(helper string) string
- func GetInstalledApps(isGlobal bool) ([]string, error)
- func GetLocalBuckets() ([]string, error)
- func GetManifestPath(app, bucket string) (string, error)
- func HumanReadableFileSize(length int64) string
- func Info(a string)
- func LatestVersion(app, bucket string) (string, error)
- func LatestVersionFromUrl(url string) (string, error)
- func RmBucket(name string)
- func SanitaryPath(path string) string
- func SaveInstallInfo(info InstallInfo, dir string) error
- func SaveInstalledManifest(app, bucket, dir, url string)
- func Success(a string)
- func Warn(a string)
- type AppStatus
- type Autoupdate
- type AutoupdateArch
- type AutoupdateArchitecture
- type AutoupdateInstaller
- type Checkver
- type CheckverClass
- type Hash
- type HashExtraction
- type HashExtractionOrArrayOfHashExtractions
- type InstallInfo
- type LicenseClass
- type LicenseUnion
- type Manifest
- type ManifestArchitecture
- type ManifestInstaller
- type ManifestPsmodule
- type Mode
- type StringOrArrayOfStrings
- type StringOrArrayOfStringsOrAnArrayOfArrayOfStrings
- type Suggest
- type The32BitClass
- type The32BitPsmodule
- type Uninstaller
Constants ¶
This section is empty.
Variables ¶
View Source
var BucketsDir = filepath.Join(ScoopDir, "buckets")
View Source
var CacheDir = getCacheDir()
CacheDir represents for downloaded cache dir
View Source
var ConfigFile = filepath.Join(getConfigHome(), "scoop", "config.json")
ConfigFile returns the path of scoop config file
View Source
var GlobalDir = getGlobalDir()
GlobalDir represents for Scoop Global dir
View Source
var ScoopDir = getScoopDir()
ScoopDir represents for Scoop base dir
Functions ¶
func FindBucketDir ¶
func FindBucketDirectory ¶
func FindManifest ¶
func FindManifest(app, bucket string)
func GetAppFilePath ¶
func GetArchitecture ¶
func GetArchitecture() string
func GetHelperPath ¶
available helpers: 7zip, Lessmsi, Innounp, Dark, Aria2
func GetInstalledApps ¶
func GetLocalBuckets ¶
func GetManifestPath ¶
func HumanReadableFileSize ¶
func LatestVersion ¶
LatestVersion get the version from bucket
func LatestVersionFromUrl ¶
LatestVersionFromUrl get the latest version from url
func SanitaryPath ¶
func SaveInstallInfo ¶
func SaveInstallInfo(info InstallInfo, dir string) error
func SaveInstalledManifest ¶
func SaveInstalledManifest(app, bucket, dir, url string)
Types ¶
type AppStatus ¶
type Autoupdate ¶
type Autoupdate struct {
URL *StringOrArrayOfStrings `json:"url,omitempty"`
Hash *HashExtractionOrArrayOfHashExtractions `json:"hash,omitempty"`
ExtractDir *StringOrArrayOfStrings `json:"extract_dir,omitempty"`
ExtractTo *StringOrArrayOfStrings `json:"extract_to,omitempty"`
Installer *AutoupdateInstaller `json:"installer,omitempty"`
PreInstall *StringOrArrayOfStrings `json:"pre_install,omitempty"`
PostInstall *StringOrArrayOfStrings `json:"post_install,omitempty"`
EnvAddPath *StringOrArrayOfStrings `json:"env_add_path,omitempty"`
EnvSet map[string]interface{} `json:"env_set,omitempty"`
Psmodule *The32BitPsmodule `json:"psmodule,omitempty"`
Bin *StringOrArrayOfStringsOrAnArrayOfArrayOfStrings `json:"bin,omitempty"`
Shortcuts [][]string `json:"shortcuts,omitempty"`
Persist *StringOrArrayOfStringsOrAnArrayOfArrayOfStrings `json:"persist,omitempty"`
Architecture *AutoupdateArchitecture `json:"architecture,omitempty"`
Note *StringOrArrayOfStrings `json:"note,omitempty"`
}
type AutoupdateArch ¶
type AutoupdateArch struct {
URL *StringOrArrayOfStrings `json:"url,omitempty"`
Hash *HashExtractionOrArrayOfHashExtractions `json:"hash,omitempty"`
ExtractDir *StringOrArrayOfStrings `json:"extract_dir,omitempty"`
ExtractTo *StringOrArrayOfStrings `json:"extract_to,omitempty"`
Installer *AutoupdateInstaller `json:"installer,omitempty"`
PreInstall *StringOrArrayOfStrings `json:"pre_install,omitempty"`
PostInstall *StringOrArrayOfStrings `json:"post_install,omitempty"`
EnvAddPath *StringOrArrayOfStrings `json:"env_add_path,omitempty"`
EnvSet map[string]interface{} `json:"env_set,omitempty"`
Psmodule *The32BitPsmodule `json:"psmodule,omitempty"`
Bin *StringOrArrayOfStringsOrAnArrayOfArrayOfStrings `json:"bin,omitempty"`
Shortcuts [][]string `json:"shortcuts,omitempty"`
Persist *StringOrArrayOfStringsOrAnArrayOfArrayOfStrings `json:"persist,omitempty"`
Note *StringOrArrayOfStrings `json:"note,omitempty"`
}
type AutoupdateArchitecture ¶
type AutoupdateArchitecture struct {
The32Bit *AutoupdateArch `json:"32bit,omitempty"`
The64Bit *AutoupdateArch `json:"64bit,omitempty"`
}
type AutoupdateInstaller ¶
type AutoupdateInstaller struct {
File *string `json:"file,omitempty"`
}
type Checkver ¶
type Checkver struct {
CheckverClass *CheckverClass
String *string
}
func (*Checkver) MarshalJSON ¶
func (*Checkver) UnmarshalJSON ¶
type CheckverClass ¶
type CheckverClass struct {
Github *string `json:"github,omitempty"`
Jp *string `json:"jp,omitempty"` // Same as 'jsonpath'
Jsonpath *string `json:"jsonpath,omitempty"`
Re *string `json:"re,omitempty"` // Same as 'regex'
Regex *string `json:"regex,omitempty"`
Replace *string `json:"replace,omitempty"` // Allows rearrange the regexp matches
Reverse *bool `json:"reverse,omitempty"` // Reverse the order of regex matches
URL *string `json:"url,omitempty"`
Useragent *string `json:"useragent,omitempty"`
Xpath *string `json:"xpath,omitempty"`
}
type HashExtraction ¶
type HashExtraction struct {
Find *string `json:"find,omitempty"` // Same as 'regex'
Jp *string `json:"jp,omitempty"` // Same as 'jsonpath'
Jsonpath *string `json:"jsonpath,omitempty"`
Mode *Mode `json:"mode,omitempty"`
Regex *string `json:"regex,omitempty"`
URL *string `json:"url,omitempty"`
Xpath *string `json:"xpath,omitempty"`
}
type HashExtractionOrArrayOfHashExtractions ¶
type HashExtractionOrArrayOfHashExtractions struct {
HashExtraction *HashExtraction
HashExtractionArray []HashExtraction
}
func (*HashExtractionOrArrayOfHashExtractions) MarshalJSON ¶
func (x *HashExtractionOrArrayOfHashExtractions) MarshalJSON() ([]byte, error)
func (*HashExtractionOrArrayOfHashExtractions) UnmarshalJSON ¶
func (x *HashExtractionOrArrayOfHashExtractions) UnmarshalJSON(data []byte) error
type InstallInfo ¶
type InstallInfo struct {
URL string `json:"url,omitempty"`
Bucket string `json:"bucket,omitempty"`
Architecture string `json:"architecture,omitempty"`
Hold bool `json:"hold,omitempty"`
}
InstallInfo 是安装好后,存在于 apps/version/ 下 ,描述当前应用,拥有以下字段: 从何处安装(url, bucket) 架构信息(architecture) 是否版本冻结(hold)
func GetInstallInfo ¶
func GetInstallInfo(app, version string, isGlobal bool) (InstallInfo, error)
func UnmarshalInstallInfo ¶
func UnmarshalInstallInfo(data []byte) (InstallInfo, error)
UnmarshalInstallInfo 将字节流形式的 `install.json` 转换成 InstallInfo 结构体
func (*InstallInfo) Marshal ¶
func (r *InstallInfo) Marshal() ([]byte, error)
Marshal 将 InstallInfo 结构体转换为字节流
func (*InstallInfo) ToPrettyJson ¶
func (r *InstallInfo) ToPrettyJson() (string, error)
ToPrettyJson 将 InstallInfo 信息以 pretty-print json 形式输出
type LicenseClass ¶
type LicenseUnion ¶
type LicenseUnion struct {
LicenseClass *LicenseClass
String *string
}
func (*LicenseUnion) MarshalJSON ¶
func (x *LicenseUnion) MarshalJSON() ([]byte, error)
func (*LicenseUnion) UnmarshalJSON ¶
func (x *LicenseUnion) UnmarshalJSON(data []byte) error
type Manifest ¶
type Manifest struct {
Empty *StringOrArrayOfStrings `json:"##,omitempty"` // A comment.
Version string `json:"version,omitempty"`
Homepage *string `json:"homepage,omitempty"`
Description *string `json:"description,omitempty"`
License *LicenseUnion `json:"license,omitempty"`
URL *StringOrArrayOfStrings `json:"url,omitempty"`
Cookie map[string]interface{} `json:"cookie,omitempty"` // Undocumented: Found at https://github.com/se35710/scoop-java/search?l=JSON&q=cookie
Hash *Hash `json:"hash,omitempty"`
Architecture *ManifestArchitecture `json:"architecture,omitempty"`
ExtractDir *StringOrArrayOfStrings `json:"extract_dir,omitempty"`
ExtractTo *StringOrArrayOfStrings `json:"extract_to,omitempty"`
Innosetup *bool `json:"innosetup,omitempty"` // True if the installer InnoSetup based. Found in; https://github.com/lukesampson/scoop/search?l=JSON&q=innosetup
Installer *ManifestInstaller `json:"installer,omitempty"`
Uninstaller *Uninstaller `json:"uninstaller,omitempty"`
PreInstall *StringOrArrayOfStrings `json:"pre_install,omitempty"`
PostInstall *StringOrArrayOfStrings `json:"post_install,omitempty"`
EnvAddPath *StringOrArrayOfStrings `json:"env_add_path,omitempty"`
EnvSet map[string]interface{} `json:"env_set,omitempty"`
Psmodule *ManifestPsmodule `json:"psmodule,omitempty"`
Bin *StringOrArrayOfStringsOrAnArrayOfArrayOfStrings `json:"bin,omitempty"`
Shortcuts [][]string `json:"shortcuts,omitempty"`
Persist *StringOrArrayOfStringsOrAnArrayOfArrayOfStrings `json:"persist,omitempty"`
Checkver *Checkver `json:"checkver,omitempty"`
Autoupdate *Autoupdate `json:"autoupdate,omitempty"`
Depends *StringOrArrayOfStrings `json:"depends,omitempty"`
Suggest *Suggest `json:"suggest,omitempty"`
Notes *StringOrArrayOfStrings `json:"notes,omitempty"`
}
func GetInstalledManifest ¶
func GetManifest ¶
func GetUrlManifest ¶
func UnmarshalManifest ¶
func (*Manifest) ToPrettyJson ¶
type ManifestArchitecture ¶
type ManifestArchitecture struct {
The32Bit *The32BitClass `json:"32bit,omitempty"`
The64Bit *The32BitClass `json:"64bit,omitempty"`
}
type ManifestInstaller ¶
type ManifestInstaller struct {
Args *StringOrArrayOfStrings `json:"args,omitempty"`
File *string `json:"file,omitempty"`
Keep *bool `json:"keep,omitempty"`
Script *StringOrArrayOfStrings `json:"script,omitempty"`
}
type ManifestPsmodule ¶
type ManifestPsmodule struct {
Name *string `json:"name,omitempty"`
}
type StringOrArrayOfStrings ¶
A comment.
func (*StringOrArrayOfStrings) MarshalJSON ¶
func (x *StringOrArrayOfStrings) MarshalJSON() ([]byte, error)
func (*StringOrArrayOfStrings) UnmarshalJSON ¶
func (x *StringOrArrayOfStrings) UnmarshalJSON(data []byte) error
type StringOrArrayOfStringsOrAnArrayOfArrayOfStrings ¶
type StringOrArrayOfStringsOrAnArrayOfArrayOfStrings struct {
String *string
UnionArray []StringOrArrayOfStrings
}
func (*StringOrArrayOfStringsOrAnArrayOfArrayOfStrings) MarshalJSON ¶
func (x *StringOrArrayOfStringsOrAnArrayOfArrayOfStrings) MarshalJSON() ([]byte, error)
func (*StringOrArrayOfStringsOrAnArrayOfArrayOfStrings) UnmarshalJSON ¶
func (x *StringOrArrayOfStringsOrAnArrayOfArrayOfStrings) UnmarshalJSON(data []byte) error
type The32BitClass ¶
type The32BitClass struct {
URL *StringOrArrayOfStrings `json:"url,omitempty"`
Hash *Hash `json:"hash,omitempty"`
ExtractDir *StringOrArrayOfStrings `json:"extract_dir,omitempty"`
ExtractTo *StringOrArrayOfStrings `json:"extract_to,omitempty"`
Installer *ManifestInstaller `json:"installer,omitempty"`
Uninstaller *Uninstaller `json:"uninstaller,omitempty"`
PreInstall *StringOrArrayOfStrings `json:"pre_install,omitempty"`
PostInstall *StringOrArrayOfStrings `json:"post_install,omitempty"`
EnvAddPath *StringOrArrayOfStrings `json:"env_add_path,omitempty"`
EnvSet map[string]interface{} `json:"env_set,omitempty"`
Bin *StringOrArrayOfStringsOrAnArrayOfArrayOfStrings `json:"bin,omitempty"`
Shortcuts [][]string `json:"shortcuts,omitempty"`
Checkver *Checkver `json:"checkver,omitempty"`
}
type The32BitPsmodule ¶
type The32BitPsmodule struct {
Name *string `json:"name,omitempty"`
}
type Uninstaller ¶
type Uninstaller struct {
Args *StringOrArrayOfStrings `json:"args,omitempty"`
File *string `json:"file,omitempty"`
Script *StringOrArrayOfStrings `json:"script,omitempty"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.