storage

package
v0.1.0-beta.26 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	*sql.DB
}

func New

func New() (*DB, error)

func (*DB) DeleteLayer

func (db *DB) DeleteLayer(digest string) error

DeleteLayer removes a layer record

func (*DB) GetDeployment

func (db *DB) GetDeployment(deploymentID string) (Deployment, error)

func (*DB) GetDeploymentHistory

func (db *DB) GetDeploymentHistory(appName string, limit int) ([]Deployment, error)

func (*DB) HasLayer

func (db *DB) HasLayer(digest string) (bool, error)

HasLayer checks if a layer exists by digest

func (*DB) HasLayers

func (db *DB) HasLayers(digests []string) (missing, exists []string, err error)

HasLayers checks multiple digests and returns which exist and which are missing

func (*DB) Migrate

func (db *DB) Migrate() error

func (*DB) PruneOldDeployments

func (db *DB) PruneOldDeployments(appName string, deploymentsToKeep int) error

func (*DB) SaveDeployment

func (db *DB) SaveDeployment(deployment Deployment) error

func (*DB) SaveLayer

func (db *DB) SaveLayer(layer Layer) error

SaveLayer saves or updates a layer record

func (*DB) TouchLayer

func (db *DB) TouchLayer(digest string) error

TouchLayer updates the last_used_at timestamp

func (*DB) TouchLayers

func (db *DB) TouchLayers(digests []string) error

TouchLayers updates the last_used_at timestamp for multiple layers

type Deployment

type Deployment struct {
	ID              string          `db:"id" json:"id"`
	AppName         string          `db:"app_name" json:"appName"`
	RawDeployConfig json.RawMessage `db:"raw_deploy_config" json:"rawDeployConfig"`
	DeployedImage   json.RawMessage `db:"deployed_image" json:"deployedImage"`
	RolledBackFrom  *string         `db:"rolled_back_from" json:"rolledBackFrom,omitempty"`
}

func (*Deployment) GetDeployedImage

func (d *Deployment) GetDeployedImage() (config.Image, error)

GetDeployedImage parses and returns the deployed image configuration

func (*Deployment) GetImageRef

func (d *Deployment) GetImageRef() (string, error)

type Layer

type Layer struct {
	Digest     string    `db:"digest" json:"digest"`
	Size       int64     `db:"size" json:"size"`
	CreatedAt  time.Time `db:"created_at" json:"createdAt"`
	LastUsedAt time.Time `db:"last_used_at" json:"lastUsedAt"`
}

Layer represents a cached image layer in the database

Jump to

Keyboard shortcuts

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