watch

package
v2.4.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: Apache-2.0 Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPaths

func GetPaths() []string

GetPaths retrieves the watch paths from the config object

Types

type Callback

type Callback func() error

Callback is the function type

type Watcher

type Watcher struct {
	Paths    []string
	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() (bool, 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