models

package
v0.0.0-...-969384c Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusNone         = "none"
	StatusDelete       = "delete"
	StatusDeleting     = "deleting"
	StatusDeleteFailed = "deletefailed"
)

the status are used for Garbage Collection StatusNone, the blob is using in Harbor as normal. StatusDelete, the blob is marked as GC candidate. StatusDeleting, the blob undergo a GC blob deletion. StatusDeleteFailed, the blob is failed to delete from the backend storage.

The status transitions StatusNone -> StatusDelete : Mark the blob as candidate. StatusDelete -> StatusDeleting : Select the blob and call the API to delete asset in the backend storage. StatusDeleting -> Trash : Delete success from the backend storage. StatusDelete -> StatusNone : Client asks the existence of blob, remove it from the candidate. StatusDelete -> StatusDeleteFailed : The storage driver returns fail when to delete the real data from the configurated file system. StatusDelete -> StatusDelete : Encounter failure in the GC sweep phase. When to rerun the GC job, all of blob candidates are marked as StatusDelete again. StatusDeleteFailed -> StatusNone : The delete failed blobs can be pushed again, and back to normal. StatusDeleteFailed -> StatusDelete : The delete failed blobs should be in the candidate.

Variables

StatusMap key is the target status, values are the accepted source status. For example, only StatusDelete can be convert to StatusDeleting.

Functions

This section is empty.

Types

type ArtifactAndBlob

type ArtifactAndBlob struct {
	ID           int64     `orm:"pk;auto;column(id)" json:"id"`
	DigestAF     string    `orm:"column(digest_af)" json:"digest_af"`
	DigestBlob   string    `orm:"column(digest_blob)" json:"digest_blob"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
}

ArtifactAndBlob holds the relationship between manifest and blob.

func (*ArtifactAndBlob) TableName

func (afb *ArtifactAndBlob) TableName() string

TableName ...

type Blob

type Blob struct {
	ID           int64     `orm:"pk;auto;column(id)" json:"id"`
	Digest       string    `orm:"column(digest)" json:"digest"`
	ContentType  string    `orm:"column(content_type)" json:"content_type"`
	Size         int64     `orm:"column(size)" json:"size"`
	Status       string    `orm:"column(status)" json:"status"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now_add" json:"update_time"`
	Version      int64     `orm:"column(version)" json:"version"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
}

Blob holds the details of a blob.

func (*Blob) FilterByArtifactDigest

func (b *Blob) FilterByArtifactDigest(_ context.Context, qs orm.QuerySeter, _ string, value interface{}) orm.QuerySeter

FilterByArtifactDigest returns orm.QuerySeter with artifact digest filter

func (*Blob) FilterByArtifactDigests

func (b *Blob) FilterByArtifactDigests(_ context.Context, qs orm.QuerySeter, _ string, value interface{}) orm.QuerySeter

FilterByArtifactDigests returns orm.QuerySeter with artifact digests filter

func (*Blob) FilterByProjectID

func (b *Blob) FilterByProjectID(_ context.Context, qs orm.QuerySeter, _ string, value interface{}) orm.QuerySeter

FilterByProjectID returns orm.QuerySeter with project id filter

func (*Blob) IsForeignLayer

func (b *Blob) IsForeignLayer() bool

IsForeignLayer returns true if the blob is foreign layer

func (*Blob) IsManifest

func (b *Blob) IsManifest() bool

IsManifest returns true if the blob is manifest layer

func (*Blob) TableName

func (b *Blob) TableName() string

TableName ...

type ProjectBlob

type ProjectBlob struct {
	ID           int64     `orm:"pk;auto;column(id)" json:"id"`
	ProjectID    int64     `orm:"column(project_id)" json:"project_id"`
	BlobID       int64     `orm:"column(blob_id)" json:"blob_id"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
}

ProjectBlob holds the relationship between manifest and blob.

func (*ProjectBlob) TableName

func (*ProjectBlob) TableName() string

TableName ...

Jump to

Keyboard shortcuts

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