Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Mgr default blob manager Mgr = NewManager() )
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface { // AssociateWithArtifact associate blob with artifact AssociateWithArtifact(ctx context.Context, blobDigest, artifactDigest string) (int64, error) // AssociateWithProject associate blob with project AssociateWithProject(ctx context.Context, blobID, projectID int64) (int64, error) // CalculateTotalSizeByProject returns total blob size by project, skip foreign blobs when `excludeForeignLayer` is true CalculateTotalSizeByProject(ctx context.Context, projectID int64, excludeForeignLayer bool) (int64, error) // SumBlobsSize returns sum size of all blobs skip foreign blobs when `excludeForeignLayer` is true CalculateTotalSize(ctx context.Context, excludeForeignLayer bool) (int64, error) // Create create blob Create(ctx context.Context, digest string, contentType string, size int64) (int64, error) // CleanupAssociationsForArtifact remove all associations between blob and artifact by artifact digest CleanupAssociationsForArtifact(ctx context.Context, artifactDigest string) error // CleanupAssociationsForProject remove unneeded associations between blobs and project CleanupAssociationsForProject(ctx context.Context, projectID int64, blobs []*Blob) error // FindBlobsShouldUnassociatedWithProject filter the blobs which should not be associated with the project FindBlobsShouldUnassociatedWithProject(ctx context.Context, projectID int64, blobs []*models.Blob) ([]*models.Blob, error) // Get get blob by digest Get(ctx context.Context, digest string) (*Blob, error) // Get get blob by artifact digest GetByArt(ctx context.Context, digest string) ([]*models.Blob, error) // Update the blob Update(ctx context.Context, blob *Blob) error // Update the blob status UpdateBlobStatus(ctx context.Context, blob *models.Blob) (int64, error) // List returns blobs by params List(ctx context.Context, query *q.Query) ([]*Blob, error) // DeleteBlob delete blob Delete(ctx context.Context, id int64) (err error) // UselessBlobs useless blob is the blob that is not used in any of projects. UselessBlobs(ctx context.Context, timeWindowHours int64) ([]*models.Blob, error) }
Manager interface provide the management functions for blobs
Click to show internal directories.
Click to hide internal directories.