model

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: 10 Imported by: 0

Documentation

Overview

Package model is a generated GoMock package.

Index

Constants

View Source
const (
	OneToOne  = "1:1"
	OneToMany = "1:N"
	ManyToOne = "N:1"
)

Cardinality constants

Variables

View Source
var (
	ErrNilYAMLModel         = errors.New("YAML model cannot be nil")
	ErrNoEntities           = errors.New("YAML model must contain at least one entity")
	ErrEntityNotFound       = errors.New("entity not found")
	ErrRelationshipNotFound = errors.New("relationship not found")
	ErrCircularDependency   = errors.New("circular dependency detected in entity relationships")
	ErrInvalidRelationship  = errors.New("invalid relationship definition")
)

Error definitions for Graph operations

View Source
var ErrSkipRow = errors.New("skip row - do not re-add")

ErrSkipRow signals ForEachRow to skip re-adding the current row Used to efficiently remove duplicate rows without expensive RemoveRow calls

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	// contains filtered or unexported fields
}

Attribute represents an entity attribute and its properties

func (*Attribute) GetAttributeAlias

func (a *Attribute) GetAttributeAlias() string

GetAttributeAlias returns the attribute's external ID

func (*Attribute) GetDataType

func (a *Attribute) GetDataType() string

GetDataType returns the attribute's data type

func (*Attribute) GetExternalID

func (a *Attribute) GetExternalID() string

GetExternalID returns the attribute's external ID

func (*Attribute) GetName

func (a *Attribute) GetName() string

GetName returns the attribute name

func (*Attribute) GetParentEntity

func (a *Attribute) GetParentEntity() EntityInterface

GetParentEntity returns the parent entity this attribute belongs to

func (*Attribute) GetRelatedAttribute

func (a *Attribute) GetRelatedAttribute() string

GetRelatedAttribute returns the related attribute name if part of a relationship

func (*Attribute) GetRelatedEntityID

func (a *Attribute) GetRelatedEntityID() string

GetRelatedEntityID returns the related entity ID if part of a relationship

func (*Attribute) IsRelationship

func (a *Attribute) IsRelationship() bool

IsRelationship returns whether attribute is part of a relationship

func (*Attribute) IsUnique

func (a *Attribute) IsUnique() bool

IsUnique returns whether attribute requires unique values

type AttributeInterface

type AttributeInterface interface {
	GetName() string
	GetExternalID() string
	GetAttributeAlias() string
	GetDataType() string
	IsUnique() bool
	IsRelationship() bool
	GetParentEntity() EntityInterface
	GetRelatedEntityID() string
	GetRelatedAttribute() string
	// contains filtered or unexported methods
}

AttributeInterface defines operations for attributes

type CSVData

type CSVData struct {
	ExternalId  string
	Headers     []string
	Rows        [][]string
	EntityName  string
	Description string
}

CSVData represents a structure to hold data for CSV file generation

type Entity

type Entity struct {
	// contains filtered or unexported fields
}

Entity represents a data entity and manages its attributes and row data

func (*Entity) AddRow

func (e *Entity) AddRow(row *Row) error

AddRow adds a new row with provided values Validates uniqueness constraint for primary key Validates foreign key values exist in related entities

func (*Entity) CheckKeyExists

func (e *Entity) CheckKeyExists(keyValue string) bool

CheckKeyExists checks if a key value exists in the used primary key values (O(1) lookup)

func (*Entity) ForEachRow

func (e *Entity) ForEachRow(fn func(row *Row, index int) error) error

ForEachRow iterates over all rows and allows in-place modification Validates PK uniqueness only if PK value changes (performance optimization) Returns ErrSkipRow from callback to skip including a row in the result

func (*Entity) GetAttribute

func (e *Entity) GetAttribute(name string) (AttributeInterface, bool)

GetAttribute gets an attribute by name with existence check

func (*Entity) GetAttributeByExternalID

func (e *Entity) GetAttributeByExternalID(externalID string) (AttributeInterface, bool)

GetAttributeByExternalID gets an attribute by its external ID

func (*Entity) GetAttributes

func (e *Entity) GetAttributes() []AttributeInterface

GetAttributes returns all attributes in order

func (*Entity) GetDescription

func (e *Entity) GetDescription() string

GetDescription returns entity's description

func (*Entity) GetExternalID

func (e *Entity) GetExternalID() string

GetExternalID returns entity's external ID (used for CSV filenames)

