entity

package
v2.40.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateEntities

func ActivateEntities(collection Collection, conf *config.Configuration, log *zerolog.Logger) error

ActivateEntities activates the given entities.

func GetIDs

func GetIDs(collection Collection) []string

GetIDs gets a list of entity IDs.

func GetNames

func GetNames(collection Collection) []string

GetNames gets a list of entity names.

Types

type Collection

type Collection interface {
	// Entities returns a vector of entities within the collection.
	Entities() []Entity
}

Collection is an interface for entity collections.

type Entity

type Entity interface {
	// GetID returns the ID of the entity.
	GetID() string
	// GetName returns the display name of the entity.
	GetName() string

	// Activate activates the entity.
	Activate(conf *config.Configuration, log *zerolog.Logger) error
}

Entity is the base interface for all Mentix entities.

type Registry

type Registry struct {
	Entities map[string]Entity
}

Registry represents a simple id->entity map.

func NewRegistry

func NewRegistry() *Registry

NewRegistry returns a new entity registry.

func (*Registry) FindEntities

func (r *Registry) FindEntities(ids []string, mustExist bool, anyRequired bool) ([]Entity, error)

FindEntities returns all entities matching the provided IDs. If an entity with a certain ID doesn't exist and mustExist is true, an error is returned.

func (*Registry) Register

func (r *Registry) Register(entity Entity)

Register registers a new entity.

Jump to

Keyboard shortcuts

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