utilsk8s.io/utils/inotify Index | Files

package inotify

import "k8s.io/utils/inotify"

Index

Types

type Event

type Event struct {
	Mask   uint32 // Mask of events
	Cookie uint32 // Unique cookie associating related events (for rename(2))
	Name   string // File name (optional)
}

Event represents a notification

type Watcher

type Watcher struct {
	Error chan error  // Errors are sent on this channel
	Event chan *Event // Events are returned on this channel
	// contains filtered or unexported fields
}

Watcher represents an inotify instance

func NewWatcher

func NewWatcher() (*Watcher, error)

NewWatcher creates and returns a new inotify instance using inotify_init(2)

func (*Watcher) AddWatch

func (w *Watcher) AddWatch(path string, flags uint32) error

AddWatch adds path to the watched file set. The flags are interpreted as described in inotify_add_watch(2).

func (*Watcher) Close

func (w *Watcher) Close() error

Close closes an inotify watcher instance It sends a message to the reader goroutine to quit and removes all watches associated with the inotify instance

func (*Watcher) RemoveWatch

func (w *Watcher) RemoveWatch(path string) error

RemoveWatch removes path from the watched file set.

func (*Watcher) Watch

func (w *Watcher) Watch(path string) error

Watch adds path to the watched file set, watching all events.

Source Files

inotify.go inotify_others.go

Version
v0.0.0-20250604170112-4c0f3b243397 (latest)
Published
Jun 4, 2025
Platform
js/wasm
Imports
3 packages
Last checked
1 month ago

Tools for package owners.