watch

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OneRunCmd = cli.Command{
	Name:    "one",
	Aliases: []string{"1"},
	Usage:   "runs the pipeline once and exits",
	Action:  oneRun,
	Flags:   []cli.Flag{},
}

OneRunCmd is the command to run a pipeline once.

View Source
var WatchCmd = cli.Command{
	Name:   "watch",
	Usage:  "starts watching folder(s)",
	Action: watchIt,
	Flags:  []cli.Flag{},
}

WatchCmd is the command that starts a watching files in the project folder and triggers the pipeline once a relevant change did happen.

Functions

This section is empty.

Types

type FSNotifyTracker added in v0.0.2

type FSNotifyTracker struct {
	// contains filtered or unexported fields
}

FSNotifyTracker is a tracker that uses FSNotify.

func (*FSNotifyTracker) Add added in v0.0.2

func (t *FSNotifyTracker) Add(path string) error

Add adds a path to the list of tracked paths

func (*FSNotifyTracker) Close added in v0.0.2

func (t *FSNotifyTracker) Close() error

Close stops all watching and event publication of this tracker.

func (*FSNotifyTracker) Errors added in v0.0.2

func (t *FSNotifyTracker) Errors() chan error

Errors returns a channel that will return all errors issued by this tracker.

func (*FSNotifyTracker) Events added in v0.0.2

func (t *FSNotifyTracker) Events() chan fsnotify.Event

Events returns a channel that will deliver all events issued by this tracker.

func (*FSNotifyTracker) IsTracked added in v0.0.2

func (t *FSNotifyTracker) IsTracked(path string) bool

IsTracked determines whether the passed path is tracked (true) or not (false).

func (*FSNotifyTracker) Remove added in v0.0.2

func (t *FSNotifyTracker) Remove(path string)

Remove removes the handed path from the tracker.

func (*FSNotifyTracker) Tracked added in v0.0.2

func (t *FSNotifyTracker) Tracked() []string

Tracked returns all paths that this tracker will report changes on.

type Tracker

type Tracker interface {
	Tracked() []string
	Add(p string) error
	IsTracked(p string) bool
	Remove(path string)
	Events() chan fsnotify.Event
	Errors() chan error
	Close() error
}

Tracker keeps track of file system changes, and let's you control what it monitors.

func NewTracker

func NewTracker(cfg *c.Config) Tracker

NewTracker returns a new tracker based on the config passed.

Jump to

Keyboard shortcuts

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