Documentation
¶
Overview ¶
Package configrefs holds the rules for references among a configuration's entities as entities change: what an existing reference names afterwards and how it is written. The console's edits (x/admin/configapp) and plans (x/configplan) apply the same rules, each over its own representation.
The rule: a reference keeps naming the entity it named before the change, in its shortest unambiguous form when it no longer names it alone; a reference to a removed entity goes; one that named no single entity before stays as it was.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterFields ¶
FilterFields lists the fields a row filter (decoded YAML or JSON) names: a condition {op, field, value} names its field, and an and/or names those of its items.
func Retarget ¶
Retarget is what the existing reference ref becomes once the entities changed from before to after; moved maps the IDs of renamed or moved entities to their new IDs, and of removed ones to "" (needed when another entity takes over the ID). keep is false when ref named an entity that is gone: the reference goes with it.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index resolves references among a set of entities.
func NewIndex ¶
func NewIndex(entities []config.EntityConfig) Index
NewIndex indexes entities; only their names, datasources and schemas matter.