watching

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2015 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Create = 1
	Modify = 2
	Remove = 3
	Rename = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DirEvent

type DirEvent interface {
	Describe() string
	Name() string
	Directory() string
	Operations() []int
}

Dir event leaves the consumer with rescanning given directories for the actual changes, cross platform changes on the file level cannot be guaranteed

type Error

type Error interface {
	Describe() string
	Error() error
}

A Generic interface that represents a significant named error in time with a human readable description

type GenericError

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

Unspecified generic error

func (*GenericError) Describe

func (e *GenericError) Describe() string

func (*GenericError) Error

func (e *GenericError) Error() error

type Monitor

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

func NewMonitor

func NewMonitor(dir string) (*Monitor, error)

func (*Monitor) Directory

func (m *Monitor) Directory() string

func (*Monitor) Emit

func (m *Monitor) Emit(ev DirEvent)

func (*Monitor) Errors

func (m *Monitor) Errors() chan Error

func (*Monitor) Events

func (m *Monitor) Events() chan DirEvent

func (*Monitor) Start

func (m *Monitor) Start() error

func (*Monitor) Stop

func (m *Monitor) Stop() error

func (*Monitor) Throw

func (m *Monitor) Throw(err Error)

type MonitorError

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

Errors emitted by the monitor concrete implementation

func NewMonitorError

func NewMonitorError(err error, ctx string) *MonitorError

func (*MonitorError) Describe

func (e *MonitorError) Describe() string

func (*MonitorError) Error

func (e *MonitorError) Error() error

func (*MonitorError) Time

func (e *MonitorError) Time() time.Time

type MonitorEvent

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

Events emitted by the monitor concrete implementation

func NewMonitorEvent

func NewMonitorEvent(root, dir, file string, ops []int) *MonitorEvent

func (*MonitorEvent) Describe

func (e *MonitorEvent) Describe() string

func (*MonitorEvent) Directory

func (e *MonitorEvent) Directory() string

func (*MonitorEvent) Name

func (e *MonitorEvent) Name() string

func (*MonitorEvent) Operations

func (e *MonitorEvent) Operations() []int

func (*MonitorEvent) Time

func (e *MonitorEvent) Time() time.Time

type Watcher

type Watcher interface {
	Events() chan DirEvent
	Errors() chan Error

	//
	// Start watching the provided directory
	//
	Start() error

	//
	// return the (root) directory we are watching
	//
	Directory() string

	//
	// Stop watching the directory
	//
	Stop() error
}

Watcher interface specifies an watcher that returns a channel of watching events when started

Jump to

Keyboard shortcuts

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