artifactrash

package
v0.0.0-...-a548ab7 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Mgr is a global artifact trash manager instance
	Mgr = NewManager()
)

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// Create ...
	Create(ctx context.Context, artifactrsh *model.ArtifactTrash) (id int64, err error)
	// Delete ...
	Delete(ctx context.Context, id int64) (err error)
	// Filter lists the artifact that needs to be cleaned, which creation_time is not in the time window.
	// The unit of timeWindow is hour, the represent cut-off is time.now() - timeWindow * time.Hours
	Filter(ctx context.Context, timeWindow int64) (arts []model.ArtifactTrash, err error)
	// Flush cleans the trash table record, which creation_time is not in the time window.
	// The unit of timeWindow is hour, the represent cut-off is time.now() - timeWindow * time.Hours
	Flush(ctx context.Context, timeWindow int64) (err error)
}

Manager is the only interface of artifact module to provide the management functions for artifacts

func NewManager

func NewManager() Manager

NewManager returns an instance of the default manager

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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