Documentation ¶
Overview ¶
Package models contains domain models for entities
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DbPropToModel ¶
func DbPropToModel(dbProp db.Property) (*properties.Property, error)
DbPropToModel converts a single db.Property to a properties.Property instance.
func DbPropsToModel ¶
func DbPropsToModel(dbProps []db.Property) (*properties.Properties, error)
DbPropsToModel converts a slice of db.Property to a properties.Properties instance.
Types ¶
type EntityInstance ¶
type EntityInstance struct { ID uuid.UUID Type minderv1.Entity Name string ProviderID uuid.UUID ProjectID uuid.UUID OriginatedFrom uuid.UUID }
EntityInstance represents an entity instance
func (EntityInstance) String ¶
func (ei EntityInstance) String() string
String implements fmt.Stringer for debugging purposes
type EntityWithProperties ¶
type EntityWithProperties struct { Entity EntityInstance Properties *properties.Properties }
EntityWithProperties represents an entity instance with properties
func NewEntityWithProperties ¶
func NewEntityWithProperties(dbEntity db.EntityInstance, props *properties.Properties) *EntityWithProperties
NewEntityWithProperties creates a new EntityWithProperties instance
func NewEntityWithPropertiesFromInstance ¶
func NewEntityWithPropertiesFromInstance(entity EntityInstance, props *properties.Properties) *EntityWithProperties
NewEntityWithPropertiesFromInstance creates a new EntityWithProperties instance from an existing entity instance
func (*EntityWithProperties) NeedsPropertyLoad ¶
func (e *EntityWithProperties) NeedsPropertyLoad() bool
NeedsPropertyLoad returns true if the entity instance needs properties loaded This is handy to determine if entities exist in the database without their properties being migrated to the central table yet.
func (EntityWithProperties) String ¶
func (ewp EntityWithProperties) String() string
String implements fmt.Stringer for debugging purposes
func (*EntityWithProperties) UpdateProperties ¶
func (e *EntityWithProperties) UpdateProperties(props *properties.Properties)
UpdateProperties updates the properties for the "entity for properties" instance