internal

package
v0.0.0-...-35faee6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoCleanDir

func AutoCleanDir(rules Rules, cache FileExtToDirMap) error

func Watch

func Watch(rules Rules, cache FileExtToDirMap, watcher *fsnotify.Watcher) error

Types

type FileExtToDirMap

type FileExtToDirMap map[string]string

Example: "png" -> "/home/user/Pictures"

func CacheMoveDirectories

func CacheMoveDirectories(move []MoveDir) FileExtToDirMap

Maps the move input from Rules struct to FileExtToDirMap.

type MoveDir

type MoveDir struct {
	Path Path     `json:"path"`
	Ext  []string `json:"ext"`
}

type Path

type Path string

type Rules

type Rules struct {
	Watch   []WatchDir `json:"watch"`
	Move    []MoveDir  `json:"move"`
	Unknown Path       `json:"unknown"`
}

func Parse

func Parse(path string) (Rules, error)

Parses a rules.json file.

type WatchDir

type WatchDir Path

Jump to

Keyboard shortcuts

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