resourceadapters

package
Version: v0.0.0-...-4bd6544 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2016 License: AGPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUpBlob

func CleanUpBlob(st *corestate.State, persist corestate.Persistence, storagePath string) error

CleanUpBlob is a cleanup handler that will be used in state cleanup.

func DeployResources

func DeployResources(
	applicationID string,
	chID charmstore.CharmID,
	csMac *macaroon.Macaroon,
	filesAndRevisions map[string]string,
	resources map[string]charmresource.Meta,
	conn base.APICallCloser,
) (ids map[string]string, err error)

DeployResources uploads the bytes for the given files to the server and creates pending resource metadata for the all resource mentioned in the metadata. It returns a map of resource name to pending resource IDs.

func NewAPIClient

func NewAPIClient(apiCaller base.APICallCloser) (*client.Client, error)

NewAPIClient is mostly a copy of the newClient code in component/all/resources.go. It lives here because it simplifies this code immensely.

func NewDownloadHandler

func NewDownloadHandler(args apihttp.NewHandlerArgs) http.Handler

NewDownloadHandler returns a new HTTP handler for the given args.

func NewLatestCharmHandler

func NewLatestCharmHandler(st *state.State) (charmrevisionupdater.LatestCharmHandler, error)

NewLatestCharmHandler returns a LatestCharmHandler that uses the given Juju state.

func NewPublicFacade

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

NewPublicFacade provides the public API facade for resources. It is passed into common.RegisterStandardFacade.

func NewResourcePersistence

func NewResourcePersistence(persist corestate.Persistence) corestate.ResourcesPersistence

NewResourcePersistence is a function that may be passed to state.SetResourcesPersistence(). It will be used in the core state package to produce the resource persistence.

func NewResourceState

func NewResourceState(persist corestate.Persistence, base *corestate.State) corestate.Resources

NewResourceState is a function that may be passed to state.SetResourcesComponent().

func NewUploadHandler

func NewUploadHandler(args apihttp.NewHandlerArgs) http.Handler

NewUploadHandler returns a new HTTP handler for the given args.

Types

type CSRetryClient

type CSRetryClient struct {
	charmstore.Client
	// contains filtered or unexported fields
}

CSRetryClient is a wrapper around a Juju charm store client that retries GetResource() calls.

func (CSRetryClient) GetResource

GetResource returns a reader for the resource's data.

type DeployResourcesFunc

type DeployResourcesFunc func(
	applicationID string,
	chID charmstore.CharmID,
	csMac *macaroon.Macaroon,
	filesAndRevisions map[string]string,
	resources map[string]charmresource.Meta,
	conn base.APICallCloser,
) (ids map[string]string, err error)

DeployResourcesFunc is the function type of DeployResources.

Jump to

Keyboard shortcuts

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