clean

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: BSD-3-Clause Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartCleanTimer

func StartCleanTimer(ctx context.Context, data *TimerData) (<-chan struct{}, error)

Types

type Cleaner

type Cleaner interface {
	Clean(ID string) error
}

type CleanerGroup

type CleanerGroup struct {
	Jobs []Cleaner
}

func (*CleanerGroup) Clean

func (c *CleanerGroup) Clean(ID string) error

type LocalFile

type LocalFile struct {
	// contains filtered or unexported fields
}

func NewFileCleaners

func NewFileCleaners(fs string, patterns []string) ([]*LocalFile, error)

func NewLocalFile

func NewLocalFile(storagePath string, pattern string) (*LocalFile, error)

func (*LocalFile) Clean

func (fs *LocalFile) Clean(ID string) error

type OldIDsProvider

type OldIDsProvider interface {
	GetExpired() ([]string, error)
}

OldIDsProvider return old ids for cleaning service

type TimerData

type TimerData struct {
	RunEvery    time.Duration
	Cleaner     Cleaner
	IDsProvider OldIDsProvider
}

Jump to

Keyboard shortcuts

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