Documentation
¶
Overview ¶
Package model is a generated GoMock package.
Index ¶
- Constants
- Variables
- type Attribute
- func (a *Attribute) GetAttributeAlias() string
- func (a *Attribute) GetDataType() string
- func (a *Attribute) GetExternalID() string
- func (a *Attribute) GetName() string
- func (a *Attribute) GetParentEntity() EntityInterface
- func (a *Attribute) GetRelatedAttribute() string
- func (a *Attribute) GetRelatedEntityID() string
- func (a *Attribute) IsRelationship() bool
- func (a *Attribute) IsUnique() bool
- type AttributeInterface
- type CSVData
- type Entity
- func (e *Entity) AddRow(row *Row) error
- func (e *Entity) CheckKeyExists(keyValue string) bool
- func (e *Entity) ForEachRow(fn func(row *Row, index int) error) error
- func (e *Entity) GetAttribute(name string) (AttributeInterface, bool)
- func (e *Entity) GetAttributeByExternalID(externalID string) (AttributeInterface, bool)
- func (e *Entity) GetAttributes() []AttributeInterface
- func (e *Entity) GetDescription() string
- func (e *Entity) GetExternalID() string
- func (e *Entity) GetID() string
- func (e *Entity) GetName() string
- func (e *Entity) GetNonRelationshipAttributes() []AttributeInterface
- func (e *Entity) GetNonUniqueAttributes() []AttributeInterface
- func (e *Entity) GetPrimaryKey() AttributeInterface
- func (e *Entity) GetRelationshipAttributes() []AttributeInterface
- func (e *Entity) GetRowByIndex(index int) *Row
- func (e *Entity) GetRowCount() int
- func (e *Entity) IsCompositeKeyRegistered(row *Row) bool
- func (e *Entity) IsForeignKeyUnique(row *Row) bool
- func (e *Entity) RegisterCompositeKey(row *Row)
- func (e *Entity) RemoveRow(rowIndex int) error
- func (e *Entity) ToCSV() *CSVData
- func (e *Entity) ValidateAllForeignKeys() []string
- type EntityInterface
- type Graph
- func (g *Graph) GetAllEntities() map[string]EntityInterface
- func (g *Graph) GetAllRelationships() []RelationshipInterface
- func (g *Graph) GetEntitiesList() []EntityInterface
- func (g *Graph) GetEntity(id string) (EntityInterface, bool)
- func (g *Graph) GetExpectedDataVolume() int
- func (g *Graph) GetRelationship(id string) (RelationshipInterface, bool)
- func (g *Graph) GetRelationshipsForEntity(entityID string) []RelationshipInterface
- func (g *Graph) GetStatistics() *GraphStatistics
- func (g *Graph) GetTopologicalOrder() ([]string, error)
- type GraphInterface
- type GraphStatistics
- type MockAttributeInterface
- func (m *MockAttributeInterface) EXPECT() *MockAttributeInterfaceMockRecorder
- func (m *MockAttributeInterface) GetAttributeAlias() string
- func (m *MockAttributeInterface) GetDataType() string
- func (m *MockAttributeInterface) GetExternalID() string
- func (m *MockAttributeInterface) GetName() string
- func (m *MockAttributeInterface) GetParentEntity() EntityInterface
- func (m *MockAttributeInterface) GetRelatedAttribute() string
- func (m *MockAttributeInterface) GetRelatedEntityID() string
- func (m *MockAttributeInterface) IsRelationship() bool
- func (m *MockAttributeInterface) IsUnique() bool
- type MockAttributeInterfaceMockRecorder
- func (mr *MockAttributeInterfaceMockRecorder) GetAttributeAlias() *gomock.Call
- func (mr *MockAttributeInterfaceMockRecorder) GetDataType() *gomock.Call
- func (mr *MockAttributeInterfaceMockRecorder) GetExternalID() *gomock.Call
- func (mr *MockAttributeInterfaceMockRecorder) GetName() *gomock.Call
- func (mr *MockAttributeInterfaceMockRecorder) GetParentEntity() *gomock.Call
- func (mr *MockAttributeInterfaceMockRecorder) GetRelatedAttribute() *gomock.Call
- func (mr *MockAttributeInterfaceMockRecorder) GetRelatedEntityID() *gomock.Call
- func (mr *MockAttributeInterfaceMockRecorder) IsRelationship() *gomock.Call
- func (mr *MockAttributeInterfaceMockRecorder) IsUnique() *gomock.Call
- type MockEntityInterface
- func (m *MockEntityInterface) AddRow(row *Row) error
- func (m *MockEntityInterface) CheckKeyExists(keyValue string) bool
- func (m *MockEntityInterface) EXPECT() *MockEntityInterfaceMockRecorder
- func (m *MockEntityInterface) ForEachRow(fn func(*Row, int) error) error
- func (m *MockEntityInterface) GetAttribute(name string) (AttributeInterface, bool)
- func (m *MockEntityInterface) GetAttributeByExternalID(externalID string) (AttributeInterface, bool)
- func (m *MockEntityInterface) GetAttributes() []AttributeInterface
- func (m *MockEntityInterface) GetDescription() string
- func (m *MockEntityInterface) GetExternalID() string
- func (m *MockEntityInterface) GetID() string
- func (m *MockEntityInterface) GetName() string
- func (m *MockEntityInterface) GetNonRelationshipAttributes() []AttributeInterface
- func (m *MockEntityInterface) GetNonUniqueAttributes() []AttributeInterface
- func (m *MockEntityInterface) GetPrimaryKey() AttributeInterface
- func (m *MockEntityInterface) GetRelationshipAttributes() []AttributeInterface
- func (m *MockEntityInterface) GetRowByIndex(index int) *Row
- func (m *MockEntityInterface) GetRowCount() int
- func (m *MockEntityInterface) IsCompositeKeyRegistered(row *Row) bool
- func (m *MockEntityInterface) IsForeignKeyUnique(row *Row) bool
- func (m *MockEntityInterface) RegisterCompositeKey(row *Row)
- func (m *MockEntityInterface) RemoveRow(rowIndex int) error
- func (m *MockEntityInterface) ToCSV() *CSVData
- func (m *MockEntityInterface) ValidateAllForeignKeys() []string
- type MockEntityInterfaceMockRecorder
- func (mr *MockEntityInterfaceMockRecorder) AddRow(row any) *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) CheckKeyExists(keyValue any) *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) ForEachRow(fn any) *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetAttribute(name any) *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetAttributeByExternalID(externalID any) *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetAttributes() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetDescription() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetExternalID() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetID() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetName() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetNonRelationshipAttributes() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetNonUniqueAttributes() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetPrimaryKey() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetRelationshipAttributes() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetRowByIndex(index any) *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) GetRowCount() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) IsCompositeKeyRegistered(row any) *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) IsForeignKeyUnique(row any) *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) RegisterCompositeKey(row any) *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) RemoveRow(rowIndex any) *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) ToCSV() *gomock.Call
- func (mr *MockEntityInterfaceMockRecorder) ValidateAllForeignKeys() *gomock.Call
- type MockGraphInterface
- func (m *MockGraphInterface) EXPECT() *MockGraphInterfaceMockRecorder
- func (m *MockGraphInterface) GetAllEntities() map[string]EntityInterface
- func (m *MockGraphInterface) GetAllRelationships() []RelationshipInterface
- func (m *MockGraphInterface) GetEntitiesList() []EntityInterface
- func (m *MockGraphInterface) GetEntity(id string) (EntityInterface, bool)
- func (m *MockGraphInterface) GetExpectedDataVolume() int
- func (m *MockGraphInterface) GetRelationship(id string) (RelationshipInterface, bool)
- func (m *MockGraphInterface) GetRelationshipsForEntity(entityID string) []RelationshipInterface
- func (m *MockGraphInterface) GetTopologicalOrder() ([]string, error)
- type MockGraphInterfaceMockRecorder
- func (mr *MockGraphInterfaceMockRecorder) GetAllEntities() *gomock.Call
- func (mr *MockGraphInterfaceMockRecorder) GetAllRelationships() *gomock.Call
- func (mr *MockGraphInterfaceMockRecorder) GetEntitiesList() *gomock.Call
- func (mr *MockGraphInterfaceMockRecorder) GetEntity(id any) *gomock.Call
- func (mr *MockGraphInterfaceMockRecorder) GetExpectedDataVolume() *gomock.Call
- func (mr *MockGraphInterfaceMockRecorder) GetRelationship(id any) *gomock.Call
- func (mr *MockGraphInterfaceMockRecorder) GetRelationshipsForEntity(entityID any) *gomock.Call
- func (mr *MockGraphInterfaceMockRecorder) GetTopologicalOrder() *gomock.Call
- type MockRelationshipInterface
- func (m *MockRelationshipInterface) EXPECT() *MockRelationshipInterfaceMockRecorder
- func (m *MockRelationshipInterface) GetCardinality() string
- func (m *MockRelationshipInterface) GetID() string
- func (m *MockRelationshipInterface) GetName() string
- func (m *MockRelationshipInterface) GetSourceAttribute() AttributeInterface
- func (m *MockRelationshipInterface) GetSourceEntity() EntityInterface
- func (m *MockRelationshipInterface) GetTargetAttribute() AttributeInterface
- func (m *MockRelationshipInterface) GetTargetEntity() EntityInterface
- func (m *MockRelationshipInterface) GetTargetValueForSourceRow(sourceRowIndex int, autoCardinality bool) (string, error)
- func (m *MockRelationshipInterface) IsManyToOne() bool
- func (m *MockRelationshipInterface) IsOneToMany() bool
- func (m *MockRelationshipInterface) IsOneToOne() bool
- type MockRelationshipInterfaceMockRecorder
- func (mr *MockRelationshipInterfaceMockRecorder) GetCardinality() *gomock.Call
- func (mr *MockRelationshipInterfaceMockRecorder) GetID() *gomock.Call
- func (mr *MockRelationshipInterfaceMockRecorder) GetName() *gomock.Call
- func (mr *MockRelationshipInterfaceMockRecorder) GetSourceAttribute() *gomock.Call
- func (mr *MockRelationshipInterfaceMockRecorder) GetSourceEntity() *gomock.Call
- func (mr *MockRelationshipInterfaceMockRecorder) GetTargetAttribute() *gomock.Call
- func (mr *MockRelationshipInterfaceMockRecorder) GetTargetEntity() *gomock.Call
- func (mr *MockRelationshipInterfaceMockRecorder) GetTargetValueForSourceRow(sourceRowIndex, autoCardinality any) *gomock.Call
- func (mr *MockRelationshipInterfaceMockRecorder) IsManyToOne() *gomock.Call
- func (mr *MockRelationshipInterfaceMockRecorder) IsOneToMany() *gomock.Call
- func (mr *MockRelationshipInterfaceMockRecorder) IsOneToOne() *gomock.Call
- type Relationship
- func (r *Relationship) GetCardinality() string
- func (r *Relationship) GetID() string
- func (r *Relationship) GetName() string
- func (r *Relationship) GetSourceAttribute() AttributeInterface
- func (r *Relationship) GetSourceEntity() EntityInterface
- func (r *Relationship) GetTargetAttribute() AttributeInterface
- func (r *Relationship) GetTargetEntity() EntityInterface
- func (r *Relationship) GetTargetValueForSourceRow(sourceRowIndex int, autoCardinality bool) (string, error)
- func (r *Relationship) IsManyToOne() bool
- func (r *Relationship) IsOneToMany() bool
- func (r *Relationship) IsOneToOne() bool
- type RelationshipInterface
- type Row
Constants ¶
const ( OneToOne = "1:1" OneToMany = "1:N" ManyToOne = "N:1" )
Cardinality constants
Variables ¶
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
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 ¶
GetAttributeAlias returns the attribute's external ID
func (*Attribute) GetDataType ¶
GetDataType returns the attribute's data type
func (*Attribute) GetExternalID ¶
GetExternalID returns the attribute's external ID
func (*Attribute) GetParentEntity ¶
func (a *Attribute) GetParentEntity() EntityInterface
GetParentEntity returns the parent entity this attribute belongs to
func (*Attribute) GetRelatedAttribute ¶
GetRelatedAttribute returns the related attribute name if part of a relationship
func (*Attribute) GetRelatedEntityID ¶
GetRelatedEntityID returns the related entity ID if part of a relationship
func (*Attribute) IsRelationship ¶
IsRelationship returns whether attribute is part of a relationship
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 ¶
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 ¶
CheckKeyExists checks if a key value exists in the used primary key values (O(1) lookup)
func (*Entity) ForEachRow ¶
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 ¶
GetDescription returns entity's description
func (*Entity) GetExternalID ¶
GetExternalID returns entity's external ID (used for CSV filenames)
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 ¶
GetRowByIndex returns a row by index for direct access (O(1) operation)
func (*Entity) GetRowCount ¶
GetRowCount returns the number of rows
func (*Entity) IsCompositeKeyRegistered ¶ added in v0.1.14
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 ¶
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
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) ValidateAllForeignKeys ¶
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 ¶
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 ¶
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 ¶
func (m *MockAttributeInterface) EXPECT() *MockAttributeInterfaceMockRecorder
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 ¶
func (mr *MockAttributeInterfaceMockRecorder) GetName() *gomock.Call
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 ¶
func (mr *MockAttributeInterfaceMockRecorder) IsUnique() *gomock.Call
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 ¶
func (m *MockEntityInterface) EXPECT() *MockEntityInterfaceMockRecorder
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 ¶
func (mr *MockEntityInterfaceMockRecorder) AddRow(row any) *gomock.Call
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 ¶
func (mr *MockEntityInterfaceMockRecorder) GetID() *gomock.Call
GetID indicates an expected call of GetID.
func (*MockEntityInterfaceMockRecorder) GetName ¶
func (mr *MockEntityInterfaceMockRecorder) GetName() *gomock.Call
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 ¶
func (mr *MockEntityInterfaceMockRecorder) ToCSV() *gomock.Call
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 ¶
func (m *MockGraphInterface) EXPECT() *MockGraphInterfaceMockRecorder
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 ¶
func (m *MockRelationshipInterface) EXPECT() *MockRelationshipInterfaceMockRecorder
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 ¶
func (mr *MockRelationshipInterfaceMockRecorder) GetID() *gomock.Call
GetID indicates an expected call of GetID.
func (*MockRelationshipInterfaceMockRecorder) GetName ¶
func (mr *MockRelationshipInterfaceMockRecorder) GetName() *gomock.Call
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 ¶
func (mr *MockRelationshipInterfaceMockRecorder) IsManyToOne() *gomock.Call
IsManyToOne indicates an expected call of IsManyToOne.
func (*MockRelationshipInterfaceMockRecorder) IsOneToMany ¶
func (mr *MockRelationshipInterfaceMockRecorder) IsOneToMany() *gomock.Call
IsOneToMany indicates an expected call of IsOneToMany.
func (*MockRelationshipInterfaceMockRecorder) IsOneToOne ¶
func (mr *MockRelationshipInterfaceMockRecorder) IsOneToOne() *gomock.Call
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) 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