Documentation ¶
Index ¶
- Constants
- func FindByKeyword(keyword, configDir string) (result []string)
- func FindCategories() (result []string)
- func IsSupport(cfg HDConfig) bool
- type CmdWithArgs
- type DefaultFetcher
- type FakeFetcher
- type Fetcher
- type HDConfig
- type HDPackage
- type Installer
- func (o *Installer) CheckDepAndInstall(tools map[string]string) (err error)
- func (o *Installer) GetVersion(path string) (version string, err error)
- func (o *Installer) Install() (err error)
- func (o *Installer) OverWriteBinary(sourceFile, targetPath string) (err error)
- func (o *Installer) ProviderURLParse(path string, acceptPreRelease bool) (packageURL string, err error)
- type PackagingFormat
Constants ¶
const ( // ConfigGitHub is the default git repository URI ConfigGitHub = "https://github.com/LinuxSuRen/hd-home" // ConfigBranch is the default branch name of hd-home git repository ConfigBranch = "master" )
const (
// ProviderGitHub represents https://github.com
ProviderGitHub = "github"
)
Variables ¶
This section is empty.
Functions ¶
func FindByKeyword ¶ added in v0.0.56
FindByKeyword find org/repo by a keyword
func FindCategories ¶ added in v0.0.54
func FindCategories() (result []string)
FindCategories returns the whole supported categories
Types ¶
type CmdWithArgs ¶
CmdWithArgs is a command with arguments
type DefaultFetcher ¶ added in v0.0.56
type DefaultFetcher struct { }
DefaultFetcher is the default fetcher which fetches the config files from a git repository
func (*DefaultFetcher) FetchLatestRepo ¶ added in v0.0.56
func (f *DefaultFetcher) FetchLatestRepo(provider string, branch string, progress io.Writer) (err error)
FetchLatestRepo fetches the hd-home as the config
func (*DefaultFetcher) GetConfigDir ¶ added in v0.0.56
func (f *DefaultFetcher) GetConfigDir() (configDir string, err error)
GetConfigDir returns the directory of the config
type FakeFetcher ¶ added in v0.0.56
FakeFetcher is a fake fetch. We expect to use it for unit test cases.
func (*FakeFetcher) FetchLatestRepo ¶ added in v0.0.56
func (f *FakeFetcher) FetchLatestRepo(provider string, branch string, progress io.Writer) (err error)
FetchLatestRepo is fake method
func (*FakeFetcher) GetConfigDir ¶ added in v0.0.56
func (f *FakeFetcher) GetConfigDir() (configDir string, err error)
GetConfigDir is a fake method
type Fetcher ¶ added in v0.0.56
type Fetcher interface { GetConfigDir() (configDir string, err error) FetchLatestRepo(provider string, branch string, progress io.Writer) (err error) }
Fetcher is the interface of a fetcher which responses to fetch config files
type HDConfig ¶
type HDConfig struct { Name string `yaml:"name"` Categories []string `yaml:"categories"` Filename string `yaml:"filename"` FormatOverrides PackagingFormat `yaml:"formatOverrides"` Binary string `yaml:"binary"` TargetBinary string `yaml:"targetBinary"` TargetDirectory string `yaml:"targetDirectory"` AdditionBinaries []string `yaml:"additionBinaries"` FromSource bool `yaml:"fromSource"` URL string `yaml:"url"` Tar string `yaml:"tar"` LatestVersion string `yaml:"latestVersion"` SupportOS []string `yaml:"supportOS"` SupportArch []string `yaml:"supportArch"` Replacements map[string]string `yaml:"replacements"` Requirements []string `yaml:"requirements"` Installation *CmdWithArgs `yaml:"installation"` PreInstalls []CmdWithArgs `yaml:"preInstalls"` PostInstalls []CmdWithArgs `yaml:"postInstalls"` TestInstalls []CmdWithArgs `yaml:"testInstalls"` Version string `yaml:"version"` Org, Repo string }
HDConfig is the config of http-downloader
func FindPackagesByCategory ¶ added in v0.0.53
FindPackagesByCategory returns the HDConfigs by category
type HDPackage ¶
type HDPackage struct { Name string Version string // e.g. v1.0.1 VersionNum string // e.g. 1.0.1 OS string // e.g. linux, darwin Arch string // e.g. amd64 AdditionBinaries []string }
HDPackage represents a package of http-downloader
type Installer ¶
type Installer struct { Package *HDConfig Tar bool Output string TargetDirectory string Source string Name string CleanPackage bool Provider string OS string Arch string Fetch bool AdditionBinaries []string Org string Repo string }
Installer is a tool to install a package
func (*Installer) CheckDepAndInstall ¶
CheckDepAndInstall checks the desired tools, install the missing packages
func (*Installer) GetVersion ¶ added in v0.0.40
GetVersion parse install app info
func (*Installer) OverWriteBinary ¶ added in v0.0.34
OverWriteBinary install a binrary file
type PackagingFormat ¶ added in v0.0.43
PackagingFormat is used for containing config depending on machine