life

package
v0.0.0-...-c116a84 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 1 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlive

func IsAlive(v Value) bool

IsAlive is a Predicate that returns true if the supplied value is Alive.

This generally indicates that the entity in question is expected to be existing for now and not going away or gone completely.

func IsDead

func IsDead(v Value) bool

IsDead is a Predicate that returns true if the supplied value is Dead.

This indicates that the entity in question is dead.

func IsNotAlive

func IsNotAlive(v Value) bool

IsNotAlive is a Predicate that returns true if the supplied value is not Alive.

This generally indicates that the entity in question is at some stage of destruction/cleanup.

func IsNotDead

func IsNotDead(v Value) bool

IsNotDead is a Predicate that returns true if the supplied value is not Dead.

This generally indicates that the entity in question is active in some way, and can probably not be completely destroyed without consequences.

Types

type Predicate

type Predicate func(Value) bool

Predicate is a predicate.

type Value

type Value string

Value indicates the state of some entity.

const (
	// Alive indicates that some entity is meant to exist.
	Alive Value = "alive"

	// Dying indicates that some entity should be removed.
	Dying Value = "dying"

	// Dead indicates that some entity is no longer useful,
	// and can be destroyed unconditionally.
	Dead Value = "dead"
)

func (Value) Validate

func (v Value) Validate() error

Validate returns an error if the value is not known.

Jump to

Keyboard shortcuts

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