Documentation
¶
Index ¶
- type DB
- func (db *DB) DeleteLayer(digest string) error
- func (db *DB) GetDeployment(deploymentID string) (Deployment, error)
- func (db *DB) GetDeploymentHistory(appName string, limit int) ([]Deployment, error)
- func (db *DB) HasLayer(digest string) (bool, error)
- func (db *DB) HasLayers(digests []string) (missing, exists []string, err error)
- func (db *DB) ListAllLayers() ([]Layer, error)
- func (db *DB) ListDistinctAppNames() ([]string, error)
- func (db *DB) Migrate() error
- func (db *DB) PruneOldDeployments(appName string, deploymentsToKeep int) error
- func (db *DB) SaveDeployment(deployment Deployment) error
- func (db *DB) SaveLayer(layer Layer) error
- func (db *DB) SetLayerDiffIDs(diffIDs map[string]string) error
- func (db *DB) TouchLayer(digest string) error
- func (db *DB) TouchLayers(digests []string) error
- type Deployment
- type Layer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
func (*DB) DeleteLayer ¶
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) HasLayers ¶
HasLayers checks multiple digests and returns which exist and which are missing
func (*DB) ListAllLayers ¶
func (*DB) ListDistinctAppNames ¶
func (*DB) PruneOldDeployments ¶
func (*DB) SaveDeployment ¶
func (db *DB) SaveDeployment(deployment Deployment) error
func (*DB) SetLayerDiffIDs ¶
SetLayerDiffIDs records the diff ID for each digest so prune can match layers against the diff IDs reported by docker image inspect.
func (*DB) TouchLayer ¶
TouchLayer updates the last_used_at timestamp
func (*DB) TouchLayers ¶
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"`
DiffID string `db:"diff_id" json:"diffId"`
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. Digest is the sha256 of the stored blob; DiffID is the sha256 of the uncompressed layer content as referenced by Docker image configs. They differ when docker save emits compressed blobs (containerd image store).