juju: github.com/juju/juju/tools Index | Files

package tools

import "github.com/juju/juju/tools"

Index

Package Files

list.go marshal.go tools.go

Variables

var ErrNoMatches = errors.New("no matching agent binaries available")

type Filter Uses

type Filter struct {
    // 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 GUIArchive Uses

type GUIArchive struct {
    Version version.Number `json:"version"`
    URL     string         `json:"url"`
    SHA256  string         `json:"sha256,omitempty"`
    Size    int64          `json:"size"`
}

GUI represents the location and version of a GUI release archive.

type HasVersion Uses

type HasVersion interface {
    // AgentVersion returns the agent version.
    AgentVersion() version.Number
}

HasVersion instance store an agent version.

type List Uses

type List []*Tools

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

func (List) AllSeries Uses

func (src List) AllSeries() []string

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

func (List) Arches Uses

func (src List) Arches() []string

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

func (List) Exclude Uses

func (src List) Exclude(excluded List) List

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

func (List) Len Uses

func (l List) Len() int

func (List) Less Uses

func (l List) Less(i, j int) bool

func (List) Match Uses

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 Uses

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

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

func (List) OneSeries Uses

func (src List) OneSeries() string

OneSeries returns the single series for which all tools in src were built.

func (List) String Uses

func (src List) String() string

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

func (List) Swap Uses

func (l List) Swap(i, j int)

func (List) URLs Uses

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

URLs returns download URLs for the tools in src, keyed by binary version. Each version can have more than one URL.

type Tools Uses

type Tools struct {
    Version version.Binary `json:"version"`
    URL     string         `json:"url"`
    SHA256  string         `json:"sha256,omitempty"`
    Size    int64          `json:"size"`
}

Tools represents the location and version of a tools tarball.

func (*Tools) AgentVersion Uses

func (t *Tools) AgentVersion() version.Number

AgentVersion

func (*Tools) GetBSON Uses

func (t *Tools) GetBSON() (interface{}, error)

GetBSON returns the structure to be serialized for the tools as a generic interface.

func (*Tools) SetBSON Uses

func (t *Tools) SetBSON(raw bson.Raw) error

SetBSON updates the internal members with the data stored in the bson.Raw parameter.

type Versions Uses

type Versions []HasVersion

Versions holds instances of HasVersion.

func (Versions) Match Uses

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

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

func (Versions) Newest Uses

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

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

func (Versions) NewestCompatible Uses

func (src Versions) NewestCompatible(base version.Number) (newest version.Number, found bool)

NewestCompatible returns the most recent version compatible with base, i.e. with the same major and minor numbers and greater or equal patch and build numbers.

Package tools imports 6 packages (graph) and is imported by 1541 packages. Updated 2019-04-25. Refresh now. Tools for package owners.