watch

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const MaxWatchVals = 10000
View Source
const MaxWatchWaitTime = 10 * time.Millisecond

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicLoader

type AtomicLoader[T any] interface {
	Load() T
}

type AtomicStorer

type AtomicStorer[T any] interface {
	Store(val T)
}

type WatchCollector

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

WatchCollector implements the collector.Collector interface for watch collection

func GetInstance

func GetInstance() *WatchCollector

GetInstance returns the singleton instance of WatchCollector

func (*WatchCollector) CollectWatches

func (wc *WatchCollector) CollectWatches()

CollectWatches collects watch information and sends it to the controller

func (*WatchCollector) CollectorName

func (wc *WatchCollector) CollectorName() string

CollectorName returns the unique name of the collector

func (*WatchCollector) Disable

func (wc *WatchCollector) Disable()

Disable stops the collector

func (*WatchCollector) Enable

func (wc *WatchCollector) Enable()

Enable is called when the collector should start collecting data

func (*WatchCollector) GetWatchNames

func (wc *WatchCollector) GetWatchNames() []string

func (*WatchCollector) InitCollector

func (wc *WatchCollector) InitCollector(controller ds.Controller, config any) error

InitCollector initializes the watch collector with a controller and configuration

func (*WatchCollector) PushWatchValue

func (wc *WatchCollector) PushWatchValue(w *ds.WatchSample)

func (*WatchCollector) RecordWatchValue

func (wc *WatchCollector) RecordWatchValue(name string, tags []string, lock sync.Locker, rval reflect.Value, typeStr string, flags int)

func (*WatchCollector) RegisterHook

func (wc *WatchCollector) RegisterHook(name string, hook any, flags int)

func (*WatchCollector) RegisterWatchAtomic

func (wc *WatchCollector) RegisterWatchAtomic(name string, atomicVal any, flags int)

func (*WatchCollector) RegisterWatchFunc

func (wc *WatchCollector) RegisterWatchFunc(name string, getFn any, setFn any, flags int)

func (*WatchCollector) RegisterWatchSync

func (wc *WatchCollector) RegisterWatchSync(name string, lock sync.Locker, rval reflect.Value, flags int)

func (*WatchCollector) UnregisterWatch

func (wc *WatchCollector) UnregisterWatch(name string)

type WatchDecl

type WatchDecl struct {
	Name      string
	Tags      []string
	Flags     int           // denotes the type of watch (Sync, Func, Atomic)
	Lock      sync.Locker   // for Sync
	PtrVal    reflect.Value // for Sync
	GetFn     any           // for Func
	SetFn     any           // for Func
	HookFn    any           // for Hook
	AtomicVal any           // for Atomic (AtomicLoader)
	HookSent  atomic.Bool
}

func (*WatchDecl) IsAtomic

func (d *WatchDecl) IsAtomic() bool

func (*WatchDecl) IsFunc

func (d *WatchDecl) IsFunc() bool

func (*WatchDecl) IsHook

func (d *WatchDecl) IsHook() bool

func (*WatchDecl) IsNumeric

func (d *WatchDecl) IsNumeric() bool

func (*WatchDecl) IsSync

func (d *WatchDecl) IsSync() bool

Jump to

Keyboard shortcuts

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