Documentation
¶
Index ¶
Constants ¶
View Source
const (
PluginName string = "reload"
)
PluginName contains default plugin name.
Variables ¶
This section is empty.
Functions ¶
func ConvertIgnored ¶
ConvertIgnored is used to convert slice to map with ignored files
Types ¶
type Config ¶
type Config struct {
// Interval is a global refresh interval
Interval time.Duration `mapstructure:"interval"`
// Patterns is a global file patterns to watch. It will be applied to every directory in project
Patterns []string `mapstructure:"patterns"`
// Plugins is set of services which would be reloaded in case of FS changes
Plugins map[string]ServiceConfig `mapstructure:"services"`
}
Config is a Reload configuration point.
func (*Config) InitDefaults ¶
func (c *Config) InitDefaults()
InitDefaults sets missing values to their default values.
type Configurer ¶
type Event ¶
An Event describes an event that is received when files or directory changes occur. It includes the os.FileInfo of the changed file or directory and the type of event that's occurred and the full path of the file.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) CollectResettable ¶
type ServiceConfig ¶
type ServiceConfig struct {
// Recursive is options to use nested files from root folder
Recursive bool `mapstructure:"recursive"`
// Patterns is per-service specific files to watch
Patterns []string `mapstructure:"patterns"`
// Dirs is per-service specific dirs which will be combined with Patterns
Dirs []string `mapstructure:"dirs"`
// Ignore is set of files which would not be watched
Ignore []string `mapstructure:"ignore"`
}
type SimpleHook ¶
SimpleHook is used to filter by simple criteria, CONTAINS
type Watcher ¶
type Watcher struct {
// main event channel
Event chan Event
// contains filtered or unexported fields
}
func NewWatcher ¶
NewWatcher returns new instance of File Watcher
type WatcherConfig ¶
type WatcherConfig struct {
// service name
ServiceName string
// Recursive or just add by singe directory
Recursive bool
// Directories used per-service
Directories []string
// simple hook, just CONTAINS
FilterHooks func(filename string, pattern []string) error
// path to file with Files
Files map[string]os.FileInfo
// Ignored Directories, used map for O(1) amortized get
Ignored map[string]struct{}
// FilePatterns to ignore
FilePatterns []string
}
Click to show internal directories.
Click to hide internal directories.