func (*Entity) GetID

func (e *Entity) GetID() string

GetID returns entity's internal ID

func (*Entity) GetName

func (e *Entity) GetName() string

GetName returns entity's display name

func (*Entity) GetNonRelationshipAttributes

func (e *Entity) GetNonRelationshipAttributes() []AttributeInterface

GetNonRelationshipAttributes returns attributes not involved in relationships

func (*Entity) GetNonUniqueAttributes

func (e *Entity) GetNonUniqueAttributes() []AttributeInterface

GetNonUniqueAttributes returns attributes not marked as unique

func (*Entity) GetPrimaryKey

func (e *Entity) GetPrimaryKey() AttributeInterface

GetPrimaryKey returns the single unique attribute that serves as primary key

func (*Entity) GetRelationshipAttributes

func (e *Entity) GetRelationshipAttributes() []AttributeInterface

GetRelationshipAttributes returns attributes involved in relationships

func (*Entity) GetRowByIndex

func (e *Entity) GetRowByIndex(index int) *Row

GetRowByIndex returns a row by index for direct access (O(1) operation)

func (*Entity) GetRowCount

func (e *Entity) GetRowCount() int

GetRowCount returns the number of rows

func (*Entity) IsCompositeKeyRegistered added in v0.1.14

func (e *Entity) IsCompositeKeyRegistered(row *Row) bool

IsCompositeKeyRegistered checks if a row's composite key was already registered Used by ForEachRow to detect duplicates after fn() modifies the row

func (*Entity) IsForeignKeyUnique

func (e *Entity) IsForeignKeyUnique(row *Row) bool

IsForeignKeyUnique checks if a row's FK combination is unique Returns true if unique, false if duplicate. Caller decides when to use this.

func (*Entity) RegisterCompositeKey added in v0.1.14

func (e *Entity) RegisterCompositeKey(row *Row)

RegisterCompositeKey registers a row's composite key for duplicate detection Should be called by relationship_linker after ALL FK values have been set

func (*Entity) RemoveRow

func (e *Entity) RemoveRow(rowIndex int) error

RemoveRow removes a row from the entity and updates hash maps

func (*Entity) ToCSV

func (e *Entity) ToCSV() *CSVData

ToCSV returns CSV representation of the entity

func (*Entity) ValidateAllForeignKeys

func (e *Entity) ValidateAllForeignKeys() []string

ValidateAllForeignKeys validates all FK relationships for this entity (post-generation validation)

type EntityInterface

type EntityInterface interface {
	GetID() string
	GetExternalID() string
	GetName() string
	GetDescription() string
	GetAttributes() []AttributeInterface
	GetAttribute(name string) (AttributeInterface, bool)
	GetAttributeByExternalID(externalID string) (AttributeInterface, bool)
	GetPrimaryKey() AttributeInterface
	GetNonUniqueAttributes() []AttributeInterface
	GetRelationshipAttributes() []AttributeInterface
	GetNonRelationshipAttributes() []AttributeInterface
	GetRowCount() int
	AddRow(row *Row) error
	ForEachRow(fn func(row *Row, index int) error) error
	ToCSV() *CSVData

	// Post-generation validation
	ValidateAllForeignKeys() []string

	// Performance optimizations
	GetRowByIndex(index int) *Row        // Direct row access by index (O(1))
	CheckKeyExists(keyValue string) bool // O(1) primary key existence check

	// Junction table duplicate prevention
	IsForeignKeyUnique(row *Row) bool       // Check if row's FK combination is unique for junction tables
	RemoveRow(rowIndex int) error           // Remove row and update hash maps
	RegisterCompositeKey(row *Row)          // Register composite key after all FKs set (for duplicate detection)
	IsCompositeKeyRegistered(row *Row) bool // Check if composite key already registered
	// contains filtered or unexported methods
}

EntityInterface defines the operations that can be performed on an Entity

type Graph

type Graph struct {
	// contains filtered or unexported fields
}

Graph represents the overall model including entities and relationships

func (*Graph) GetAllEntities

func (g *Graph) GetAllEntities() map[string]EntityInterface

GetAllEntities returns all entities in the graph

func (*Graph) GetAllRelationships

func (g *Graph) GetAllRelationships() []RelationshipInterface

GetAllRelationships returns all relationships in the graph

func (*Graph) GetEntitiesList

func (g *Graph) GetEntitiesList() []EntityInterface

GetEntitiesList returns a slice of all entities in the graph

