relation

package
v0.0.0-...-1f8c1e5 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: AGPL-3.0 Imports: 3 Imported by: 1

Documentation

Overview

Package relation provides the domain types for application relations. The relation domain is the primary domain for creation and handling of a relation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	ApplicationID application.ID
	charm.Relation
}

Endpoint represents one endpoint of a relation.

type EndpointRelationData

type EndpointRelationData struct {
	// RelationID is the integer internal relation key used by relation hooks
	// to identify a relation.
	RelationID int
	// Endpoint is the name of the endpoint defined in the current application.
	Endpoint string
	// RelatedEndpoint is the name of the endpoint defined in the counterpart application.
	RelatedEndpoint string
	// ApplicationData are the settings for the relation and current application,
	// set by the leader unit.
	ApplicationData map[string]interface{}
	// UnitRelationData are the settings for the relation and current unit,
	// set by an individual unit.
	UnitRelationData map[string]RelationData
}

EndpointRelationData holds information about a relation to a given endpoint.

type RelationData

type RelationData struct {
	// InScope returns a boolean to indicate whether this unit has successfully
	// joined the relation.
	InScope bool
	// UnitData are the settings for the relation and current unit,
	// set by an individual unit.
	UnitData map[string]interface{} // unit settings
}

RelationData holds information about a unit's relation.

type RelationScopeWatcher

type RelationScopeWatcher struct {
	Watcher
}

RelationScopeWatcher observes changes to the set of units in a particular relation scope.

type RelationUnitsWatcher

type RelationUnitsWatcher interface {
	Watcher

	Changes() corewatcher.RelationUnitsChannel
}

RelationUnitsWatcher generates signals when units enter or leave the scope of a RelationUnit, and changes to the settings of those units known to have entered.

type Watcher

type Watcher interface {
	// Kill asks the watcher to stop without waiting for it do so.
	Kill()
	// Wait waits for the watcher to die and returns any
	// error encountered when it was running.
	Wait() error
	// Stop kills the watcher, then waits for it to die.
	Stop() error
	// Err returns any error encountered while the watcher
	// has been running.
	Err() error
}

Watcher is implemented by all watchers; the actual changes channel is returned by a watcher-specific Changes method.

Directories

Path Synopsis
Package service provides the service methods for the relation domain.
Package service provides the service methods for the relation domain.
Package state provides the state methods used by the relation service for its domain.
Package state provides the state methods used by the relation service for its domain.

Jump to

Keyboard shortcuts

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