provider

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

nolint: lll

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBinaryNotFound            = errors.New("binary not found")
	ErrNoMatchingVersionFound    = errors.New("no matching version found")
	ErrLatestVersionNotSupported = errors.New("latest version is not supported yet")
)

Functions

This section is empty.

Types

type Binary

type Binary struct {
	Name     string
	FullName string
	Version  string
	URL      string
	File     string
}

Binary is a result of a binary resolution.

type BinaryRule

type BinaryRule struct {
	VersionConstraint string
	Template          BinaryTemplate
}

BinaryRule contains all information to resolve a binary.

type BinaryTemplate

type BinaryTemplate struct {
	Name        string
	Homepage    string
	Description string
	URL         string
	File        string
}

BinaryTemplate contains the binary information.

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider contains a set of binary rules.

func NewGithubProvider

func NewGithubProvider() *Provider

NewGithubProvider

func (*Provider) Resolve

func (r *Provider) Resolve(name string, version string) (*Binary, error)

Resolve resolves a binary.

type TemplateContext

type TemplateContext struct {
	Name     string
	FullName string
	Version  string
	Os       string
	Arch     string
}

TemplateContext is passed to URL and File templates.

Jump to

Keyboard shortcuts

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