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
Click to show internal directories.
Click to hide internal directories.