shrink

package
v0.0.0-...-613c932 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRemoveDirNames []string = []string{
	"test",
	"tests",
	"example",
	"examples",
}
View Source
var DefaultRemoveFileExt []string = []string{
	".ts",
	".d.ts",
	".coffee",
}
View Source
var DefaultRemoveFileNames []string = []string{
	"package.json",
}
View Source
var NotExistError error = errors.New("path doesn`t exist")

Functions

This section is empty.

Types

type Config

type Config struct {
	VerboseOutput  bool
	DryRun         bool
	ConcurentLimit int
	CheckPath      string
	RemoveFileExt  []string
	ExcludeNames   []string
	IncludeNames   []string
}

type Filter

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

func NewFilter

func NewFilter(includeNames, excludeNames, includeExtenstions []string) *Filter

func (*Filter) Check

func (f *Filter) Check(de FileInfoI) (bool, error)

Checks is provided file need to removed or not

type Logger

type Logger interface {
	Infof(format string, a ...interface{})
	Infoln(a ...interface{})
}

type Shrinker

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

func NewShrinker

func NewShrinker(cfg *Config) (*Shrinker, error)

func (*Shrinker) Clean

func (sh *Shrinker) Clean(ctx context.Context) (stats *FileStat)

func (*Shrinker) DryRun

func (sh *Shrinker) DryRun(ctx context.Context) (stats *FileStat)

Jump to

Keyboard shortcuts

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