watch

package
v0.0.0-...-3e883f0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2017 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileChangedCallback

type FileChangedCallback interface {
	FileChanged(string)
}

Called on file change directories won't recieve this callback

type FileCreatedCallback

type FileCreatedCallback interface {
	FileCreated(string)
}

Called on a file or directory is created

type FileRemovedCallback

type FileRemovedCallback interface {
	FileRemoved(string)
}

Called on a file or directory is removed

type FileRenamedCallback

type FileRenamedCallback interface {
	FileRenamed(string)
}

Called when a directory or file is renamed TODO: fsnotify behavior after rename is obscure if we have foo dir with a bar file inside and we are watching foo dir, on renaming foo to boo we will get rename event for foo dir but if we delete boo/bar we will get remove event for foo/bar not boo/bar

type Watcher

type Watcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Wrapper around fsnotify watcher to suit lime needs

  • Watching directories, we will have less individual watchers
  • Have multiple subscribers on single file or directory
  • Watching a path which doesn't exist yet
  • Watching and applying action on certain events

func NewWatcher

func NewWatcher() (*Watcher, error)

func (*Watcher) Close

func (w *Watcher) Close()

func (*Watcher) UnWatch

func (w *Watcher) UnWatch(name string, cb interface{}) error

func (*Watcher) Watch

func (w *Watcher) Watch(name string, cb interface{}) error

Jump to

Keyboard shortcuts

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