gg_ticker

package
v0.2.43 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: BSD-3-Clause Imports: 4 Imported by: 9

Documentation

Index

Constants

View Source
const FileMonitorErrorEventName = "on_file_match_error"
View Source
const FileMonitorEventName = "on_file_match"

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMonitor

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

func NewFileMonitor

func NewFileMonitor(settings *FileMonitorSettings, events *gg_events.Emitter) *FileMonitor

func (*FileMonitor) Events

func (instance *FileMonitor) Events() *gg_events.Emitter

func (*FileMonitor) Start

func (instance *FileMonitor) Start()

func (*FileMonitor) Stop

func (instance *FileMonitor) Stop()

type FileMonitorSettings

type FileMonitorSettings struct {
	Dirs                  []string `json:"dirs"` // directories to monitor for file
	IncludeSubFolders     bool     `json:"include_sub_folders"`
	FilePattern           string   `json:"pattern"` // file name or file pattern i.e. "*.xml"
	TriggerEventName      string   `json:"trigger-event-name"`
	TriggerErrorEventName string   `json:"trigger-error-event-name"`
	CheckIntervalMs       int      `json:"check-interval-ms"`
	DeleteAfterMatch      bool     `json:"delete-after-match"`
	MoveAfterMatchDir     string   `json:"move-after-match-dir"`
}

type Ticker

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

func NewTicker

func NewTicker(timeout time.Duration, callback TickerCallback) *Ticker

func Tick

func Tick(timeout time.Duration, callback TickerCallback) *Ticker

Tick Simple ticker loop

func (*Ticker) IsPaused

func (instance *Ticker) IsPaused() bool

func (*Ticker) IsRunning

func (instance *Ticker) IsRunning() bool

func (*Ticker) Join

func (instance *Ticker) Join()

Join Wait Ticker is stopped

func (*Ticker) Lock

func (instance *Ticker) Lock()

func (*Ticker) Pause

func (instance *Ticker) Pause()

func (*Ticker) Resume

func (instance *Ticker) Resume()

func (*Ticker) Start

func (instance *Ticker) Start()

Start .... Start the timer

func (*Ticker) Stop

func (instance *Ticker) Stop()

Stop ... stops the timer

func (*Ticker) Unlock

func (instance *Ticker) Unlock()

type TickerCallback

type TickerCallback func(*Ticker)

Jump to

Keyboard shortcuts

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