netup

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DownloadTimeout is timeout for download file.
	DownloadTimeout = 5 * time.Minute

	// GithubUser is username which be used for github's basic auth.
	GithubUser string

	// GithubToken is token which be used for github's basic auth.
	GithubToken string

	// GithubVerbose enables log for github related operation.
	GithubVerbose bool

	// LogRotateCount is used for log rotation.
	LogRotateCount = 5

	// ExeRotateCount is used for executable files rotation.
	ExeRotateCount = 5
)
View Source
var (
	// Version stores version to log.
	Version = "none"
)

Functions

func LogFatal

func LogFatal(err error)

LogFatal records a message to UI and logger file then os.Exit(1)

func LogInfo

func LogInfo(format string, v ...interface{})

LogInfo records a message to logger file.

func Update

func Update(targetDir, workDir string, srcPack SourcePack, arch Arch, restoreFlag bool) error

Update updates or installs a package into target directory.

Types

type Arch

type Arch struct {
	// Name for architecture, like "X86", "AMD64"
	Name string

	// Hint is a file be used to guess architecture.
	Hint string
}

Arch determines architecture.

type DirectSource

type DirectSource struct {
	Name  string
	URL   string
	Strip int
}

DirectSource represents direct ZIP source.

func (*DirectSource) String

func (ds *DirectSource) String() string

type GithubSource

type GithubSource struct {
	Name    string
	User    string
	Project string
	NamePat *regexp.Regexp
	Strip   int
}

GithubSource represents project source on GitHub.

func (*GithubSource) String

func (gs *GithubSource) String() string

type Source

type Source interface {

	// String returns a string to represent source.
	String() string
	// contains filtered or unexported methods
}

Source describes source of update.

type SourcePack

type SourcePack map[arch.CPU]Source

SourcePack is the map arch.CPU to source.

Jump to

Keyboard shortcuts

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