charmrevisionupdater

package
v0.0.0-...-298751d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 24 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type Application

type Application interface {
	CharmURL() (curl *string, force bool)
	CharmOrigin() *state.CharmOrigin
	ApplicationTag() names.ApplicationTag
	UnitCount() int
}

Application is the subset of *state.Application that we need.

type CharmRevisionUpdater

type CharmRevisionUpdater interface {
	UpdateLatestRevisions() (params.ErrorResult, error)
}

CharmRevisionUpdater defines the methods on the charmrevisionupdater API end point.

type CharmRevisionUpdaterAPI

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

CharmRevisionUpdaterAPI implements the CharmRevisionUpdater interface and is the concrete implementation of the api end point.

func NewCharmRevisionUpdaterAPIState

func NewCharmRevisionUpdaterAPIState(
	state State,
	clock clock.Clock,
	newCharmhubClient newCharmhubClientFunc,
) (*CharmRevisionUpdaterAPI, error)

NewCharmRevisionUpdaterAPIState creates a new charmrevisionupdater API with a State interface directly (mainly for use in tests).

func (*CharmRevisionUpdaterAPI) UpdateLatestRevisions

func (api *CharmRevisionUpdaterAPI) UpdateLatestRevisions() (params.ErrorResult, error)

UpdateLatestRevisions retrieves the latest revision information from the charm store for all deployed charms and records this information in state.

type CharmhubRefreshClient

type CharmhubRefreshClient interface {
	RefreshWithRequestMetrics(ctx context.Context, config charmhub.RefreshConfig, metrics map[metrics.MetricKey]map[metrics.MetricKey]string) ([]transport.RefreshResponse, error)
	RefreshWithMetricsOnly(ctx context.Context, metrics map[metrics.MetricKey]map[metrics.MetricKey]string) error
}

CharmhubRefreshClient is an interface for the methods of the charmhub client that we need.

type Model

type Model interface {
	CloudName() string
	CloudRegion() string
	Config() (*config.Config, error)
	IsControllerModel() bool
	Metrics() (state.ModelMetrics, error)
	ModelTag() names.ModelTag
	UUID() string
}

Model is the subset of *state.Model that we need.

type State

type State interface {
	AddCharmPlaceholder(curl *charm.URL) error
	AllApplications() ([]Application, error)
	Charm(curl string) (*state.Charm, error)
	Cloud(name string) (cloud.Cloud, error)
	ControllerUUID() string
	Model() (Model, error)
	Resources() state.Resources
	AliveRelationKeys() []string
}

State is the subset of *state.State that we need.

type StateShim

type StateShim struct {
	*state.State
}

StateShim takes a *state.State and implements this package's State interface.

func (StateShim) AllApplications

func (s StateShim) AllApplications() ([]Application, error)

func (StateShim) Model

func (s StateShim) Model() (Model, error)

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