gg_ticker

package
v0.2.103 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: BSD-3-Clause Imports: 10 Imported by: 9

Documentation

Index

Constants

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

Variables

View Source
var TickStatusRegistry *tickStatusRegistry

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 TickStatus added in v0.2.72

type TickStatus struct {
	RegistryKey string
	// contains filtered or unexported fields
}

TickStatus write info file every x time Useful to write a file to notify that application is alive

func NewTickStatus added in v0.2.72

func NewTickStatus(args ...interface{}) (instance *TickStatus, err error)

func (*TickStatus) Options added in v0.2.72

func (instance *TickStatus) Options() *TickStatusOptions

func (*TickStatus) Start added in v0.2.72

func (instance *TickStatus) Start()

func (*TickStatus) Stop added in v0.2.72

func (instance *TickStatus) Stop()

func (*TickStatus) Write added in v0.2.72

func (instance *TickStatus) Write(args ...interface{})

Write a string or a map into file

type TickStatusOptions added in v0.2.72

type TickStatusOptions struct {
	Uid             string `json:"uid"`
	Enabled         bool   `json:"enabled"`
	Dir             string `json:"dir-root"`
	FileName        string `json:"filename"` // name of info file
	IntervalSeconds int    `json:"interval-seconds"`
	AddToRegistry   bool   `json:"add-to-registry"`
	CleanOnStart    bool   `json:"clean-on-start"`
}

func (*TickStatusOptions) String added in v0.2.72

func (instance *TickStatusOptions) String() string

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