Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrExhausted = errors.Errorf("exhausted")
ErrExhausted reveals if a refresher was exhausted in it's task. If so, then it is expected to attempt another refresher.
Functions ¶
This section is empty.
Types ¶
type CharmRepository ¶
type CharmRepository interface {
// NewCharmAtPathForSeries returns the charm represented by this path,
// and a URL that describes it. If the series is empty,
// the charm's default series is used, if any.
// Otherwise, the series is validated against those the
// charm declares it supports. If force is true, then any
// series validation errors are ignored and the requested
// series is used regardless. Note though that is it still
// an error if the series is not specified and the charm does not
// define any.
NewCharmAtPathForceSeries(path, series string, force bool) (charm.Charm, *charm.URL, error)
}
CharmRepository defines methods for interaction with a charm repo.
type CharmResolver ¶
type CharmResolver interface {
ResolveCharm(url *charm.URL, preferredOrigin commoncharm.Origin) (*charm.URL, commoncharm.Origin, []string, error)
}
CharmResolver defines methods required to resolve charms, as required by the upgrade-charm command.
type CommandLogger ¶
type CommandLogger interface {
Infof(format string, params ...interface{})
Warningf(format string, params ...interface{})
Verbosef(format string, params ...interface{})
}
CommandLogger represents a logger which follows the logging precepts of a cmd.Context.
type Refresher ¶
type Refresher interface {
// Allowed will attempt to check if a refresher is allowed to run a given
// config.
Allowed(RefresherConfig) (bool, error)
// Refresh a given charm. Bundles are not supported as there is no physical
// representation in Juju.
Refresh() (*CharmID, error)
// String returns a string description of the refresher.
String() string
}
Refresher defines the functionality of a refresher returned by the factory.
type RefresherConfig ¶
type RefresherConfig struct {
ApplicationName string
CharmURL *charm.URL
CharmOrigin corecharm.Origin
CharmRef string
Channel corecharm.Channel
DeployedSeries string
Force bool
ForceSeries bool
Switch bool
Logger CommandLogger
}
RefresherConfig is the data required to choose an refresher and then run the PrepareAndUpgrade.
type RefresherDependencies ¶
type RefresherDependencies struct {
Authorizer store.MacaroonGetter
CharmAdder store.CharmAdder
CharmResolver CharmResolver
}
RefresherDependencies are required for any deployer to be run.
type RefresherFactory ¶
type RefresherFactory interface {
Run(RefresherConfig) (*CharmID, error)
}
RefresherFactory contains a method to get a refresher.
func NewRefresherFactory ¶
func NewRefresherFactory(deps RefresherDependencies) RefresherFactory
NewRefresherFactory returns a factory setup with the API and function dependencies required by every refresher.
type RefresherFn ¶
type RefresherFn = func(RefresherConfig) (Refresher, error)
RefresherFn defines a function alias to create a Refresher from a given function.