Documentation
¶
Index ¶
- type BuildLog
- type Deployment
- type DeploymentStatus
- type Store
- func (s *Store) AppendBuildLog(deploymentID, line string) error
- func (s *Store) Close() error
- func (s *Store) CreateDeployment(d *Deployment) error
- func (s *Store) DB() *sql.DB
- func (s *Store) GetActiveDeployment(appName string) (*Deployment, error)
- func (s *Store) GetBuildLogs(deploymentID string) ([]BuildLog, error)
- func (s *Store) GetDeployment(id string) (*Deployment, error)
- func (s *Store) GetLatestDeployment(appName string) (*Deployment, error)
- func (s *Store) ListDeployments(appName string, limit int) ([]Deployment, error)
- func (s *Store) UpdateDeploymentStatus(id string, status DeploymentStatus, containerID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildLog ¶
type BuildLog struct {
ID string `json:"id"`
DeploymentID string `json:"deployment_id"`
Line string `json:"line"`
Timestamp time.Time `json:"timestamp"`
}
BuildLog represents a single line of build output logged during image build.
type Deployment ¶
type Deployment struct {
ID string `json:"id"`
AppName string `json:"app_name"`
RepoURL string `json:"repo_url"`
CommitHash string `json:"commit_hash"`
Status DeploymentStatus `json:"status"`
ContainerID string `json:"container_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Deployment represents a single deployment record in the database.
type DeploymentStatus ¶
type DeploymentStatus string
DeploymentStatus represents the current state of a deployment.
const ( StatusPending DeploymentStatus = "pending" StatusBuilding DeploymentStatus = "building" StatusRunning DeploymentStatus = "running" StatusFailed DeploymentStatus = "failed" StatusStopped DeploymentStatus = "stopped" )
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store wraps an embedded SQLite database connection and provides methods to persist and query deployment state and build logs.
func New ¶
New opens (or creates) the JumpGate SQLite database at the given data directory, runs schema migrations, and returns a ready-to-use Store.
func (*Store) AppendBuildLog ¶
AppendBuildLog inserts a single line of build output for a deployment.
func (*Store) CreateDeployment ¶
func (s *Store) CreateDeployment(d *Deployment) error
CreateDeployment inserts a new deployment record into the database. The ID is auto-generated as a UUID if empty.
func (*Store) GetActiveDeployment ¶
func (s *Store) GetActiveDeployment(appName string) (*Deployment, error)
GetActiveDeployment returns the currently running deployment for an app, or nil if no deployment is in Running status.
func (*Store) GetBuildLogs ¶
GetBuildLogs returns all build log lines for a deployment, ordered by timestamp.
func (*Store) GetDeployment ¶
func (s *Store) GetDeployment(id string) (*Deployment, error)
GetDeployment retrieves a single deployment by its ID.
func (*Store) GetLatestDeployment ¶
func (s *Store) GetLatestDeployment(appName string) (*Deployment, error)
GetLatestDeployment returns the most recent deployment for a given app name.
func (*Store) ListDeployments ¶
func (s *Store) ListDeployments(appName string, limit int) ([]Deployment, error)
ListDeployments returns recent deployments for an app, ordered by creation time descending, up to the given limit.
func (*Store) UpdateDeploymentStatus ¶
func (s *Store) UpdateDeploymentStatus(id string, status DeploymentStatus, containerID string) error
UpdateDeploymentStatus updates the status and optionally the container ID of an existing deployment.