entity

package
v0.7.65 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 5

Documentation

Index

Constants

View Source
const (
	ErrUpdateEntityStatusCode = "meshkit-11243"
)

Variables

This section is empty.

Functions

func ErrUpdateEntityStatus

func ErrUpdateEntityStatus(err error, entity string, status EntityStatus) error

Types

type Entity

type Entity interface {
	// Entity is referred as any type of schema managed by the registry
	// ComponentDefinitions and PolicyDefinitions are examples of entities
	Type() EntityType
	GetEntityDetail() string
	GenerateID() (uuid.UUID, error)
	GetID() uuid.UUID
	Create(db *database.Handler, hostID uuid.UUID) (entityID uuid.UUID, err error)
}

type EntityStatus

type EntityStatus string
const (
	Ignored   EntityStatus = "ignored"
	Enabled   EntityStatus = "enabled"
	Duplicate EntityStatus = "duplicate"
)

type EntityType

type EntityType string
const (
	ComponentDefinition    EntityType = "component"
	PolicyDefinition       EntityType = "policy"
	RelationshipDefinition EntityType = "relationship"
	Model                  EntityType = "model"
	Category               EntityType = "category"
)

type Filter

type Filter interface {
	Create(map[string]interface{})
	Get(db *database.Handler) (entities []Entity, count int64, unique int, err error)
	GetById(db *database.Handler) (entity Entity, err error)
}

Each entity will have it's own Filter implementation via which it exposes the nobs and dials to fetch entities

type Status

type Status interface {
	UpdateStatus(db *database.Handler, status EntityStatus) error
}

Jump to

Keyboard shortcuts

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