charmdownloader

package
v0.0.0-...-439fd0a Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(cfg ManifoldConfig) dependency.Manifold

Manifold returns a Manifold that encapsulates the charmdownloader worker.

func NewCharmDownloader

func NewCharmDownloader(cfg Config) (worker.Worker, error)

NewCharmDownloader returns a new CharmDownloader worker.

Types

type CharmDownloader

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

CharmDownloader watches applications that reference charms that have not yet been downloaded and triggers an asynchronous download request for each one.

func (*CharmDownloader) Kill

func (cd *CharmDownloader) Kill()

Kill is part of the worker.Worker interface.

func (*CharmDownloader) Wait

func (cd *CharmDownloader) Wait() error

Wait is part of the worker.Worker interface.

type CharmDownloaderAPI

type CharmDownloaderAPI interface {
	WatchApplicationsWithPendingCharms() (watcher.StringsWatcher, error)
	DownloadApplicationCharms(applications []names.ApplicationTag) error
}

CharmDownloaderAPI describes the API exposed by the charm downloader facade.

type Config

type Config struct {
	Logger             Logger
	CharmDownloaderAPI CharmDownloaderAPI
}

Config defines the operation of a Worker.

func (Config) Validate

func (cfg Config) Validate() error

Validate returns an error if cfg cannot drive a Worker.

type Logger

type Logger interface {
	Tracef(string, ...interface{})
	Debugf(string, ...interface{})
	Warningf(string, ...interface{})
	Infof(string, ...interface{})
	Errorf(string, ...interface{})
	Criticalf(string, ...interface{})
}

Logger represents the methods used by the worker to log details.

type ManifoldConfig

type ManifoldConfig struct {
	APICallerName string
	Logger        Logger

	// A constructor for the charmdownloader API which can be overridden
	// during testing. If omitted, the default client for the charmdownloader
	// facade will be automatically used.
	NewCharmDownloaderAPI func(base.APICaller) CharmDownloaderAPI
}

ManifoldConfig describes the resources used by the charmdownloader worker.

func (ManifoldConfig) Validate

func (cfg ManifoldConfig) Validate() error

Validate is called by start to check for bad configuration.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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