Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	base.ClientFacade
	// contains filtered or unexported fields
}

Client provides access to the crossmodelrelations api facade.

func NewClient

func NewClient(caller base.APICallCloser) *Client

NewClient creates a new client-side CrossModelRelations facade.

func NewClientWithCache

func NewClientWithCache(caller base.APICallCloser, cache *MacaroonCache) *Client

NewClientWithCache creates a new client-side CrossModelRelations facade with the specified cache.

func (*Client) PublishIngressNetworkChange

func (c *Client) PublishIngressNetworkChange(change params.IngressNetworksChangeEvent) error

func (*Client) PublishRelationChange

func (c *Client) PublishRelationChange(change params.RemoteRelationChangeEvent) error

PublishRelationChange publishes relation changes to the model hosting the remote application involved in the relation.

func (*Client) RegisterRemoteRelations

func (c *Client) RegisterRemoteRelations(relations ...params.RegisterRemoteRelationArg) ([]params.RegisterRemoteRelationResult, error)

RegisterRemoteRelations sets up the remote model to participate in the specified relations.

func (*Client) WatchEgressAddressesForRelation

func (c *Client) WatchEgressAddressesForRelation(remoteRelationArg params.RemoteEntityArg) (watcher.StringsWatcher, error)

WatchEgressAddressesForRelation returns a watcher that notifies when addresses, from which connections will originate to the offering side of the relation, change. Each event contains the entire set of addresses which the offering side is required to allow for access to the other side of the relation.

func (*Client) WatchOfferStatus

func (c *Client) WatchOfferStatus(arg params.OfferArg) (watcher.OfferStatusWatcher, error)

WatchOfferStatus starts an OfferStatusWatcher for watching the status of the specified offer in the remote model.

func (*Client) WatchRelationChanges

func (c *Client) WatchRelationChanges(relationToken, applicationToken string, macs macaroon.Slice) (apiwatcher.RemoteRelationWatcher, error)

WatchRelationChanges returns a watcher that notifies of changes to the units or application settings in the remote model for the relation with the given remote token.

func (*Client) WatchRelationSuspendedStatus

func (c *Client) WatchRelationSuspendedStatus(arg params.RemoteEntityArg) (watcher.RelationStatusWatcher, error)

WatchRelationSuspendedStatus starts a RelationStatusWatcher for watching the life and suspended status of the specified relation in the remote model.

type MacaroonCache

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

MacaroonCache contains macaroons which are removed at a specified interval.

func NewMacaroonCache

func NewMacaroonCache(clock clock.Clock) *MacaroonCache

NewMacaroonCache returns a cache containing macaroons which are removed after the macaroons' expiry time.

func (MacaroonCache) Get

func (c MacaroonCache) Get(k string) (macaroon.Slice, bool)

Get returns a macaroon slice from the cache, and a bool indicating if the slice for the key was found.

func (MacaroonCache) Upsert

func (c MacaroonCache) Upsert(token string, ms macaroon.Slice)

Upsert inserts or updates a macaroon slice in the cache.