Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler is a pointer to handler function that users of 'watch' package can register. It will be called on the event of any operation, 'op', on the watched files, 'fileName'.
type Op ¶
type Op uint32
Op represents the file-operations to watch for. E.g., create, write, remove, rename, etc.
const ( // Create represents the event when a file is created in watched // directory. Create Op = iota // Write represents the event when a watched file is written to. Write // Remove represents the event when a watched file is deleted. Remove // Rename represents the event when a watched file is renamed. Rename // Chmod represents the event when a watched file's premissions are // changed. Chmod // Tbi represents the events that are yet to be supported. Tbi )
type Watch ¶
type Watch struct { // Directories to watch. Dirs []string // Commands to exectue on watched files. Cmds []string // Regex to apply to filter watched file names. Regex string // Watch directories recursively? Recursive bool // HandlerCB function to call on file-change events. HandlerCB Handler // contains filtered or unexported fields }
Watch represents watcher configuration: dirctories, commands to execute, file types, etc.
Click to show internal directories.
Click to hide internal directories.