models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package models defines domain models for the database layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ID               string
	Name             string
	Content          string
	ASTJSON          json.RawMessage
	ValidationErrors json.RawMessage
	CreatedAt        time.Time
}

Config represents a DSL configuration.

func NewConfig

func NewConfig(name, content string) *Config

NewConfig creates a new Config with sensible defaults.

type Deployment

type Deployment struct {
	ID        string
	Name      string
	ConfigID  sql.NullString
	Status    string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Deployment represents a deployment configuration.

func NewDeployment

func NewDeployment(name string) *Deployment

NewDeployment creates a new Deployment with sensible defaults.

type DeploymentStatus

type DeploymentStatus string

DeploymentStatus represents valid deployment statuses.

const (
	DeploymentStatusPending  DeploymentStatus = "pending"
	DeploymentStatusRunning  DeploymentStatus = "running"
	DeploymentStatusStopped  DeploymentStatus = "stopped"
	DeploymentStatusFailed   DeploymentStatus = "failed"
	DeploymentStatusComplete DeploymentStatus = "complete"
)

type Execution

type Execution struct {
	ID           string
	DeploymentID string
	Command      string
	Output       sql.NullString
	ExitCode     sql.NullInt32
	StartedAt    time.Time
	CompletedAt  sql.NullTime
}

Execution represents a command execution history entry.

func NewExecution

func NewExecution(deploymentID, command string) *Execution

NewExecution creates a new Execution with sensible defaults.

func (*Execution) IsCompleted

func (e *Execution) IsCompleted() bool

IsCompleted returns true if the execution has completed.

func (*Execution) SetCompleted

func (e *Execution) SetCompleted(output string, exitCode int)

SetCompleted marks the execution as completed with output and exit code.

Jump to

Keyboard shortcuts

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