Documentation ¶
Index ¶
- Constants
- Variables
- type ArtifactAndBlob
- type Blob
- func (b *Blob) FilterByArtifactDigest(_ context.Context, qs orm.QuerySeter, _ string, value interface{}) orm.QuerySeter
- func (b *Blob) FilterByArtifactDigests(_ context.Context, qs orm.QuerySeter, _ string, value interface{}) orm.QuerySeter
- func (b *Blob) FilterByProjectID(_ context.Context, qs orm.QuerySeter, _ string, value interface{}) orm.QuerySeter
- func (b *Blob) IsForeignLayer() bool
- func (b *Blob) IsManifest() bool
- func (b *Blob) TableName() string
- type ProjectBlob
Constants ¶
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 ¶
var StatusMap = map[string][]string{ StatusNone: {StatusNone, StatusDelete, StatusDeleteFailed}, StatusDelete: {StatusNone, StatusDelete, StatusDeleteFailed}, StatusDeleting: {StatusDelete}, StatusDeleteFailed: {StatusDeleting}, }
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.
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 ¶
IsForeignLayer returns true if the blob is foreign layer
func (*Blob) IsManifest ¶
IsManifest returns true if the blob is manifest layer
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.