func (*Graph) GetEntity

func (g *Graph) GetEntity(id string) (EntityInterface, bool)

GetEntity gets an entity by ID with existence check

func (*Graph) GetExpectedDataVolume

func (g *Graph) GetExpectedDataVolume() int

GetExpectedDataVolume returns the expected number of rows per entity for memory optimization

func (*Graph) GetRelationship

func (g *Graph) GetRelationship(id string) (RelationshipInterface, bool)

GetRelationship gets a relationship by ID with existence check

func (*Graph) GetRelationshipsForEntity

func (g *Graph) GetRelationshipsForEntity(entityID string) []RelationshipInterface

GetRelationshipsForEntity returns all relationships that involve a specific entity

func (*Graph) GetStatistics

func (g *Graph) GetStatistics() *GraphStatistics

GetStatistics returns comprehensive statistics about the graph

func (*Graph) GetTopologicalOrder

func (g *Graph) GetTopologicalOrder() ([]string, error)

GetTopologicalOrder returns entities in dependency order for generation

type GraphInterface

type GraphInterface interface {
	GetEntity(id string) (EntityInterface, bool)
	GetAllEntities() map[string]EntityInterface
	GetEntitiesList() []EntityInterface
	GetRelationship(id string) (RelationshipInterface, bool)
	GetAllRelationships() []RelationshipInterface
	GetRelationshipsForEntity(entityID string) []RelationshipInterface
	GetTopologicalOrder() ([]string, error)
	GetExpectedDataVolume() int // For memory optimization
	// contains filtered or unexported methods
}

GraphInterface defines the operations that can be performed on a Graph

func NewGraph

func NewGraph(yamlModel *parser.SORDefinition, dataVolume int) (GraphInterface, error)

NewGraph creates a new Graph from the YAML model Following our four-step constructor pattern: 1. Object creation - Initialize the Graph with empty maps and lists 2. Validation - Validate the YAML model is not nil and has required elements 3. Setup - Create entities and relationships from YAML 4. Business logic - Validate graph integrity and build indexes

type GraphStatistics

type GraphStatistics struct {
	SORName                string
	Description            string
	EntityCount            int
	TotalAttributes        int
	UniqueAttributes       int
	IndexedAttributes      int
	ListAttributes         int
	RelationshipCount      int
	DirectRelationships    int
	PathBasedRelationships int
	NamespaceFormats       map[string]int
}

GraphStatistics contains statistical information about a parsed graph

type MockAttributeInterface

type MockAttributeInterface struct {
	// contains filtered or unexported fields
}

MockAttributeInterface is a mock of AttributeInterface interface.

func NewMockAttributeInterface

func NewMockAttributeInterface(ctrl *gomock.Controller) *MockAttributeInterface

NewMockAttributeInterface creates a new mock instance.

func (*MockAttributeInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockAttributeInterface) GetAttributeAlias

func (m *MockAttributeInterface) GetAttributeAlias() string

GetAttributeAlias mocks base method.

func (*MockAttributeInterface) GetDataType

func (m *MockAttributeInterface) GetDataType() string

GetDataType mocks base method.

func (*MockAttributeInterface) GetExternalID

func (m *MockAttributeInterface) GetExternalID() string

GetExternalID mocks base method.

func (*MockAttributeInterface) GetName

func (m *MockAttributeInterface) GetName() string

GetName mocks base method.

func (*MockAttributeInterface) GetParentEntity

func (m *MockAttributeInterface) GetParentEntity() EntityInterface

GetParentEntity mocks base method.

func (*MockAttributeInterface) GetRelatedAttribute

func (m *MockAttributeInterface) GetRelatedAttribute() string

GetRelatedAttribute mocks base method.

func (*MockAttributeInterface) GetRelatedEntityID

func (m *MockAttributeInterface) GetRelatedEntityID() string

GetRelatedEntityID mocks base method.

func (*MockAttributeInterface) IsRelationship

func (m *MockAttributeInterface) IsRelationship() bool

IsRelationship mocks base method.

func (*MockAttributeInterface) IsUnique

func (m *MockAttributeInterface) IsUnique() bool

IsUnique mocks base method.

type MockAttributeInterfaceMockRecorder

type MockAttributeInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockAttributeInterfaceMockRecorder is the mock recorder for MockAttributeInterface.

func (*MockAttributeInterfaceMockRecorder) GetAttributeAlias

