resources

package
v0.0.0-...-a753888 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: AGPL-3.0 Imports: 16 Imported by: 1

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 API

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

API is the public API facade for resources.

func NewFacade

func NewFacade(ctx facade.Context) (*API, error)

NewFacade creates a public API facade for resources. It is used for API registration.

func NewResourcesAPI

func NewResourcesAPI(backend Backend, factory func(*charm.URL) (NewCharmRepository, error)) (*API, error)

NewResourcesAPI returns a new resources API facade.

func (*API) AddPendingResources

AddPendingResources adds the provided resources (info) to the Juju model in a pending state, meaning they are not available until resolved. Handles CharmHub and Local charms.

func (*API) ListResources

func (a *API) ListResources(args params.ListResourcesArgs) (params.ResourcesResults, error)

ListResources returns the list of resources for the given application.

type Backend

type Backend interface {
	// ListResources returns the resources for the given application.
	ListResources(application string) (resources.ApplicationResources, error)

	// AddPendingResource adds the resource to the data backend in a
	// "pending" state. It will stay pending (and unavailable) until
	// it is resolved. The returned ID is used to identify the pending
	// resources when resolving it.
	AddPendingResource(applicationID, userID string, chRes charmresource.Resource) (string, error)
}

Backend is the functionality of Juju's state needed for the resources API.

type NewCharmRepository

type NewCharmRepository interface {
	ResolveResources(resources []charmresource.Resource, id corecharm.CharmID) ([]charmresource.Resource, error)
}

NewCharmRepository defines methods required by the resources facade specific to an individual repository type.

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