relation

package
v0.0.0-...-e95c5b7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CounterpartRole

func CounterpartRole(r charm.RelationRole) charm.RelationRole

CounterpartRole returns the RelationRole that this RelationRole can relate to. This should remain an internal method because the relation model does not guarantee that for every role there will necessarily exist a single counterpart role that is sensible for basing algorithms upon.

func NaturalKey

func NaturalKey(endpoints []Endpoint) string

NaturalKey generates a unique sorted string representation of relation endpoints based on their roles and identifiers. It can be used as a natural key for relations.

Types

type Endpoint

type Endpoint struct {
	ApplicationName string
	charm.Relation
}

Endpoint represents one endpoint of a relation.

func (Endpoint) CanRelateTo

func (ep Endpoint) CanRelateTo(other Endpoint) bool

CanRelateTo returns whether a relation may be established between e and other.

func (Endpoint) String

func (ep Endpoint) String() string

String returns the unique identifier of the relation endpoint.

Jump to

Keyboard shortcuts

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