func (mr *MockAttributeInterfaceMockRecorder) GetAttributeAlias() *gomock.Call

GetAttributeAlias indicates an expected call of GetAttributeAlias.

func (*MockAttributeInterfaceMockRecorder) GetDataType

func (mr *MockAttributeInterfaceMockRecorder) GetDataType() *gomock.Call

GetDataType indicates an expected call of GetDataType.

func (*MockAttributeInterfaceMockRecorder) GetExternalID

func (mr *MockAttributeInterfaceMockRecorder) GetExternalID() *gomock.Call

GetExternalID indicates an expected call of GetExternalID.

func (*MockAttributeInterfaceMockRecorder) GetName

GetName indicates an expected call of GetName.

func (*MockAttributeInterfaceMockRecorder) GetParentEntity

func (mr *MockAttributeInterfaceMockRecorder) GetParentEntity() *gomock.Call

GetParentEntity indicates an expected call of GetParentEntity.

func (*MockAttributeInterfaceMockRecorder) GetRelatedAttribute

func (mr *MockAttributeInterfaceMockRecorder) GetRelatedAttribute() *gomock.Call

GetRelatedAttribute indicates an expected call of GetRelatedAttribute.

func (*MockAttributeInterfaceMockRecorder) GetRelatedEntityID

func (mr *MockAttributeInterfaceMockRecorder) GetRelatedEntityID() *gomock.Call

GetRelatedEntityID indicates an expected call of GetRelatedEntityID.

func (*MockAttributeInterfaceMockRecorder) IsRelationship

func (mr *MockAttributeInterfaceMockRecorder) IsRelationship() *gomock.Call

IsRelationship indicates an expected call of IsRelationship.

func (*MockAttributeInterfaceMockRecorder) IsUnique

IsUnique indicates an expected call of IsUnique.

type MockEntityInterface

type MockEntityInterface struct {
	// contains filtered or unexported fields
}

MockEntityInterface is a mock of EntityInterface interface.

func NewMockEntityInterface

func NewMockEntityInterface(ctrl *gomock.Controller) *MockEntityInterface

NewMockEntityInterface creates a new mock instance.

func (*MockEntityInterface) AddRow

func (m *MockEntityInterface) AddRow(row *Row) error

AddRow mocks base method.

func (*MockEntityInterface) CheckKeyExists

func (m *MockEntityInterface) CheckKeyExists(keyValue string) bool

CheckKeyExists mocks base method.

func (*MockEntityInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockEntityInterface) ForEachRow

func (m *MockEntityInterface) ForEachRow(fn func(*Row, int) error) error

ForEachRow mocks base method.

func (*MockEntityInterface) GetAttribute

func (m *MockEntityInterface) GetAttribute(name string) (AttributeInterface, bool)

GetAttribute mocks base method.

func (*MockEntityInterface) GetAttributeByExternalID

func (m *MockEntityInterface) GetAttributeByExternalID(externalID string) (AttributeInterface, bool)

GetAttributeByExternalID mocks base method.

func (*MockEntityInterface) GetAttributes

func (m *MockEntityInterface) GetAttributes() []AttributeInterface

GetAttributes mocks base method.

func (*MockEntityInterface) GetDescription

func (m *MockEntityInterface) GetDescription() string

GetDescription mocks base method.

func (*MockEntityInterface) GetExternalID

func (m *MockEntityInterface) GetExternalID() string

GetExternalID mocks base method.

func (*MockEntityInterface) GetID

func (m *MockEntityInterface) GetID() string

GetID mocks base method.

func (*MockEntityInterface) GetName

func (m *MockEntityInterface) GetName() string

GetName mocks base method.

func (*MockEntityInterface) GetNonRelationshipAttributes

func (m *MockEntityInterface) GetNonRelationshipAttributes() []AttributeInterface

GetNonRelationshipAttributes mocks base method.

func (*MockEntityInterface) GetNonUniqueAttributes

func (m *MockEntityInterface) GetNonUniqueAttributes() []AttributeInterface

GetNonUniqueAttributes mocks base method.

func (*MockEntityInterface) GetPrimaryKey

func (m *MockEntityInterface) GetPrimaryKey() AttributeInterface

GetPrimaryKey mocks base method.

func (*MockEntityInterface) GetRelationshipAttributes

func (m *MockEntityInterface) GetRelationshipAttributes() []AttributeInterface

GetRelationshipAttributes mocks base method.

func (*MockEntityInterface) GetRowByIndex

