files

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Other    = "other"
	Image    = "image"
	Video    = "video"
	Audio    = "audio"
	Media    = "media"
	Archive  = "archive"
	ZipLike  = "zip"
	Code     = "code"
	Conf     = "conf"
	Docs     = "docs"
	OtherDev = "odev"

	MaskFile uint32 = 1 << iota
	MaskDirectory
	MaskImage
	MaskVideo
	MaskAudio
	MaskArchive
	MaskZipLike = 1<<iota + MaskArchive
	MaskCode    = 1 << iota
	MaskConf
	MaskDocs
	MaskOtherDev
)

Variables

View Source
var CntMasks = map[uint32][]string{
	MaskImage:    {".jpg", ".jpeg", ".png", ".apng", ".gif", ".bmp", ".webp", ".avif", ".jxl", ".tiff"},
	MaskVideo:    {".mp4", ".m4v", ".webm", ".mkv", ".avi", ".mov", ".mpg", ".mpeg"},
	MaskAudio:    {".m4a", ".opus", ".ogg", ".mp3", ".flac", ".wav", ".aac"},
	MaskArchive:  {".zip", ".rar", ".7z", ".tar", ".gz", ".bz2", ".xz", ".lz4", ".zst", ".lzma", ".lzip", ".lz", ".cbz"},
	MaskZipLike:  {".zip", ".cbz", ".cbr"},
	MaskCode:     {".go", ".c", ".h", ".cpp", ".hpp", ".rs", ".py", ".js", ".ts", ".html", ".css", ".scss", ".java", ".php"},
	MaskConf:     {".json", ".toml", ".yaml", ".yml", ".xml", ".ini", ".cfg", ".conf", ".properties", ".env"},
	MaskDocs:     {".pdf", ".epub", ".mobi", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".odt", ".ods", ".odp", ".txt", ".rtf", ".csv", ".tsv", ".md"},
	MaskOtherDev: {".sql", ".sh", ".bat", ".cmd", ".ps1", ".psm1", ".psd1", ".ps1xml", ".pssc", ".psc1", ".pssc", ".psh"},
}
View Source
var ExtToMaskMap = map[string]uint32{}
View Source
var Hide = map[string]bool{
	"Thumbs.db":                 true,
	"desktop.ini":               true,
	"Icon\r":                    true,
	"System Volume Information": true,
	"$RECYCLE.BIN":              true,
	"lost+found":                true,
	"node_modules":              true,
	"WindowsApps":               true,
}

Hide contains commonly unwanted files and directories. Any beginning with a dot hidden by default.

Functions

func AsMask

func AsMask(sar []string) uint32

func Mask

func Mask(ext string) uint32

func RegisterMasks

func RegisterMasks(mask uint32, keys ...string)

func ShouldIgnore

func ShouldIgnore(name string) bool

func StrToMask

func StrToMask(str string) uint32

Types

This section is empty.

Jump to

Keyboard shortcuts

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