Documentation
Index ¶
- type API
- func (a *API) AddCharm(args params.AddCharmWithOrigin) (params.CharmOriginResult, error)
- func (a *API) AddCharmWithAuthorization(args params.AddCharmWithAuth) (params.CharmOriginResult, error)
- func (a *API) CharmInfo(args params.CharmURL) (params.Charm, error)
- func (a *API) CheckCharmPlacement(args params.ApplicationCharmPlacements) (params.ErrorResults, error)
- func (a *API) IsMetered(args params.CharmURL) (params.IsMeteredResult, error)
- func (a *API) List(args params.CharmsList) (params.CharmsListResult, error)
- func (a *API) ResolveCharms(args params.ResolveCharmsWithChannel) (params.ResolveCharmWithChannelResults, error)
- type APIv2
- type APIv3
- type CSRepository
- type CSResolverGetterFunc
- type CharmArchive
- type CharmHubClient
- type ResolverGetterParams
- type StoreCharm
- type Strategy
- type StrategyFunc
Constants ¶
Variables ¶
Functions ¶
Types ¶
type API ¶
type API struct { *charmscommon.CharmsAPI // contains filtered or unexported fields }
API implements the charms interface and is the concrete implementation of the API end point.
func NewCharmsAPI ¶
func NewCharmsAPI( authorizer facade.Authorizer, st charmsinterfaces.BackendState, m charmsinterfaces.BackendModel, csResolverFunc CSResolverGetterFunc, getStrategyFunc func(source string) StrategyFunc, newStorage func(modelUUID string, session *mgo.Session) storage.Storage, ) (*API, error)
func NewFacadeV4 ¶
NewFacadeV4 provides the signature required for facade V4 registration.
func (*API) AddCharm ¶
func (a *API) AddCharm(args params.AddCharmWithOrigin) (params.CharmOriginResult, error)
AddCharm adds the given charm URL (which must include revision) to the environment, if it does not exist yet. Local charms are not supported, only charm store and charm hub URLs. See also AddLocalCharm().
func (*API) AddCharmWithAuthorization ¶
func (a *API) AddCharmWithAuthorization(args params.AddCharmWithAuth) (params.CharmOriginResult, error)
AddCharmWithAuthorization adds the given charm URL (which must include revision) to the environment, if it does not exist yet. Local charms are not supported, only charm store and charm hub URLs. See also AddLocalCharm().
The authorization macaroon, args.CharmStoreMacaroon, may be omitted, in which case this call is equivalent to AddCharm.
func (*API) CharmInfo ¶
CharmInfo returns information about the requested charm. NOTE: thumper 2016-06-29, this is not a bulk call and probably should be.
func (*API) CheckCharmPlacement ¶
func (a *API) CheckCharmPlacement(args params.ApplicationCharmPlacements) (params.ErrorResults, error)
CheckCharmPlacement checks if a charm is allowed to be placed with in a given application.
func (*API) List ¶
func (a *API) List(args params.CharmsList) (params.CharmsListResult, error)
List returns a list of charm URLs currently in the state. If supplied parameter contains any names, the result will be filtered to return only the charms with supplied names.
func (*API) ResolveCharms ¶
func (a *API) ResolveCharms(args params.ResolveCharmsWithChannel) (params.ResolveCharmWithChannelResults, error)
ResolveCharms resolves the given charm URLs with an optionally specified preferred channel. Channel provided via CharmOrigin.
type APIv2 ¶
type APIv2 struct {
*APIv3
}
func NewFacadeV2 ¶
NewFacadeV2 provides the signature required for facade V2 registration. It is unknown where V1 is.
func (*APIv2) AddCharm ¶
func (a *APIv2) AddCharm(_ struct{})
AddCharm is not available via the V2 API.
func (*APIv2) AddCharmWithAuthorization ¶
func (a *APIv2) AddCharmWithAuthorization(_ struct{})
AddCharmWithAuthorization is not available via the V2 API.
func (*APIv2) ResolveCharms ¶
func (a *APIv2) ResolveCharms(_ struct{})
ResolveCharms is not available via the V2 API.
type APIv3 ¶
type APIv3 struct {
*API
}
func NewFacadeV3 ¶
NewFacadeV3 provides the signature required for facade V3 registration.
func (*APIv3) CheckCharmPlacement ¶
func (a *APIv3) CheckCharmPlacement(_, _ struct{})
CheckCharmPlacement isn't on the v13 API.
type CSRepository ¶
type CSRepository interface { Get(curl *charm.URL, archivePath string) (*charm.CharmArchive, error) ResolveWithPreferredChannel(*charm.URL, csparams.Channel) (*charm.URL, csparams.Channel, []string, error) }
CSRepository is the part of charmrepo.Charmstore that we need to resolve a charm url, install or upgrade a charm store charm.
type CSResolverGetterFunc ¶
type CSResolverGetterFunc func(args ResolverGetterParams) (CSRepository, error)
type CharmArchive ¶
type CharmArchive struct { // ID is the charm URL for which we're storing the archive. ID *charm.URL // Charm is the metadata about the charm for the archive. Charm charm.Charm // Data contains the bytes of the archive. Data io.Reader // Size is the number of bytes in Data. Size int64 // SHA256 is the hash of the bytes in Data. SHA256 string // Macaroon is the authorization macaroon for accessing the charmstore. Macaroon macaroon.Slice // Charm Version contains semantic version of charm, typically the output of git describe. CharmVersion string }
CharmArchive is the data that needs to be stored for a charm archive in state.
type CharmHubClient ¶
type CharmHubClient interface { DownloadAndRead(ctx context.Context, resourceURL *url.URL, archivePath string) (*charm.CharmArchive, error) Info(ctx context.Context, name string) (transport.InfoResponse, error) Refresh(ctx context.Context, config charmhub.RefreshConfig) ([]transport.RefreshResponse, error) }
CharmHubClient represents the methods required of a client to install or upgrade a CharmHub charm.
type ResolverGetterParams ¶
type StoreCharm ¶
type StoreCharm interface { charm.Charm charm.LXDProfiler Version() string }
StoreCharm represents a store charm.
type Strategy ¶
type Strategy interface { CharmURL() *charm.URL Finish() error Run(corecharm.State, corecharm.JujuVersionValidator, corecharm.Origin) (corecharm.DownloadResult, bool, corecharm.Origin, error) Validate() error }
Strategy represents a core charm Strategy
type StrategyFunc ¶
Directories
Path | Synopsis |
---|---|
interfaces | |
mocks | Package mocks is a generated GoMock package. |