watch

package
v2.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(changed []string, deleted []string) error

Callback is the function type

type Watcher

type Watcher struct {
	Paths        []string
	PollInterval time.Duration
	FileMap      map[string]os.FileInfo
	Callback     Callback
	Log          log.Logger
	// contains filtered or unexported fields
}

Watcher is the struct that contains the watching information

func New

func New(paths []string, callback Callback, log log.Logger) (*Watcher, error)

New watches a given glob paths array for changes

func (*Watcher) Start

func (w *Watcher) Start()

Start starts the watching process every second

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop stopps the watcher

func (*Watcher) Update

func (w *Watcher) Update() ([]string, []string, error)

Update updates the filemap and returns if there was a change

Jump to

Keyboard shortcuts

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