util

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEntityDependencyGraph

func BuildEntityDependencyGraph(
	entities map[string]parser.Entity,
	relationships map[string]parser.Relationship,
	preventCycles bool,
) (graph.Graph[string, string], error)

BuildEntityDependencyGraph creates a directed graph of entity dependencies based on the relationships in the SOR definition. This shared utility is used by both the CSV generator and ER diagram generator.

func CleanNameForFilename

func CleanNameForFilename(name string) string

CleanNameForFilename creates a filesystem-safe name from a display name

func GetTopologicalOrder

func GetTopologicalOrder(entityGraph graph.Graph[string, string]) ([]string, error)

GetTopologicalOrder returns a topologically sorted list of entity IDs Entities will be sorted such that if entity A depends on entity B, entity B will appear earlier in the list.

func ParseEntityAttribute

func ParseEntityAttribute(
	entities map[string]parser.Entity,
	attributeRef string,
	attributeAliasMap map[string]struct {
		EntityID      string
		AttributeName string
		UniqueID      bool
	},
	entityAttributeMap map[string]struct {
		EntityID      string
		AttributeName string
		UniqueID      bool
	},
) (entityID string, attrName string, uniqueID bool)

ParseEntityAttribute is a helper function to extract entity and attribute info from a reference Public version of parseEntityAttribute that can be used across packages

Types

This section is empty.

Jump to

Keyboard shortcuts

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