crossmodel

package
v0.0.0-...-a0d7459 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddApplicationOfferArgs

type AddApplicationOfferArgs struct {
	// OfferName is the name of the offer.
	OfferName string

	// ApplicationName is the name of the application to which the offer pertains.
	ApplicationName string

	// ApplicationDescription is a description of the application's functionality,
	// typically copied from the charm metadata.
	ApplicationDescription string

	// Endpoints is the collection of endpoint names offered (internal->published).
	// The map allows for advertised endpoint names to be aliased.
	Endpoints map[string]string

	// Icon is an icon to display when browsing the ApplicationOffers, which by default
	// comes from the charm.
	Icon []byte
}

AddApplicationOfferArgs contain parameters used to create an application offer.

type ApplicationOffer

type ApplicationOffer struct {
	// OfferName is the name of the offer.
	OfferName string

	// ApplicationName is the name of the application to which the offer pertains.
	ApplicationName string

	// ApplicationDescription is a description of the application's functionality,
	// typically copied from the charm metadata.
	ApplicationDescription string

	// Endpoints is the collection of endpoint names offered (internal->published).
	// The map allows for advertised endpoint names to be aliased.
	Endpoints map[string]charm.Relation
}

ApplicationOffer holds the details of an application offered by this model.

func (*ApplicationOffer) String

func (s *ApplicationOffer) String() string

String returns the offered application name.

type ApplicationOfferDetails

type ApplicationOfferDetails struct {
	// OfferName is the name of the offer
	OfferName string

	// ApplicationName is the application name to which the offer pertains.
	ApplicationName string

	// OfferURL is the URL where the offer can be located.
	OfferURL string

	// CharmName is a name of a charm for remote application.
	CharmName string

	// Endpoints are the charm endpoints supported by the application.
	// TODO(wallyworld) - do not use charm.Relation here
	Endpoints []charm.Relation

	// ConnectedCount are the number of users that are consuming the application.
	ConnectedCount int
}

ApplicationOfferDetails represents a remote application used when vendor lists their own applications.

type ApplicationOfferDetailsResult

type ApplicationOfferDetailsResult struct {
	// Result contains remote application information.
	Result *ApplicationOfferDetails

	// Error contains error related to this item.
	Error error
}

ApplicationOfferDetailsResult is a result of listing a remote application.

type ApplicationOfferFilter

type ApplicationOfferFilter struct {
	// OfferName is the name of the model hosting the offer.
	ModelName string

	// OfferName is the name of the offer.
	OfferName string

	// ApplicationName is the name of the application to which the offer pertains.
	ApplicationName string

	// ApplicationDescription is a description of the application's functionality,
	// typically copied from the charm metadata.
	ApplicationDescription string

	// Endpoint contains an endpoint filter criteria.
	Endpoints []EndpointFilterTerm

	// AllowedUsers are the users allowed to consume the application.
	AllowedUsers []string
}

ApplicationOfferFilter is used to query applications offered by this model.

type ApplicationOffers

type ApplicationOffers interface {

	// AddOffer adds a new application offer to the directory.
	AddOffer(offer AddApplicationOfferArgs) (*ApplicationOffer, error)

	// UpdateOffer replaces an existing offer at the same URL.
	UpdateOffer(offer AddApplicationOfferArgs) (*ApplicationOffer, error)

	// ListOffers returns the offers satisfying the specified filter.
	ListOffers(filter ...ApplicationOfferFilter) ([]ApplicationOffer, error)

	// Remove removes the application offer at the specified URL.
	Remove(offerName string) error
}

An ApplicationOffers instance holds application offers from a model.

type ApplicationURL

type ApplicationURL struct {
	// Source represents where the offer is hosted.
	// If empty, the model is another model in the same controller.
	Source string // "<controller-name>" or "<jaas>" or ""

	// User is the user whose namespace in which the offer is made.
	// Where a model is specified, the user is the model owner.
	User string

	// ModelName is the name of the model providing the exported endpoints.
	// It is only used for local URLs or for specifying models in the same
	// controller.
	ModelName string

	// ApplicationName is the name of the application providing the exported endpoints.
	ApplicationName string
}

ApplicationURL represents the location of an offered application and its associated exported endpoints.

func ParseApplicationURL

func ParseApplicationURL(urlStr string) (*ApplicationURL, error)

ParseApplicationURL parses the specified URL string into an ApplicationURL. The URL string is of one of the forms:

<model-name>.<application-name>
<model-name>.<application-name>:<relation-name>
<user>/<model-name>.<application-name>
<user>/<model-name>.<application-name>:<relation-name>
<controller>:<user>/<model-name>.<application-name>
<controller>:<user>/<model-name>.<application-name>:<relation-name>

func (*ApplicationURL) HasEndpoint

func (u *ApplicationURL) HasEndpoint() bool

HasEndpoint returns whether this application URL includes an endpoint name in the application name.

func (*ApplicationURL) Path

func (u *ApplicationURL) Path() string

Path returns the path component of the URL.

func (*ApplicationURL) String

func (u *ApplicationURL) String() string

type ApplicationURLParts

type ApplicationURLParts ApplicationURL

ApplicationURLParts contains various attributes of a URL.

func ParseApplicationURLParts

func ParseApplicationURLParts(urlStr string) (*ApplicationURLParts, error)

ParseApplicationURLParts parses a partial URL, filling out what parts are supplied. This method is used to generate a filter used to query matching application URLs.

type EndpointFilterTerm

type EndpointFilterTerm struct {
	// Name is an endpoint name.
	Name string

	// Interface is an endpoint interface.
	Interface string

	// Role is an endpoint role.
	Role charm.RelationRole
}

EndpointFilterTerm represents a remote endpoint filter.

type RemoteApplication

type RemoteApplication struct {
	ApplicationOffer

	// ConnectedUsers are the users that are consuming the application.
	ConnectedUsers []string
}

RemoteApplication represents a remote application.

Jump to

Keyboard shortcuts

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