watch

package
v0.5.0 Latest Latest
Warning

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

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

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