watcher

package
v0.0.0-...-00235aa Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package watcher Status data type

Package watcher defines the type that watches the files for changes matching a pattern in a file structure on an interval

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunSystemCommand

func RunSystemCommand(c string) error

RunSystemCommand runs the command and display the output during the execution Can be used by client when wrapped in anonymous func

Types

type Status

type Status struct {
	Type    StatusType
	File    string
	Message string
}

Status data type hold info about one watched file

type StatusType

type StatusType int

StatusType is the status of a watched file

const (
	StatusNone StatusType = iota
	StatusInfo
	StatusModified
	StatusDeleted
	StatusAdded
)

Statuses of StatusType

type Watcher

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

Watcher data type

func New

func New(p *regexp.Regexp, c func(), recursive bool, i time.Duration, ch chan Status) Watcher

New creates a new Watcher

func NewDefault

func NewDefault(p *regexp.Regexp, c func()) Watcher

NewDefault creates an new Watcher with default values

func (Watcher) Watch

func (w Watcher) Watch()

Watch watches for changes and execute command

Jump to

Keyboard shortcuts

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