bindownloader

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config map[string][]*Downloader

Config map binary names to Config

func LoadConfig

func LoadConfig(config io.Reader) (Config, error)

LoadConfig returns a Config from a config reader

func LoadConfigFile

func LoadConfigFile(configFile string) (Config, error)

LoadConfigFile returns a Config from the path to a config file

func (Config) Downloader

func (c Config) Downloader(binary, os, arch string) *Downloader

Downloader returns a Downloader for the given binary, os and arch.

type Downloader

type Downloader struct {
	URL        string `json:"url"`
	Checksum   string `json:"checksum"`
	LinkSource string `json:"symlink,omitempty"`
	BinName    string `json:"bin"`
	MoveFrom   string `json:"move-from"`
	OS         string `json:"os"`
	Arch       string `json:"arch"`
}

Downloader downloads a binary

func (*Downloader) Install

func (d *Downloader) Install(opts InstallOpts) error

Install downloads and installs a bin

type InstallOpts

type InstallOpts struct {
	// CellarDir is the directory where downloads and extractions will be placed.  Default is a <TargetDir>/.bindownloader
	CellarDir string
	// TargetDir is the directory where the executable should end up
	TargetDir string
	// Force - whether to force the install even if it already exists
	Force bool
}

InstallOpts options for Install

Directories

Path Synopsis
cmd
bindownloader command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL