func NewMonitor(rootDir string, rules []*Rule, recursive bool, checkFrequencySeconds int) (*Monitor, error) {
	if rootDir == "" {
		return nil, errors.New("invalid root directory")
	}

	if checkFrequencySeconds == 0 {
		return nil, errors.New("check frequency cannot be 0")
	}

	dir, err := homedir.Expand(rootDir)
	if err != nil {
		return nil, err
	}

	return &Monitor{
		RootDirectory:         dir,
		Rules:                 rules,
		Recursive:             recursive,
		CheckFrequencySeconds: checkFrequencySeconds,
		log:                   logrus.WithField("component", "monitor"),
	}, nil
}
// NewMonitor initializes & returns a monitor object.
NewMonitor initializes & returns a monitor object.
// NewMonitor initializes & returns a monitor object .
func NewMonitor(rootDir string, rules []*Rule, recursive bool, checkFrequencySeconds int) (*Monitor, error) {
	if rootDir == "" {
		return nil, errors.New("invalid root directory")
	}
	if checkFrequencySeconds == 0 {
		return nil, errors.New("check frequency cannot be 0")
	}
	dir, err := homedir.Expand(rootDir)
	if err != nil {
		return nil, err
	}
	return &Monitor{
		RootDirectory:         dir,
		Rules:                 rules,
		Recursive:             recursive,
		CheckFrequencySeconds: checkFrequencySeconds,
		log:                   logrus.WithField("component", "monitor"),
	}, nil
}
func NewMonitor ( rootDir string , rules [ ] * Rule , recursive bool , checkFrequencySeconds int ) ( * Monitor , error ) { if rootDir == " " { return nil , errors . New ( " " ) } if checkFrequencySeconds == 0 { return nil , errors . New ( " " ) } dir , err := homedir . Expand ( rootDir ) if err != nil { return nil , err } return & Monitor { RootDirectory : dir , Rules : rules , Recursive : recursive , CheckFrequencySeconds : checkFrequencySeconds , log : logrus . WithField ( " " , " " ) , } , nil }
NewMonitor initializes & returns a monitor object.
NewMonitor initializes & returns a monitor object .