file

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Op   Op
	Path string
}

Event decsribes a file change event

type Filter

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

Filter matches filepaths to a list of patterns

func NewFilter

func NewFilter(rootDir string, patterns []string, files []string) (Filter, error)

NewFilter will create a new file path filter

func (Filter) Match

func (f Filter) Match(path string) bool

Match will return true if the file path has matched a pattern in this filter

type Op

type Op int

Op describes the different types of file operations

const (
	// Update is a file op where the file is updated
	Update Op = iota
	// Remove is a file op where the file is removed
	Remove
)

type Watcher

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

Watcher is the object used to watch files for change and notify on any events, these events can then be passed along to kit to be sent to shopify.

func NewWatcher

func NewWatcher(e *env.Env, configPath string) (*Watcher, error)

NewWatcher will create a new file change watching for a a given directory defined in an environment

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop will stop the Watcher from watching it's directories and clean up any go routines doing work.

func (*Watcher) Watch

func (w *Watcher) Watch() (chan Event, error)

Watch will start the watcher actually receiving file change events and sending events to the Events channel

Jump to

Keyboard shortcuts

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