Documentation
¶
Overview ¶
Package models contains the database model definitions. These models map directly to the SQLite database tables.
Index ¶
- type ChannelDefinition
- type ChannelValue
- type Cue
- type CueList
- type FixtureDefinition
- type FixtureInstance
- type FixtureMode
- type FixtureValue
- type InstanceChannel
- type ModeChannel
- type OFLImportMeta
- type PreviewSession
- type Project
- type ProjectUser
- type Scene
- type SceneBoard
- type SceneBoardButton
- type Setting
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelDefinition ¶
type ChannelDefinition struct {
ID string `gorm:"column:id;primaryKey"`
Name string `gorm:"column:name"`
Type string `gorm:"column:type"`
Offset int `gorm:"column:offset"`
MinValue int `gorm:"column:min_value;default:0"`
MaxValue int `gorm:"column:max_value;default:255"`
DefaultValue int `gorm:"column:default_value;default:0"`
FadeBehavior string `gorm:"column:fade_behavior;default:FADE"` // FadeBehavior enum: FADE, SNAP, SNAP_END
IsDiscrete bool `gorm:"column:is_discrete;default:false"` // True if channel has multiple discrete DMX ranges
DefinitionID string `gorm:"column:definition_id;index"`
}
ChannelDefinition represents a channel within a fixture definition. Table: channel_definitions
func (ChannelDefinition) TableName ¶
func (ChannelDefinition) TableName() string
type ChannelValue ¶ added in v0.2.0
ChannelValue represents a single channel's value in a scene
type Cue ¶
type Cue struct {
ID string `gorm:"column:id;primaryKey"`
Name string `gorm:"column:name"`
CueNumber float64 `gorm:"column:cue_number"`
CueListID string `gorm:"column:cue_list_id;index"`
SceneID string `gorm:"column:scene_id;index"`
FadeInTime float64 `gorm:"column:fade_in_time;default:0"`
FadeOutTime float64 `gorm:"column:fade_out_time;default:0"`
FollowTime *float64 `gorm:"column:follow_time"`
EasingType *string `gorm:"column:easing_type"`
Notes *string `gorm:"column:notes"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
// Relations
Scene *Scene `gorm:"foreignKey:SceneID"`
}
Cue represents a lighting cue within a cue list. Table: cues
type CueList ¶
type CueList struct {
ID string `gorm:"column:id;primaryKey"`
Name string `gorm:"column:name"`
Description *string `gorm:"column:description"`
Loop bool `gorm:"column:loop;default:false"`
ProjectID string `gorm:"column:project_id;index"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
// Relations
Cues []Cue `gorm:"foreignKey:CueListID"`
}
CueList represents a cue list (sequence of cues). Table: cue_lists
type FixtureDefinition ¶
type FixtureDefinition struct {
ID string `gorm:"column:id;primaryKey"`
Manufacturer string `gorm:"column:manufacturer"`
Model string `gorm:"column:model"`
Type string `gorm:"column:type"`
IsBuiltIn bool `gorm:"column:is_built_in;default:false"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
// OFL tracking fields for change detection
OFLSourceHash *string `gorm:"column:ofl_source_hash"` // SHA256 of the original OFL JSON
OFLVersion *string `gorm:"column:ofl_version"` // OFL commit/version when imported
// Relations
Channels []ChannelDefinition `gorm:"foreignKey:DefinitionID"`
Modes []FixtureMode `gorm:"foreignKey:DefinitionID"`
}
FixtureDefinition represents a fixture type definition. Table: fixture_definitions
func (FixtureDefinition) TableName ¶
func (FixtureDefinition) TableName() string
type FixtureInstance ¶
type FixtureInstance struct {
ID string `gorm:"column:id;primaryKey"`
Name string `gorm:"column:name"`
Description *string `gorm:"column:description"`
DefinitionID string `gorm:"column:definition_id;index"`
Manufacturer *string `gorm:"column:manufacturer"` // Denormalized
Model *string `gorm:"column:model"` // Denormalized
Type *string `gorm:"column:type"` // Denormalized
ModeName *string `gorm:"column:mode_name"`
ChannelCount *int `gorm:"column:channel_count"`
ProjectID string `gorm:"column:project_id;index"`
Universe int `gorm:"column:universe"`
StartChannel int `gorm:"column:start_channel"`
Tags *string `gorm:"column:tags;default:[]"` // JSON array
ProjectOrder *int `gorm:"column:project_order"`
LayoutX *float64 `gorm:"column:layout_x"`
LayoutY *float64 `gorm:"column:layout_y"`
LayoutRotation *float64 `gorm:"column:layout_rotation"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
// Relations
Definition *FixtureDefinition `gorm:"foreignKey:DefinitionID"`
Channels []InstanceChannel `gorm:"foreignKey:FixtureID"`
}
FixtureInstance represents a physical fixture instance in a project. Table: fixture_instances
func (FixtureInstance) TableName ¶
func (FixtureInstance) TableName() string
type FixtureMode ¶
type FixtureMode struct {
ID string `gorm:"column:id;primaryKey"`
Name string `gorm:"column:name"`
ShortName *string `gorm:"column:short_name"`
ChannelCount int `gorm:"column:channel_count"`
DefinitionID string `gorm:"column:definition_id;index"`
// Relations
ModeChannels []ModeChannel `gorm:"foreignKey:ModeID"`
}
FixtureMode represents a mode within a fixture definition. Table: fixture_modes
func (FixtureMode) TableName ¶
func (FixtureMode) TableName() string
type FixtureValue ¶
type FixtureValue struct {
ID string `gorm:"column:id;primaryKey"`
SceneID string `gorm:"column:scene_id;index"`
FixtureID string `gorm:"column:fixture_id;index"`
Channels string `gorm:"column:channels;default:[]"` // JSON array of ChannelValue
SceneOrder *int `gorm:"column:scene_order"`
}
FixtureValue represents fixture channel values within a scene. Table: fixture_values
func (FixtureValue) TableName ¶
func (FixtureValue) TableName() string
type InstanceChannel ¶
type InstanceChannel struct {
ID string `gorm:"column:id;primaryKey"`
FixtureID string `gorm:"column:fixture_id;index"`
Offset int `gorm:"column:offset"`
Name string `gorm:"column:name"`
Type string `gorm:"column:type"`
MinValue int `gorm:"column:min_value;default:0"`
MaxValue int `gorm:"column:max_value;default:255"`
DefaultValue int `gorm:"column:default_value;default:0"`
FadeBehavior string `gorm:"column:fade_behavior;default:FADE"` // FadeBehavior enum: FADE, SNAP, SNAP_END
IsDiscrete bool `gorm:"column:is_discrete;default:false"` // True if channel has multiple discrete DMX ranges
}
InstanceChannel represents a channel on a fixture instance. Table: instance_channels
func (InstanceChannel) TableName ¶
func (InstanceChannel) TableName() string
type ModeChannel ¶
type ModeChannel struct {
ID string `gorm:"column:id;primaryKey"`
ModeID string `gorm:"column:mode_id;index"`
ChannelID string `gorm:"column:channel_id;index"`
Offset int `gorm:"column:offset"`
}
ModeChannel represents the mapping of channels to modes. Table: mode_channels
func (ModeChannel) TableName ¶
func (ModeChannel) TableName() string
type OFLImportMeta ¶ added in v0.2.0
type OFLImportMeta struct {
ID string `gorm:"column:id;primaryKey"`
OFLVersion string `gorm:"column:ofl_version"` // Commit SHA or version tag
StartedAt time.Time `gorm:"column:started_at"` // When import started
CompletedAt time.Time `gorm:"column:completed_at"` // When import completed
TotalFixtures int `gorm:"column:total_fixtures"` // Total fixtures in OFL
SuccessfulImports int `gorm:"column:successful_imports"` // Successfully imported
FailedImports int `gorm:"column:failed_imports"` // Failed to import
SkippedDuplicates int `gorm:"column:skipped_duplicates"` // Already existed
UpdatedFixtures int `gorm:"column:updated_fixtures"` // Updated existing fixtures
UsedBundledData bool `gorm:"column:used_bundled_data"` // True if imported from bundle
ErrorMessage *string `gorm:"column:error_message"` // Error if import failed
}
OFLImportMeta tracks the history of OFL imports. Table: ofl_import_meta
func (OFLImportMeta) TableName ¶ added in v0.2.0
func (OFLImportMeta) TableName() string
type PreviewSession ¶
type PreviewSession struct {
ID string `gorm:"column:id;primaryKey"`
ProjectID string `gorm:"column:project_id;index"`
UserID string `gorm:"column:user_id;index"`
IsActive bool `gorm:"column:is_active;default:true"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
}
PreviewSession represents a preview session. Table: preview_sessions
func (PreviewSession) TableName ¶
func (PreviewSession) TableName() string
type Project ¶
type Project struct {
ID string `gorm:"column:id;primaryKey"`
Name string `gorm:"column:name"`
Description *string `gorm:"column:description"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
// Relations (loaded separately)
Fixtures []FixtureInstance `gorm:"foreignKey:ProjectID"`
Scenes []Scene `gorm:"foreignKey:ProjectID"`
CueLists []CueList `gorm:"foreignKey:ProjectID"`
}
Project represents a lighting project. Table: projects
type ProjectUser ¶
type ProjectUser struct {
ID string `gorm:"column:id;primaryKey"`
UserID string `gorm:"column:user_id;index"`
ProjectID string `gorm:"column:project_id;index"`
Role string `gorm:"column:role;default:VIEWER"`
JoinedAt time.Time `gorm:"column:joined_at;autoCreateTime"`
}
ProjectUser represents the many-to-many relationship between users and projects. Table: project_users
func (ProjectUser) TableName ¶
func (ProjectUser) TableName() string
type Scene ¶
type Scene struct {
ID string `gorm:"column:id;primaryKey"`
Name string `gorm:"column:name"`
Description *string `gorm:"column:description"`
ProjectID string `gorm:"column:project_id;index"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
// Relations
FixtureValues []FixtureValue `gorm:"foreignKey:SceneID"`
}
Scene represents a lighting scene. Table: scenes
type SceneBoard ¶
type SceneBoard struct {
ID string `gorm:"column:id;primaryKey"`
Name string `gorm:"column:name"`
Description *string `gorm:"column:description"`
ProjectID string `gorm:"column:project_id;index"`
DefaultFadeTime float64 `gorm:"column:default_fade_time;default:3.0"`
GridSize *int `gorm:"column:grid_size;default:50"`
CanvasWidth int `gorm:"column:canvas_width;default:2000"`
CanvasHeight int `gorm:"column:canvas_height;default:2000"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
// Relations
Buttons []SceneBoardButton `gorm:"foreignKey:SceneBoardID"`
}
SceneBoard represents a scene board for organizing scenes. Table: scene_boards
func (SceneBoard) TableName ¶
func (SceneBoard) TableName() string
type SceneBoardButton ¶
type SceneBoardButton struct {
ID string `gorm:"column:id;primaryKey"`
SceneBoardID string `gorm:"column:scene_board_id;index"`
SceneID string `gorm:"column:scene_id;index"`
LayoutX int `gorm:"column:layout_x"`
LayoutY int `gorm:"column:layout_y"`
Width *int `gorm:"column:width;default:200"`
Height *int `gorm:"column:height;default:120"`
Color *string `gorm:"column:color"`
Label *string `gorm:"column:label"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
// Relations
Scene *Scene `gorm:"foreignKey:SceneID"`
}
SceneBoardButton represents a button on a scene board. Table: scene_board_buttons
func (SceneBoardButton) TableName ¶
func (SceneBoardButton) TableName() string
type Setting ¶
type Setting struct {
ID string `gorm:"column:id;primaryKey"`
Key string `gorm:"column:key;uniqueIndex"`
Value string `gorm:"column:value"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
}
Setting represents a system setting. Table: settings
type User ¶
type User struct {
ID string `gorm:"column:id;primaryKey"`
Email string `gorm:"column:email;uniqueIndex"`
Name *string `gorm:"column:name"`
Role string `gorm:"column:role;default:USER"`
CreatedAt time.Time `gorm:"column:created_at;autoCreateTime"`
UpdatedAt time.Time `gorm:"column:updated_at;autoUpdateTime"`
}
User represents a user in the system. Table: users