vfswatchdog

package
v0.3.71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const EventOnFile = "on_file"
View Source
const EventOnNewFile = "on_new_file"

Variables

This section is empty.

Functions

func BuildFileKey

func BuildFileKey(hash, schema, path string) string

Types

type HistoryExistsHook

type HistoryExistsHook func(key string) (response bool)

type Watchdog

type Watchdog struct {
	// contains filtered or unexported fields
}

The Watchdog represents a monitoring utility designed to observe and respond to specific system or application conditions. EVENTS: The Watchdog emits 2 events: - on_new_file: each time a NEW file is read from internal daemon - on_file: each time a file is read from internal daemon

func NewWatchdog

func NewWatchdog(root string, args ...any) (instance *Watchdog, err error)

func (*Watchdog) HasHistoryHook added in v0.3.71

func (instance *Watchdog) HasHistoryHook() bool

func (*Watchdog) History

func (instance *Watchdog) History() *WatchdogHistory

func (*Watchdog) Join

func (instance *Watchdog) Join()

func (*Watchdog) Map

func (instance *Watchdog) Map() (response map[string]interface{})

func (*Watchdog) OnFile

func (instance *Watchdog) OnFile(callback func(event *gg_events.Event)) *Watchdog

func (*Watchdog) OnNewFile

func (instance *Watchdog) OnNewFile(callback func(event *gg_events.Event)) *Watchdog

func (*Watchdog) Reset

func (instance *Watchdog) Reset() *Watchdog

func (*Watchdog) SetHistoryFileName

func (instance *Watchdog) SetHistoryFileName(value string) *Watchdog

SetHistoryFileName sets the filename for the internal history management of the Watchdog instance.

func (*Watchdog) SetHistoryHook

func (instance *Watchdog) SetHistoryHook(f HistoryExistsHook) *Watchdog

SetHistoryHook sets a custom function as a hook to validate file unique keys and disables internal history management.

func (*Watchdog) Start

func (instance *Watchdog) Start() (err error)

func (*Watchdog) Stop

func (instance *Watchdog) Stop()

func (*Watchdog) String

func (instance *Watchdog) String() (response string)

type WatchdogEventData

type WatchdogEventData struct {
	Key     string
	VFS     vfscommons.IVfs
	VFSUid  string
	FsElem  *gg_vfs.VfsFile
	Payload map[string]interface{}
}

func (*WatchdogEventData) Base64

func (instance *WatchdogEventData) Base64() (response string)

func (*WatchdogEventData) Content

func (instance *WatchdogEventData) Content() (response []byte)

func (*WatchdogEventData) Dir

func (instance *WatchdogEventData) Dir() (response string)

func (*WatchdogEventData) Ext

func (instance *WatchdogEventData) Ext() (response string)

func (*WatchdogEventData) Filename

func (instance *WatchdogEventData) Filename() (response string)

func (*WatchdogEventData) Map

func (instance *WatchdogEventData) Map() (response map[string]interface{})

func (*WatchdogEventData) Name

func (instance *WatchdogEventData) Name() (response string)

func (*WatchdogEventData) Path

func (instance *WatchdogEventData) Path() (response string)

func (*WatchdogEventData) Schema

func (instance *WatchdogEventData) Schema() (response string)

func (*WatchdogEventData) Size

func (instance *WatchdogEventData) Size() (response int64)

func (*WatchdogEventData) Tags

func (instance *WatchdogEventData) Tags() (response []string)

func (*WatchdogEventData) Text

func (instance *WatchdogEventData) Text() (response string)

type WatchdogHistory

type WatchdogHistory struct {
	// contains filtered or unexported fields
}

func NewWatchdogHistory

func NewWatchdogHistory(dir string) (instance *WatchdogHistory, err error)

func (*WatchdogHistory) Add

func (instance *WatchdogHistory) Add(key string) (success bool)

func (*WatchdogHistory) Assert

func (instance *WatchdogHistory) Assert() (response bool)

func (*WatchdogHistory) Clear

func (instance *WatchdogHistory) Clear()

func (*WatchdogHistory) Delete

func (instance *WatchdogHistory) Delete(key string)

func (*WatchdogHistory) Exists

func (instance *WatchdogHistory) Exists(key string) bool

func (*WatchdogHistory) Get

func (instance *WatchdogHistory) Get(key string) interface{}

func (*WatchdogHistory) Items

func (instance *WatchdogHistory) Items() (response map[string]interface{})

func (*WatchdogHistory) Keys

func (instance *WatchdogHistory) Keys() []string

func (*WatchdogHistory) Len

func (instance *WatchdogHistory) Len() int

func (*WatchdogHistory) Reload

func (instance *WatchdogHistory) Reload() (err error)

func (*WatchdogHistory) Save

func (instance *WatchdogHistory) Save() (err error)

func (*WatchdogHistory) SetFileName

func (instance *WatchdogHistory) SetFileName(value string)

func (*WatchdogHistory) Values

func (instance *WatchdogHistory) Values() []interface{}

type WatchdogTask

type WatchdogTask struct {
	// contains filtered or unexported fields
}

func NewWatchdogTask

func NewWatchdogTask(args ...any) (instance *WatchdogTask, err error)

func (*WatchdogTask) Payload

func (instance *WatchdogTask) Payload() (response map[string]interface{})

func (*WatchdogTask) Start

func (instance *WatchdogTask) Start()

func (*WatchdogTask) Stop

func (instance *WatchdogTask) Stop()

func (*WatchdogTask) String

func (instance *WatchdogTask) String() (response string)

func (*WatchdogTask) Uid

func (instance *WatchdogTask) Uid() (response string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL