relation

package
v0.0.0-...-dda4347 Latest Latest
Warning

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

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

Documentation

Overview

Package relation provides core types that can be used for interacting with relations.

A relation is a pair of application endpoints. A peer relation is a single application endpoint where all units of an application are related to each other.

RelationUnit holds information about a single unit in a relation.

See the domain/relation for more details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Status

type Status string

Status describes the status of a relation.

const (
	// Joined is the normal status for a healthy, alive relation.
	Joined Status = "joined"

	// Broken is the status for when a relation life goes to Dead.
	Broken Status = "broken"

	// Suspended is used to signify that a relation is temporarily broken pending
	// action to resume it.
	Suspended Status = "suspended"

	// Error is used to signify that the relation is in an error state.
	Error Status = "error"
)

func (Status) String

func (s Status) String() string

type UUID

type UUID string

UUID represents a relation unique identifier.

func NewUUID

func NewUUID() (UUID, error)

NewUUID is a convince function for generating a new relation uuid.

func ParseUUID

func ParseUUID(value string) (UUID, error)

ParseUUID returns a new UUID from the given string. If the string is not a valid uuid an error satisfying errors.NotValid will be returned.

func (UUID) String

func (u UUID) String() string

String implements the stringer interface for UUID.

func (UUID) Validate

func (u UUID) Validate() error

Validate ensures the consistency of the UUID. If the uuid is invalid an error satisfying errors.NotValid will be returned.

type UnitUUID

type UnitUUID string

UnitUUID represents a relation unit unique identifier.

func NewUnitUUID

func NewUnitUUID() (UnitUUID, error)

NewUnitUUID is a convince function for generating a new relation unit uuid.

func ParseUnitUUID

func ParseUnitUUID(value string) (UnitUUID, error)

UnitUUID returns a new UUID from the given string. If the string is not a valid uuid an error satisfying errors.NotValid will be returned.

func (UnitUUID) String

func (u UnitUUID) String() string

String implements the stringer interface for UUID.

func (UnitUUID) Validate

func (u UnitUUID) Validate() error

Validate ensures the consistency of the UUID. If the uuid is invalid an error satisfying errors.NotValid will be returned.

Jump to

Keyboard shortcuts

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