Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CallbackMap = map[notify.Event]Event{ notify.InCloseWrite: InCloseWrite, notify.InModify: InModify, notify.InMovedTo: InMovedTo, notify.InMovedFrom: InMovedFrom, notify.InCreate: InCreate, notify.InDelete: InDelete, notify.Write: Write, notify.Create: Create, notify.Remove: Remove, notify.Rename: Rename, }
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { RootPath string `toml:"root_path"` PreExec string `toml:"pre_exec"` ExecCommand string `toml:"exec_command"` PostExec string `toml:"post_exec"` // Ignore uses a custom unmarshaler see ignore.go Ignore Ignore `toml:"ignore"` LogLevel string `toml:"log_level"` Debounce int `toml:"debounce"` Callback func(*EventCallback) EventHandle Slog *slog.Logger ExternalSlog bool }
type Engine ¶
type Engine struct { Process *process.Process Chan chan notify.EventInfo Active bool Config Config `toml:"config"` ProcessLogFile *os.File ProcessLogPipe io.ReadCloser }
func NewEngineFromConfig ¶
func NewEngineFromTOML ¶
type Event ¶
type Event int
const ( Create Event = iota Write Remove Rename // Windows Specific Actions ActionModified ActionRenamedNewName ActionRenamedOldName ActionAdded ActionRemoved ChangeLastWrite ChangeAttributes ChangeSize ChangeDirName ChangeFileName ChangeSecurity ChangeCreation ChangeLastAccess // Linux Specific Actions InCloseWrite InModify InMovedTo InMovedFrom InCreate InDelete )
Event is used to determine what type of event was triggered
type EventCallback ¶
type EventCallback struct { Type Event // Event enum Time time.Time // time.Now() when event was triggered Path string // Full path to the modified file }
Called whenever a change is detected in the filesystem By default we ignore file rename/remove and a bunch of other events that would likely cause breaking changes on a reload see eventmap_[oos].go for default rules
type EventHandle ¶ added in v0.0.25
type EventHandle int
const ( EventContinue EventHandle = iota EventBypass EventIgnore )
EventHandle is used to determine how to handle a reload callback
Click to show internal directories.
Click to hide internal directories.