Documentation
¶
Index ¶
Constants ¶
View Source
const ( CONTEXT_OS = "Os" CONTEXT_ARCH = "Arch" CONTEXT_VERSION = "Version" CONTEXT_NAME = "Name" CONTEXT_FULLNAME = "FullName" )
Predefined context keys.
Variables ¶
View Source
var ErrMiss = errors.New("cache missed")
ErrMiss is returned when the cache is accessed when it's empty.
Functions ¶
func MustConstraint ¶
func MustConstraint(c string) *semver.Constraints
MustConstraint creates a new constraint and panics on error.
Types ¶
type Binary ¶
type Binary struct {
// Name of the binary
Name string
// Full name of the binary (as in the binary URL)
FullName string
// Homepage of the binary (if any)
Homepage string
// Simple description about what this software does
Description string
// Binary version
Version *semver.Version
// Download URL
URL string
// Effective file name (when extracting from an archive)
//
// Falls back to binary name when not provided.
File string
}
Binary represents information for a specific version.
type BinaryTemplate ¶
type BinaryTemplate struct {
// Overrides the automatically calculated name based on the full name of the binary
Name string
// Homepage of the binary (if any)
Homepage string
// Simple description about what this software does
Description string
// Download URL
URL *template.Template
// Effective file name (when extracting from an archive)
//
// Falls back to binary name when not provided.
File *template.Template
}
BinaryTemplate represents information used for creating an actual binary instance.
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) GetFile ¶
GetFile returns the binary file.
Returns ErrMiss when accessing the cache when it's empty.
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
func NewDownloader ¶
func NewDownloader(cache *Cache, logger logrus.FieldLogger) *Downloader
NewDownloader returns a new Downloader instance.
type Rule ¶
type Rule struct {
Constraint *semver.Constraints
Template *BinaryTemplate
}
Rule binds a template and it's version condition together.
Click to show internal directories.
Click to hide internal directories.