watcher

package
v1.20.102 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Zlib Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnkMethod    = iota
	NormalMethod //default
	ChanMethod
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DoChanged

type DoChanged interface {
	Changed() bool
}

type Func

type Func func() bool

func (Func) Changed

func (f Func) Changed() bool

type Option

type Option func(w *Watcher)

func WithChangedOption

func WithChangedOption(changed DoChanged) Option

func WithMethodOption

func WithMethodOption(method int32) Option

func WithTickerOption

func WithTickerOption(ticker time.Duration) Option

type Watcher

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

func NewWatcher

func NewWatcher(cha DoChanged, opts ...Option) *Watcher

func (*Watcher) Changed

func (w *Watcher) Changed() <-chan bool

func (*Watcher) Stop

func (w *Watcher) Stop()

func (*Watcher) Update

func (w *Watcher) Update()

func (*Watcher) UseMethod

func (w *Watcher) UseMethod(method int32)

Jump to

Keyboard shortcuts

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