fastdfs_cleaner

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanerLoggerProxy added in v0.0.7

func CleanerLoggerProxy(logFile *os.File, level logger.LogLevel) func(cleaner Cleaner) Cleaner

func SetConfigFilePath

func SetConfigFilePath(path string)

func StorageLoggerProxy added in v0.0.7

func StorageLoggerProxy(logFile *os.File, level logger.LogLevel) func(storage Storage) Storage

Types

type Cleaner

type Cleaner interface {
	Clean() error
}

func NewCleaner

func NewCleaner(poolCap, cleanThreshold int, rmr remover, storage Storage) Cleaner

func NewCleanerFromConfig

func NewCleanerFromConfig() Cleaner

func NewCleanerFromConfigWithLogger added in v0.0.7

func NewCleanerFromConfigWithLogger(logFile *os.File, level logger.LogLevel) Cleaner

type Config

type Config struct {
	TaskPoolCap        int    `yaml:"TaskPoolCap"`
	CleanThreshold     int    `yaml:"CleanThreshold"`
	LogDir             string `yaml:"LogDir"`
	FastDfsStoragePath string `yaml:"FastDfsStoragePath"`
	DBType             string `yaml:"DBType"`
	DatabaseName       string `yaml:"DatabaseName"`
	TableName          string `yaml:"TableName"`
	//Fields []string `yaml:"Fields,flow"`
	IndexField string `yaml:"IndexField"`
	Field      string `yaml:"Field"`
	Username   string `yaml:"Username"`
	Password   string `yaml:"Password"`
	IPAddr     string `yaml:"IPAddr"`
	ListenPort uint   `yaml:"ListenPort"`
	Protocol   string `yaml:"Protocol"`
}

func GetSingletonConfigInstance

func GetSingletonConfigInstance() *Config

type GarbageInfo

type GarbageInfo interface {
	GetFilePath() string
	GetIndex() string
}

type GarbageInfosQueue

type GarbageInfosQueue interface {
	Size() int
	Append(info GarbageInfo)
	Pop() GarbageInfo
	IsEmpty() bool
}

func NewGarbageInfosQueue

func NewGarbageInfosQueue() GarbageInfosQueue

type Storage

type Storage interface {
	RemoveGarbageInfo(info GarbageInfo)
	GetAllGarbageInfo() []GarbageInfo
}

func NewMySQLStorageFromConfig

func NewMySQLStorageFromConfig() Storage

Jump to

Keyboard shortcuts

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