Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

	// AddPendingResource adds the resource to the data store 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 CharmStore

type CharmStore interface {
	// ListResources composes, for each of the identified charms, the
	// list of details for each of the charm's resources. Those details
	// are those associated with the specific charm revision. They
	// include the resource's metadata and revision.
	ListResources([]charmstore.CharmID) ([][]charmresource.Resource, error)

	// ResourceInfo returns the metadata for the given resource.
	ResourceInfo(charmstore.ResourceRequest) (charmresource.Resource, error)
}

CharmStore exposes the functionality of the charm store as needed here.

type Facade

type Facade struct {

	// contains filtered or unexported fields

}

Facade is the public API facade for resources.

func NewFacade

func NewFacade(store Backend, newClient func() (CharmStore, error)) (*Facade, error)

NewFacade returns a new resoures API facade.

func NewPublicFacade

func NewPublicFacade(st *state.State, _ facade.Resources, authorizer facade.Authorizer) (*Facade, error)

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

func (Facade) AddPendingResources

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

func (Facade) ListResources

func (f Facade) ListResources(args params.ListResourcesArgs) (params.ResourcesResults, error)

ListResources returns the list of resources for the given application.

Source Files