func (m *MockEntityInterface) GetRowByIndex(index int) *Row

GetRowByIndex mocks base method.

func (*MockEntityInterface) GetRowCount

func (m *MockEntityInterface) GetRowCount() int

GetRowCount mocks base method.

func (*MockEntityInterface) IsCompositeKeyRegistered added in v0.1.14

func (m *MockEntityInterface) IsCompositeKeyRegistered(row *Row) bool

IsCompositeKeyRegistered mocks base method.

func (*MockEntityInterface) IsForeignKeyUnique

func (m *MockEntityInterface) IsForeignKeyUnique(row *Row) bool

IsForeignKeyUnique mocks base method.

func (*MockEntityInterface) RegisterCompositeKey added in v0.1.14

func (m *MockEntityInterface) RegisterCompositeKey(row *Row)

RegisterCompositeKey mocks base method.

func (*MockEntityInterface) RemoveRow

func (m *MockEntityInterface) RemoveRow(rowIndex int) error

RemoveRow mocks base method.

func (*MockEntityInterface) ToCSV

func (m *MockEntityInterface) ToCSV() *CSVData

ToCSV mocks base method.

func (*MockEntityInterface) ValidateAllForeignKeys

func (m *MockEntityInterface) ValidateAllForeignKeys() []string

ValidateAllForeignKeys mocks base method.

type MockEntityInterfaceMockRecorder

type MockEntityInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockEntityInterfaceMockRecorder is the mock recorder for MockEntityInterface.

func (*MockEntityInterfaceMockRecorder) AddRow

AddRow indicates an expected call of AddRow.

func (*MockEntityInterfaceMockRecorder) CheckKeyExists

func (mr *MockEntityInterfaceMockRecorder) CheckKeyExists(keyValue any) *gomock.Call

CheckKeyExists indicates an expected call of CheckKeyExists.

func (*MockEntityInterfaceMockRecorder) ForEachRow

func (mr *MockEntityInterfaceMockRecorder) ForEachRow(fn any) *gomock.Call

ForEachRow indicates an expected call of ForEachRow.

func (*MockEntityInterfaceMockRecorder) GetAttribute

func (mr *MockEntityInterfaceMockRecorder) GetAttribute(name any) *gomock.Call

GetAttribute indicates an expected call of GetAttribute.

func (*MockEntityInterfaceMockRecorder) GetAttributeByExternalID

func (mr *MockEntityInterfaceMockRecorder) GetAttributeByExternalID(externalID any) *gomock.Call

GetAttributeByExternalID indicates an expected call of GetAttributeByExternalID.

func (*MockEntityInterfaceMockRecorder) GetAttributes

func (mr *MockEntityInterfaceMockRecorder) GetAttributes() *gomock.Call

GetAttributes indicates an expected call of GetAttributes.

func (*MockEntityInterfaceMockRecorder) GetDescription

func (mr *MockEntityInterfaceMockRecorder) GetDescription() *gomock.Call

GetDescription indicates an expected call of GetDescription.

func (*MockEntityInterfaceMockRecorder) GetExternalID

func (mr *MockEntityInterfaceMockRecorder) GetExternalID() *gomock.Call

GetExternalID indicates an expected call of GetExternalID.

func (*MockEntityInterfaceMockRecorder) GetID

GetID indicates an expected call of GetID.

func (*MockEntityInterfaceMockRecorder) GetName

GetName indicates an expected call of GetName.

func (*MockEntityInterfaceMockRecorder) GetNonRelationshipAttributes

func (mr *MockEntityInterfaceMockRecorder) GetNonRelationshipAttributes() *gomock.Call

GetNonRelationshipAttributes indicates an expected call of GetNonRelationshipAttributes.

func (*MockEntityInterfaceMockRecorder) GetNonUniqueAttributes

func (mr *MockEntityInterfaceMockRecorder) GetNonUniqueAttributes() *gomock.Call

GetNonUniqueAttributes indicates an expected call of GetNonUniqueAttributes.

func (*MockEntityInterfaceMockRecorder) GetPrimaryKey

func (mr *MockEntityInterfaceMockRecorder) GetPrimaryKey() *gomock.Call

GetPrimaryKey indicates an expected call of GetPrimaryKey.

func (*MockEntityInterfaceMockRecorder) GetRelationshipAttributes

func (mr *MockEntityInterfaceMockRecorder) GetRelationshipAttributes() *gomock.Call

GetRelationshipAttributes indicates an expected call of GetRelationshipAttributes.

func (*MockEntityInterfaceMockRecorder) GetRowByIndex

func (mr *MockEntityInterfaceMockRecorder) GetRowByIndex(index any) *gomock.Call

GetRowByIndex indicates an expected call of GetRowByIndex.

func (*MockEntityInterfaceMockRecorder) GetRowCount

func (mr *MockEntityInterfaceMockRecorder) GetRowCount() *gomock.Call

GetRowCount indicates an expected call of GetRowCount.

func (*MockEntityInterfaceMockRecorder) IsCompositeKeyRegistered added in v0.1.14

func (mr *MockEntityInterfaceMockRecorder) IsCompositeKeyRegistered(row any) *gomock.Call

IsCompositeKeyRegistered indicates an expected call of IsCompositeKeyRegistered.

func (*MockEntityInterfaceMockRecorder) IsForeignKeyUnique

func (mr *MockEntityInterfaceMockRecorder) IsForeignKeyUnique(row any) *gomock.Call

IsForeignKeyUnique indicates an expected call of IsForeignKeyUnique.

func (*MockEntityInterfaceMockRecorder) RegisterCompositeKey added in v0.1.14

func (mr *MockEntityInterfaceMockRecorder) RegisterCompositeKey(row any) *gomock.Call

RegisterCompositeKey indicates an expected call of RegisterCompositeKey.

func (*MockEntityInterfaceMockRecorder) RemoveRow

func (mr *MockEntityInterfaceMockRecorder) RemoveRow(rowIndex any) *gomock.Call

RemoveRow indicates an expected call of RemoveRow.

func (*MockEntityInterfaceMockRecorder) ToCSV

ToCSV indicates an expected call of ToCSV.

func (*MockEntityInterfaceMockRecorder) ValidateAllForeignKeys

func (mr *MockEntityInterfaceMockRecorder) ValidateAllForeignKeys() *gomock.Call

ValidateAllForeignKeys indicates an expected call of ValidateAllForeignKeys.

type MockGraphInterface

type MockGraphInterface struct {
	// contains filtered or unexported fields
}

MockGraphInterface is a mock of GraphInterface interface.

func NewMockGraphInterface

func NewMockGraphInterface(ctrl *gomock.Controller) *MockGraphInterface

NewMockGraphInterface creates a new mock instance.

func (*MockGraphInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockGraphInterface) GetAllEntities

func (m *MockGraphInterface) GetAllEntities() map[string]EntityInterface

GetAllEntities mocks base method.

func (*MockGraphInterface) GetAllRelationships

func (m *MockGraphInterface) GetAllRelationships() []RelationshipInterface

GetAllRelationships mocks base method.

func (*MockGraphInterface) GetEntitiesList

func (m *MockGraphInterface) GetEntitiesList() []EntityInterface

GetEntitiesList mocks base method.

func (*MockGraphInterface) GetEntity

func (m *MockGraphInterface) GetEntity(id string) (EntityInterface, bool)

GetEntity mocks base method.

func (*MockGraphInterface) GetExpectedDataVolume

func (m *MockGraphInterface) GetExpectedDataVolume() int

GetExpectedDataVolume mocks base method.

func (*MockGraphInterface) GetRelationship

func (m *MockGraphInterface) GetRelationship(id string) (RelationshipInterface, bool)

GetRelationship mocks base method.

func (*MockGraphInterface) GetRelationshipsForEntity

func (m *MockGraphInterface) GetRelationshipsForEntity(entityID string) []RelationshipInterface

GetRelationshipsForEntity mocks base method.

func (*MockGraphInterface) GetTopologicalOrder

func (m *MockGraphInterface) GetTopologicalOrder() ([]string, error)

GetTopologicalOrder mocks base method.

type MockGraphInterfaceMockRecorder

type MockGraphInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockGraphInterfaceMockRecorder is the mock recorder for MockGraphInterface.

func (*MockGraphInterfaceMockRecorder) GetAllEntities

func (mr *MockGraphInterfaceMockRecorder) GetAllEntities() *gomock.Call

GetAllEntities indicates an expected call of GetAllEntities.

func (*MockGraphInterfaceMockRecorder) GetAllRelationships

func (mr *MockGraphInterfaceMockRecorder) GetAllRelationships() *gomock.Call

GetAllRelationships indicates an expected call of GetAllRelationships.

func (*MockGraphInterfaceMockRecorder) GetEntitiesList

func (mr *MockGraphInterfaceMockRecorder) GetEntitiesList() *gomock.Call

GetEntitiesList indicates an expected call of GetEntitiesList.

func (*MockGraphInterfaceMockRecorder) GetEntity

func (mr *MockGraphInterfaceMockRecorder) GetEntity(id any) *gomock.Call

GetEntity indicates an expected call of GetEntity.

func (*MockGraphInterfaceMockRecorder) GetExpectedDataVolume

func (mr *MockGraphInterfaceMockRecorder) GetExpectedDataVolume() *gomock.Call

GetExpectedDataVolume indicates an expected call of GetExpectedDataVolume.

func (*MockGraphInterfaceMockRecorder) GetRelationship

func (mr *MockGraphInterfaceMockRecorder) GetRelationship(id any) *gomock.Call

GetRelationship indicates an expected call of GetRelationship.

func (*MockGraphInterfaceMockRecorder) GetRelationshipsForEntity

func (mr *MockGraphInterfaceMockRecorder) GetRelationshipsForEntity(entityID any) *gomock.Call

GetRelationshipsForEntity indicates an expected call of GetRelationshipsForEntity.

func (*MockGraphInterfaceMockRecorder) GetTopologicalOrder

func (mr *MockGraphInterfaceMockRecorder) GetTopologicalOrder() *gomock.Call

GetTopologicalOrder indicates an expected call of GetTopologicalOrder.

type MockRelationshipInterface

type MockRelationshipInterface struct {
	// contains filtered or unexported fields
}

MockRelationshipInterface is a mock of RelationshipInterface interface.

func NewMockRelationshipInterface

func NewMockRelationshipInterface(ctrl *gomock.Controller) *MockRelationshipInterface

NewMockRelationshipInterface creates a new mock instance.

func (*MockRelationshipInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRelationshipInterface) GetCardinality

func (m *MockRelationshipInterface) GetCardinality() string

GetCardinality mocks base method.

func (*MockRelationshipInterface) GetID

func (m *MockRelationshipInterface) GetID() string

GetID mocks base method.

func (*MockRelationshipInterface) GetName

func (m *MockRelationshipInterface) GetName() string

GetName mocks base method.

func (*MockRelationshipInterface) GetSourceAttribute

func (m *MockRelationshipInterface) GetSourceAttribute() AttributeInterface

GetSourceAttribute mocks base method.

func (*MockRelationshipInterface) GetSourceEntity

func (m *MockRelationshipInterface) GetSourceEntity() EntityInterface

GetSourceEntity mocks base method.

func (*MockRelationshipInterface) GetTargetAttribute

func (m *MockRelationshipInterface) GetTargetAttribute() AttributeInterface

GetTargetAttribute mocks base method.

func (*MockRelationshipInterface) GetTargetEntity

func (m *MockRelationshipInterface) GetTargetEntity() EntityInterface

GetTargetEntity mocks base method.

func (*MockRelationshipInterface) GetTargetValueForSourceRow

func (m *MockRelationshipInterface) GetTargetValueForSourceRow(sourceRowIndex int, autoCardinality bool) (string, error)

GetTargetValueForSourceRow mocks base method.

func (*MockRelationshipInterface) IsManyToOne

func (m *MockRelationshipInterface) IsManyToOne() bool

IsManyToOne mocks base method.

func (*MockRelationshipInterface) IsOneToMany

func (m *MockRelationshipInterface) IsOneToMany() bool

IsOneToMany mocks base method.

func (*MockRelationshipInterface) IsOneToOne

func (m *MockRelationshipInterface) IsOneToOne() bool

IsOneToOne mocks base method.

type MockRelationshipInterfaceMockRecorder

type MockRelationshipInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockRelationshipInterfaceMockRecorder is the mock recorder for MockRelationshipInterface.

func (*MockRelationshipInterfaceMockRecorder) GetCardinality

func (mr *MockRelationshipInterfaceMockRecorder) GetCardinality() *gomock.Call

GetCardinality indicates an expected call of GetCardinality.

func (*MockRelationshipInterfaceMockRecorder) GetID

GetID indicates an expected call of GetID.

func (*MockRelationshipInterfaceMockRecorder) GetName

GetName indicates an expected call of GetName.

func (*MockRelationshipInterfaceMockRecorder) GetSourceAttribute

func (mr *MockRelationshipInterfaceMockRecorder) GetSourceAttribute() *gomock.Call

GetSourceAttribute indicates an expected call of GetSourceAttribute.

func (*MockRelationshipInterfaceMockRecorder) GetSourceEntity

func (mr *MockRelationshipInterfaceMockRecorder) GetSourceEntity() *gomock.Call

GetSourceEntity indicates an expected call of GetSourceEntity.

func (*MockRelationshipInterfaceMockRecorder) GetTargetAttribute

func (mr *MockRelationshipInterfaceMockRecorder) GetTargetAttribute() *gomock.Call

GetTargetAttribute indicates an expected call of GetTargetAttribute.

func (*MockRelationshipInterfaceMockRecorder) GetTargetEntity

func (mr *MockRelationshipInterfaceMockRecorder) GetTargetEntity() *gomock.Call

GetTargetEntity indicates an expected call of GetTargetEntity.

func (*MockRelationshipInterfaceMockRecorder) GetTargetValueForSourceRow

func (mr *MockRelationshipInterfaceMockRecorder) GetTargetValueForSourceRow(sourceRowIndex, autoCardinality any) *gomock.Call

GetTargetValueForSourceRow indicates an expected call of GetTargetValueForSourceRow.

func (*MockRelationshipInterfaceMockRecorder) IsManyToOne

IsManyToOne indicates an expected call of IsManyToOne.

func (*MockRelationshipInterfaceMockRecorder) IsOneToMany

IsOneToMany indicates an expected call of IsOneToMany.

func (*MockRelationshipInterfaceMockRecorder) IsOneToOne

IsOneToOne indicates an expected call of IsOneToOne.

type Relationship

type Relationship struct {
	// contains filtered or unexported fields
}

Relationship represents a relationship between two entities and their attributes

func (*Relationship) GetCardinality

func (r *Relationship) GetCardinality() string

GetCardinality returns relationship cardinality (1:1, 1:N, N:1)

func (*Relationship) GetID

func (r *Relationship) GetID() string

GetID returns relationship's ID

func (*Relationship) GetName

func (r *Relationship) GetName() string

GetName returns relationship's name

func (*Relationship) GetSourceAttribute

func (r *Relationship) GetSourceAttribute() AttributeInterface

GetSourceAttribute returns source attribute

func (*Relationship) GetSourceEntity

func (r *Relationship) GetSourceEntity() EntityInterface

GetSourceEntity returns source entity

func (*Relationship) GetTargetAttribute

func (r *Relationship) GetTargetAttribute() AttributeInterface

GetTargetAttribute returns target attribute

func (*Relationship) GetTargetEntity

func (r *Relationship) GetTargetEntity() EntityInterface

GetTargetEntity returns target entity

func (*Relationship) GetTargetValueForSourceRow

func (r *Relationship) GetTargetValueForSourceRow(sourceRowIndex int, autoCardinality bool) (string, error)

GetTargetValueForSourceRow returns a target PK value for a specific source row Uses cardinality-appropriate distribution algorithms for realistic data

func (*Relationship) IsManyToOne

func (r *Relationship) IsManyToOne() bool

IsManyToOne returns true if relationship is N:1

func (*Relationship) IsOneToMany

func (r *Relationship) IsOneToMany() bool

IsOneToMany returns true if relationship is 1:N

func (*Relationship) IsOneToOne

func (r *Relationship) IsOneToOne() bool

IsOneToOne returns true if relationship is 1:1

type RelationshipInterface

type RelationshipInterface interface {
	GetID() string
	GetName() string
	GetSourceEntity() EntityInterface
	GetTargetEntity() EntityInterface
	GetSourceAttribute() AttributeInterface
	GetTargetAttribute() AttributeInterface
	GetCardinality() string
	IsOneToOne() bool
	IsOneToMany() bool
	IsManyToOne() bool

	// Target value selection for FK population
	GetTargetValueForSourceRow(sourceRowIndex int, autoCardinality bool) (string, error)
}

RelationshipInterface defines operations for relationships

type Row

type Row struct {
	// contains filtered or unexported fields
}

func NewRow

func NewRow(values map[string]string) *Row

NewRow creates a new Row with the given values

func (*Row) GetValue

func (r *Row) GetValue(fieldName string) string

GetValue gets a field value from the row

func (*Row) SetValue

func (r *Row) SetValue(fieldName, value string)

SetValue updates a field value in the row

Jump to

Keyboard shortcuts

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