sweeper

package
v1.7.6 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareDBSweep

func PrepareDBSweep() error

PrepareDBSweep invoked after DB init

func WaitingDBInit

func WaitingDBInit()

WaitingDBInit waiting DB init

Types

type DBSweeper

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

DBSweeper is used to sweep the DB logs

func NewDBSweeper

func NewDBSweeper(duration int) *DBSweeper

NewDBSweeper is constructor of DBSweeper

func (*DBSweeper) Duration

func (dbs *DBSweeper) Duration() int

Duration for sweeping

func (*DBSweeper) Sweep

func (dbs *DBSweeper) Sweep() (int, error)

Sweep logs

type FileSweeper

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

FileSweeper is used to sweep the file logs

func NewFileSweeper

func NewFileSweeper(workDir string, duration int) *FileSweeper

NewFileSweeper is constructor of FileSweeper

func (*FileSweeper) Duration

func (fs *FileSweeper) Duration() int

Duration for sweeping

func (*FileSweeper) Sweep

func (fs *FileSweeper) Sweep() (int, error)

Sweep logs

type Interface

type Interface interface {
	// Sweep the outdated log entries if necessary
	//
	// If failed, an non-nil error will return
	// If succeeded, count of sweepped log entries is returned
	Sweep() (int, error)

	// Return the sweeping duration with day unit.
	Duration() int
}

Interface defines the operations a sweeper should have

Jump to

Keyboard shortcuts

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