poller

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorHandler

type ErrorHandler func(e PollerError)

type EventHandler

type EventHandler func(e PollerEvent)

type Poller

type Poller struct {
	Events chan PollerEvent

	Errors chan PollerError
	// contains filtered or unexported fields
}

func NewPollWatcher

func NewPollWatcher(
	interval int,
) *Poller

func (*Poller) Add

func (pw *Poller) Add(dir string)

func (*Poller) AddPath

func (pw *Poller) AddPath(path string)

func (*Poller) IgnorePath

func (pw *Poller) IgnorePath(path string)

func (*Poller) IgnorePattern

func (pw *Poller) IgnorePattern(pattern string) error

func (*Poller) OnError

func (pw *Poller) OnError(fn func(e PollerError))

func (*Poller) OnEvent

func (pw *Poller) OnEvent(fn func(e PollerEvent))

func (*Poller) Start

func (pw *Poller) Start()

func (*Poller) Stop

func (pw *Poller) Stop()

func (*Poller) Wait

func (pw *Poller) Wait() chan struct{}

type PollerError

type PollerError error

type PollerEvent

type PollerEvent struct {
	Path string
}

Jump to

Keyboard shortcuts

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