Documentation
¶
Index ¶
Constants ¶
View Source
const (
// The default value of the time in milliseconds that elapses between each time the fs events are polled (and the handlers triggered)
DefaultPollIntervalMs = 1000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandParams ¶
Values that will be replaced into a command
func NewCommandParams ¶
func NewCommandParams(fileName string) (CommandParams, error)
type Config ¶
type Config struct {
// The directories that will be watched for file events
Directories []string `json:"directories"`
// The time in milliseconds that elapses between each time the fs events are polled (and the handlers triggered)
PollIntervalMs uint `json:"pollIntervalMs"`
// The handlers that will listen for file events
Handlers []FileHandlerConfig `json:"handlers"`
}
func (*Config) FillInDefaults ¶
func (self *Config) FillInDefaults()
Set the values that were omitted to their default values
type FileHandler ¶
type FileHandler interface {
FileHandlerTrigger
Execute(filePath string) error
}
func NewFileHandler ¶
func NewFileHandler(config FileHandlerConfig) (FileHandler, error)
type FileHandlerConfig ¶
type FileHandlerConfig struct {
// The name of this handler
Name string `json:"name"`
// The command that will be executed when this handler is triggered
Command []string `json:"command"`
// A list of extensions that will trigger this handler
Extensions []string `json:"extensions"`
// A list of files that will be watched for changes
Files []string `json:"files"`
// A regex that will trigger this handler
Regex string `json:"regex"`
// Wether stdout of the command should be written to stdout
PrintStdOut bool `json:"printStdOut"`
// Wether stderr of the command should be written to stderr
PrintStdErr bool `json:"printStdErr"`
}
Configuration for a file handler
func (*FileHandlerConfig) FillInDefaults ¶
func (self *FileHandlerConfig) FillInDefaults()
type FileHandlerTrigger ¶
Click to show internal directories.
Click to hide internal directories.