sqlite

package
v0.0.0-...-da5bae9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, cfg store.Config) (store.Store, error)

New creates a Store backed by SQLite + GORM. If cfg.DatabaseURL is empty, uses ~/.config/fluid/state.db

func NewWithDB

func NewWithDB(db *gorm.DB, cfg store.Config) store.Store

NewWithDB wraps an existing *gorm.DB (useful for tests).

Types

type ChangeSetModel

type ChangeSetModel struct {
	ID          string    `gorm:"primaryKey;column:id"`
	JobID       string    `gorm:"column:job_id;not null;uniqueIndex"`
	SandboxID   string    `gorm:"column:sandbox_id;not null;index"`
	DiffID      string    `gorm:"column:diff_id;not null;index"`
	PathAnsible string    `gorm:"column:path_ansible;not null"`
	PathPuppet  string    `gorm:"column:path_puppet;not null"`
	MetaJSON    *string   `gorm:"column:meta_json;type:text"`
	CreatedAt   time.Time `gorm:"column:created_at;not null"`
}

func (ChangeSetModel) TableName

func (ChangeSetModel) TableName() string

type CommandModel

type CommandModel struct {
	ID        string    `gorm:"primaryKey;column:id"`
	SandboxID string    `gorm:"column:sandbox_id;not null;index"`
	Command   string    `gorm:"column:command;not null"`
	EnvJSON   *string   `gorm:"column:env_json;type:text"`
	Stdout    string    `gorm:"column:stdout;not null"`
	Stderr    string    `gorm:"column:stderr;not null"`
	ExitCode  int       `gorm:"column:exit_code;not null"`
	StartedAt time.Time `gorm:"column:started_at;not null;index"`
	EndedAt   time.Time `gorm:"column:ended_at;not null"`
}

func (CommandModel) TableName

func (CommandModel) TableName() string

type DiffModel

type DiffModel struct {
	ID           string    `gorm:"primaryKey;column:id"`
	SandboxID    string    `gorm:"column:sandbox_id;not null;index;uniqueIndex:idx_diffs_sandbox_snapshots"`
	FromSnapshot string    `gorm:"column:from_snapshot;not null;uniqueIndex:idx_diffs_sandbox_snapshots"`
	ToSnapshot   string    `gorm:"column:to_snapshot;not null;uniqueIndex:idx_diffs_sandbox_snapshots"`
	DiffJSON     string    `gorm:"column:diff_json;type:text;not null"`
	CreatedAt    time.Time `gorm:"column:created_at;not null"`
}

func (DiffModel) TableName

func (DiffModel) TableName() string

type HostResourcesModel

type HostResourcesModel struct {
	ID                string    `gorm:"primaryKey;column:id"`
	Name              string    `gorm:"column:name;not null;uniqueIndex"`
	Address           string    `gorm:"column:address;not null"`
	TotalCPUs         int       `gorm:"column:total_cpus;not null"`
	TotalMemoryMB     int64     `gorm:"column:total_memory_mb;not null"`
	TotalStorageMB    int64     `gorm:"column:total_storage_mb;not null"`
	ReservedCPUs      int       `gorm:"column:reserved_cpus;not null;default:0"`
	ReservedMemoryMB  int64     `gorm:"column:reserved_memory_mb;not null;default:0"`
	ReservedStorageMB int64     `gorm:"column:reserved_storage_mb;not null;default:0"`
	UpdatedAt         time.Time `gorm:"column:updated_at;not null"`
}

func (HostResourcesModel) TableName

func (HostResourcesModel) TableName() string

type PlaybookModel

type PlaybookModel struct {
	ID        string    `gorm:"primaryKey;column:id"`
	Name      string    `gorm:"column:name;not null;uniqueIndex"`
	Hosts     string    `gorm:"column:hosts;not null"`
	Become    bool      `gorm:"column:become;not null;default:false"`
	FilePath  *string   `gorm:"column:file_path"`
	CreatedAt time.Time `gorm:"column:created_at;not null"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null"`
}

func (PlaybookModel) TableName

func (PlaybookModel) TableName() string

type PlaybookTaskModel

type PlaybookTaskModel struct {
	ID         string    `gorm:"primaryKey;column:id"`
	PlaybookID string    `gorm:"column:playbook_id;not null;index"`
	Position   int       `gorm:"column:position;not null;index"`
	Name       string    `gorm:"column:name;not null"`
	Module     string    `gorm:"column:module;not null"`
	Params     string    `gorm:"column:params;type:text;not null"`
	CreatedAt  time.Time `gorm:"column:created_at;not null"`
}

func (PlaybookTaskModel) TableName

func (PlaybookTaskModel) TableName() string

type PublicationModel

type PublicationModel struct {
	ID        string    `gorm:"primaryKey;column:id"`
	JobID     string    `gorm:"column:job_id;not null;index"`
	RepoURL   string    `gorm:"column:repo_url;not null"`
	Branch    string    `gorm:"column:branch;not null"`
	CommitSHA *string   `gorm:"column:commit_sha"`
	PRURL     *string   `gorm:"column:pr_url"`
	Status    string    `gorm:"column:status;not null;index"`
	ErrorMsg  *string   `gorm:"column:error_msg"`
	CreatedAt time.Time `gorm:"column:created_at;not null"`
	UpdatedAt time.Time `gorm:"column:updated_at;not null"`
}

func (PublicationModel) TableName

func (PublicationModel) TableName() string

type SandboxModel

type SandboxModel struct {
	ID          string     `gorm:"primaryKey;column:id"`
	JobID       string     `gorm:"column:job_id;not null;index"`
	AgentID     string     `gorm:"column:agent_id;not null;index"`
	SandboxName string     `gorm:"column:sandbox_name;not null"`
	BaseImage   string     `gorm:"column:base_image;not null;index"`
	Network     string     `gorm:"column:network;not null"`
	IPAddress   *string    `gorm:"column:ip"`
	State       string     `gorm:"column:state;not null;index"`
	TTLSeconds  *int       `gorm:"column:ttl_seconds"`
	VCPUs       int        `gorm:"column:vcpus;not null;default:2"`
	MemoryMB    int        `gorm:"column:memory_mb;not null;default:4096"`
	StorageMB   int64      `gorm:"column:storage_mb;not null;default:0"`
	HostName    *string    `gorm:"column:host_name"`
	HostAddress *string    `gorm:"column:host_address"`
	CreatedAt   time.Time  `gorm:"column:created_at;not null"`
	UpdatedAt   time.Time  `gorm:"column:updated_at;not null"`
	DeletedAt   *time.Time `gorm:"column:deleted_at;index"`
}

func (SandboxModel) TableName

func (SandboxModel) TableName() string

type SnapshotModel

type SnapshotModel struct {
	ID        string    `gorm:"primaryKey;column:id"`
	SandboxID string    `gorm:"column:sandbox_id;not null;index;uniqueIndex:idx_snapshots_sandbox_name"`
	Name      string    `gorm:"column:name;not null;uniqueIndex:idx_snapshots_sandbox_name"`
	Kind      string    `gorm:"column:kind;not null"`
	Ref       string    `gorm:"column:ref;not null"`
	CreatedAt time.Time `gorm:"column:created_at;not null"`
	MetaJSON  *string   `gorm:"column:meta_json;type:text"`
}

func (SnapshotModel) TableName

func (SnapshotModel) TableName() string

Jump to

Keyboard shortcuts

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