charmrevisionupdater

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	CharmURL() (curl *charm.URL, force bool)
	CharmOrigin() *state.CharmOrigin
	Channel() csparams.Channel
	ApplicationTag() names.ApplicationTag
}

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 NewCharmRevisionUpdaterAPI

func NewCharmRevisionUpdaterAPI(ctx facade.Context) (*CharmRevisionUpdaterAPI, error)

NewCharmRevisionUpdaterAPI creates a new server-side charmrevisionupdater API end point.

func NewCharmRevisionUpdaterAPIState

func NewCharmRevisionUpdaterAPIState(
	state State,
	newCharmstoreClient newCharmstoreClientFunc,
	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 {
	Refresh(ctx context.Context, config charmhub.RefreshConfig) ([]transport.RefreshResponse, 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
	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 *charm.URL) (*state.Charm, error)
	Cloud(name string) (cloud.Cloud, error)
	ControllerConfig() (controller.Config, error)
	ControllerUUID() string
	Model() (Model, error)
	Resources() (state.Resources, error)
}

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