Documentation
¶
Index ¶
- type Config
- func (c *Config) AddChecksums(dependencies []string, systems []SystemInfo) error
- func (c *Config) BinName(depName string, system SystemInfo) (string, error)
- func (c *Config) DownloadDependency(dependencyName string, sysInfo SystemInfo, opts *ConfigDownloadDependencyOpts) (string, error)
- func (c *Config) ExtractDependency(dependencyName string, sysInfo SystemInfo, opts *ConfigExtractDependencyOpts) (string, error)
- func (c *Config) InstallDependency(dependencyName string, sysInfo SystemInfo, opts *ConfigInstallDependencyOpts) (string, error)
- func (c *Config) Validate(dependencies []string, systems []SystemInfo) error
- type ConfigAddChecksumsOptions
- type ConfigDownloadDependencyOpts
- type ConfigExtractDependencyOpts
- type ConfigInstallDependencyOpts
- type ConfigValidateOptions
- type Dependency
- type DependencyOverride
- type OverrideMatcher
- type SystemInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Cache string `json:"cache,omitempty" yaml:"cache,omitempty"`
InstallDir string `json:"install_dir,omitempty" yaml:"install_dir,omitempty"`
Dependencies map[string]*Dependency `json:"dependencies,omitempty" yaml:",omitempty"`
Templates map[string]*Dependency `json:"templates,omitempty" yaml:",omitempty"`
URLChecksums map[string]string `json:"url_checksums,omitempty" yaml:"url_checksums,omitempty"`
}
Config is our main config
func (*Config) AddChecksums ¶
func (c *Config) AddChecksums(dependencies []string, systems []SystemInfo) error
AddChecksums downloads, calculates checksums and adds them to the config's URLChecksums. AddChecksums skips urls that already exist in URLChecksums.
func (*Config) BinName ¶
func (c *Config) BinName(depName string, system SystemInfo) (string, error)
BinName returns the bin name for a downloader on a given system
func (*Config) DownloadDependency ¶
func (c *Config) DownloadDependency(dependencyName string, sysInfo SystemInfo, opts *ConfigDownloadDependencyOpts) (string, error)
DownloadDependency downloads a dependency
func (*Config) ExtractDependency ¶
func (c *Config) ExtractDependency(dependencyName string, sysInfo SystemInfo, opts *ConfigExtractDependencyOpts) (string, error)
ExtractDependency downloads and extracts a dependency
func (*Config) InstallDependency ¶
func (c *Config) InstallDependency(dependencyName string, sysInfo SystemInfo, opts *ConfigInstallDependencyOpts) (string, error)
InstallDependency downloads, extracts and installs a dependency
type ConfigAddChecksumsOptions ¶
type ConfigAddChecksumsOptions struct {
// Only add checksums for these dependencies. When Dependencies is empty, AddChecksums adds checksums for all
//configured dependencies.
Dependencies []string
// Only add checksums for these system targets. When Systems is empty, AddChecksums adds checksums for all known
// builds configured for each dependency.
Systems []SystemInfo
}
ConfigAddChecksumsOptions contains options for Config.AddChecksums
type ConfigDownloadDependencyOpts ¶
ConfigDownloadDependencyOpts options for Config.DownloadDependency
type ConfigExtractDependencyOpts ¶
ConfigExtractDependencyOpts options for Config.ExtractDependency
type ConfigInstallDependencyOpts ¶
type ConfigInstallDependencyOpts struct {
// TargetPath is the path where the executable should end up
TargetPath string
// Force - whether to force the install even if it already exists
Force bool
}
ConfigInstallDependencyOpts provides options for Config.InstallDependency
type ConfigValidateOptions ¶
type ConfigValidateOptions struct {
// Only validates these dependencies. When Dependencies is empty, Validate validates all configured dependencies.
Dependencies []string
// Only validates system targets. When Systems is empty, AddChecksums validates all known builds configured for each
//dependency.
Systems []SystemInfo
}
ConfigValidateOptions contains options for Config.Validate
type Dependency ¶
type Dependency struct {
Template *string `json:"template,omitempty" yaml:",omitempty"`
URL *string `json:"url,omitempty" yaml:",omitempty"`
ArchivePath *string `json:"archive_path,omitempty" yaml:"archive_path,omitempty"`
BinName *string `json:"bin,omitempty" yaml:"bin,omitempty"`
Link *bool `json:"link,omitempty" yaml:",omitempty"`
Vars map[string]string `json:"vars,omitempty" yaml:",omitempty"`
Overrides []DependencyOverride `json:"overrides,omitempty" yaml:",omitempty"`
Substitutions map[string]map[string]string `json:"substitutions,omitempty" yaml:",omitempty"`
}
Dependency is something to download, extract and install
type DependencyOverride ¶
type DependencyOverride struct {
OverrideMatcher OverrideMatcher `json:"matcher" yaml:"matcher,omitempty"`
Dependency Dependency `json:"dependency" yaml:",omitempty"`
}
DependencyOverride overrides a dependency's configuration
type OverrideMatcher ¶
type OverrideMatcher struct {
OS []string `json:"os,omitempty" yaml:",omitempty"`
Arch []string `json:"arch,omitempty" yaml:",omitempty"`
}
OverrideMatcher contains a list or oses and arches to match an override. If either os or arch is empty, all oses and arches match.
type SystemInfo ¶
SystemInfo contains os and architecture for a target system
func (SystemInfo) MarshalText ¶
func (s SystemInfo) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler
func (*SystemInfo) String ¶
func (s *SystemInfo) String() string
func (*SystemInfo) UnmarshalText ¶
func (s *SystemInfo) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
bindown
command
|
|
|
internal
|
|
|
cli/mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
jsonschema/schemafiles
Package schemafiles generated by go-bindata.// sources: ../../bindown.schema.json
|
Package schemafiles generated by go-bindata.// sources: ../../bindown.schema.json |