Documentation
¶
Index ¶
- Variables
- func Exists(file string) bool
- func GetEnv() string
- func ReadFile(file string, obj interface{}) ([]byte, error)
- func ReadFileLines(file string) ([]string, error)
- func WriteFile(file string, obj interface{}) error
- type AppConfig
- type Event
- type FileInfo
- type Operation
- type Watcher
- func (w *Watcher) AddExcluded(excluded ...string) *Watcher
- func (w *Watcher) AddExtension(extensions ...string) *Watcher
- func (w *Watcher) AddWatch(watchs ...string) *Watcher
- func (w *Watcher) Reconfigure(options ...WatcherOption)
- func (w *Watcher) Start(waitGroup ...*sync.WaitGroup) error
- func (w *Watcher) Started() bool
- func (w *Watcher) Stop(waitGroup ...*sync.WaitGroup) error
- type WatcherConfig
- type WatcherOption
- func WithConfiguration(config *WatcherConfig) WatcherOption
- func WithEventChannel(event chan *Event) WatcherOption
- func WithLogLevel(level logger.Level) WatcherOption
- func WithLogger(logger logger.ILogger) WatcherOption
- func WithManager(mgr *manager.Manager) WatcherOption
- func WithQuitChannel(quit chan int) WatcherOption
- func WithReloadTime(reloadTime int64) WatcherOption
Constants ¶
This section is empty.
Variables ¶
View Source
var Changed = true
Functions ¶
func ReadFileLines ¶
Types ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
func NewWatcher(options ...WatcherOption) *Watcher
func (*Watcher) AddExcluded ¶
func (*Watcher) AddExtension ¶
func (*Watcher) Reconfigure ¶
func (w *Watcher) Reconfigure(options ...WatcherOption)
Reconfigure ...
type WatcherConfig ¶
type WatcherConfig struct {
ReloadTime int64 `json:"reload_time"`
Dirs struct {
Watch []string `json:"watch"`
Excluded []string `json:"excluded"`
Extensions []string `json:"extensions"`
} `json:"dirs"`
Log struct {
Level string `json:"level"`
} `json:"log"`
}
WatcherConfig ...
type WatcherOption ¶
type WatcherOption func(watcher *Watcher)
WatcherOption ...
func WithConfiguration ¶
func WithConfiguration(config *WatcherConfig) WatcherOption
WithConfiguration ...
Click to show internal directories.
Click to hide internal directories.