watch

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Added    = watch.Added
	Modified = watch.Modified
	Deleted  = watch.Deleted
	Bookmark = watch.Bookmark
	Error    = watch.Error
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateFn

type CreateFn func(ctx context.Context, ns, name string) (Interface, error)

CreateFn creates a watch for the named object.

type Event

type Event = watch.Event

type EventType

type EventType = watch.EventType

type FileWatch

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

FileWatch monitors a file for changes. It implements the apimachinery watch.Interface and generates events similar to the ones generated by an apimachinery watch for custom resources or configmaps.

func (*FileWatch) ResultChan

func (w *FileWatch) ResultChan() <-chan Event

ResultChan returns the watch channel for receiving events.

func (*FileWatch) Stop

func (w *FileWatch) Stop()

Stop stops the watch.

type Interface

type Interface = watch.Interface

func File

func File(file string, unmarshal UnmarshalFn) (Interface, error)

File creates a watch for monitoring the given file.

func Object

func Object(ctx context.Context, ns, name string, create CreateFn) (Interface, error)

Object sets up a watch for the named object using the watch creation function.

type ObjectWatch

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

ObjectWatch is a wrapper for apimachinery watches that monitor a single object. The wrapper transparently reopens the watch when it expires.

func (*ObjectWatch) ResultChan

func (w *ObjectWatch) ResultChan() <-chan Event

ResultChan returns the watch channel for receiving events.

func (*ObjectWatch) Stop

func (w *ObjectWatch) Stop()

Stop stops the watch.

type UnmarshalFn

type UnmarshalFn func([]byte, string) (runtime.Object, error)

UnmarshalFn unmarshals YAML data into an object.

Jump to

Keyboard shortcuts

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