Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicatePath = errors.New("duplicate path") ErrPathNotFound = errors.New("path not found") )
Functions ¶
Types ¶
type ModTimeMonitor ¶
type ModTimeMonitor struct {
sync.RWMutex // used to synchronize changes to the set of paths being monitored
// contains filtered or unexported fields
}
ModTimeMonitor monitors the modtimes for a set of paths in a filesystem
func NewModTimeMonitor ¶
func NewModTimeMonitor(ctx context.Context, opts ...Option) *ModTimeMonitor
NewModTimeMonitor returns a new ModTimeMonitor with a background monitoring thread already started
func (*ModTimeMonitor) AddMonitoredPath ¶
func (mtm *ModTimeMonitor) AddMonitoredPath(strategyStr, pathStr string, opts ...Option) error
AddMonitoredPath adds a path to be monitored for modtime changes
func (*ModTimeMonitor) GetPathStatus ¶
func (mtm *ModTimeMonitor) GetPathStatus(strategyStr, pathStr string) (*PathStatus, error)
GetPathStatus returns the current status of a monitored path
type Option ¶
type Option func(*mtmOptions)
func WithCheckInterval ¶
WithCheckInterval is the option to set the check interval (how often to check modtimes)
func WithErrLogger ¶ added in v1.7.0
WithErrLogger is the option to set the Logger
func WithLogger ¶
WithLogger is the option to set the Logger
func WithStatFS ¶
WithStatFS is the option to set the Stat FileSystem
Click to show internal directories.
Click to hide internal directories.