sync

package
v0.0.0-...-6337964 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2014 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SyncBuiltTools

func SyncBuiltTools(stor storage.Storage, builtTools *BuiltTools, fakeSeries ...string) (*coretools.Tools, error)

SyncBuiltTools copies to storage a tools tarball and cloned copies for each series.

func SyncTools

func SyncTools(syncContext *SyncContext) error

SyncTools copies the Juju tools tarball from the official bucket or a specified source directory into the user's environment.

Types

type BuildToolsTarballFunc

type BuildToolsTarballFunc func(forceVersion *version.Number) (*BuiltTools, error)

BuildToolsTarballFunc is a function which can build a tools tarball.

var BuildToolsTarball BuildToolsTarballFunc = buildToolsTarball

Override for testing.

type BuiltTools

type BuiltTools struct {
	Version     version.Binary
	Dir         string
	StorageName string
	Sha256Hash  string
	Size        int64
}

BuiltTools contains metadata for a tools tarball resulting from a call to BundleTools.

type SyncContext

type SyncContext struct {
	// Target holds the destination for the tool synchronization
	Target storage.Storage

	// AllVersions controls the copy of all versions, not only the latest.
	AllVersions bool

	// Copy tools with major version, if MajorVersion > 0.
	MajorVersion int

	// Copy tools with minor version, if MinorVersion > 0.
	MinorVersion int

	// DryRun controls that nothing is copied. Instead it's logged
	// what would be coppied.
	DryRun bool

	// Dev controls the copy of development versions as well as released ones.
	Dev bool

	// Tools are being synced for a public cloud so include mirrors information.
	Public bool

	// Source, if non-empty, specifies a directory in the local file system
	// to use as a source.
	Source string
}

SyncContext describes the context for tool synchronization.

type UploadFunc

type UploadFunc func(stor storage.Storage, forceVersion *version.Number, series ...string) (*coretools.Tools, error)

UploadFunc is the type of Upload, which may be reassigned to control the behaviour of tools uploading.

var Upload UploadFunc = upload

Upload builds whatever version of github.com/juju/juju 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.

Jump to

Keyboard shortcuts

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