tools

package
v0.0.0-...-acd7349 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2013 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultToolPrefix = "tools/juju-"
)

Variables

View Source
var ErrNoMatches = errors.New("no matching tools available")
View Source
var ErrNoTools = errors.New("no tools available")

Functions

func SetToolPrefix

func SetToolPrefix(prefix string)

SetToolPrefix changes the prefix used to compose the tools tarball file name.

func StorageName

func StorageName(vers version.Binary) string

StorageName returns the name that is used to store and retrieve the given version of the juju tools.

func Upload

func Upload(storage URLPutter, forceVersion *version.Number, fakeSeries ...string) (*state.Tools, error)

Upload builds whatever version of launchpad.net/juju-core is in $GOPATH, uploads it to the given storage, and returns a Tools instance describing them. If forceVersion is not nil, the uploaded tools bundle will report the given version number; if any fakeSeries are supplied, additional copies of the built tools will be uploaded for use by machines of those series. Juju tools built for one series do not necessarily run on another, but this func exists only for development use cases.

Types

type Filter

type Filter struct {

	// Release, if true, causes the filter to match only tools with a
	// non-development version number.
	Released bool

	// Number, if non-zero, causes the filter to match only tools with
	// that exact version number.
	Number version.Number

	// Series, if not empty, causes the filter to match only tools with
	// that series.
	Series string

	// Arch, if not empty, causes the filter to match only tools with
	// that architecture.
	Arch string
}

Filter holds criteria for choosing tools.

type List

type List []*state.Tools

List holds tools available in an environment. The order of tools within a List is not significant.

func ReadList

func ReadList(storage URLLister, majorVersion int) (List, error)

ReadList returns a List of the tools in store with the given major version. If store contains no such tools, it returns ErrNoMatches.

func (List) Arches

func (src List) Arches() []string

Arches returns all architectures for which some tools in src were built.

func (List) Exclude

func (src List) Exclude(excluded List) List

Difference returns the tools in src that are not in excluded.

func (List) Match

func (src List) Match(f Filter) (List, error)

Match returns a List, derived from src, containing only those tools that match the supplied Filter. If no tools match, it returns ErrNoMatches.

func (List) Newest

func (src List) Newest() (version.Number, List)

Newest returns the greatest version in src, and the tools with that version.

func (List) Series

func (src List) Series() []string

Series returns all series for which some tools in src were built.

func (List) String

func (src List) String() string

String returns the versions of the tools in src, separated by semicolons.

func (List) URLs

func (src List) URLs() map[version.Binary]string

URLs returns download URLs for the tools in src, keyed by binary version.

type URLLister

type URLLister interface {
	URL(name string) (string, error)
	List(prefix string) ([]string, error)
}

URLLister exposes to ReadList the relevant capabilities of an environs.Storage; it exists to foil an import cycle.

type URLPutter

type URLPutter interface {
	URL(name string) (string, error)
	Put(name string, r io.Reader, length int64) error
}

URLPutter exposes to Upload the relevant capabilities of an environs.Storage; it exists to foil an import cycle.

Jump to

Keyboard shortcuts

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