watch

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const EventDeleteObjectName = "<deleted>"

EventDeleteObjectName is used as the name of an object sent to the GenericWatchStorage's event stream when the the object has been deleted

Variables

This section is empty.

Functions

func NewGenericWatchStorage

func NewGenericWatchStorage(s storage.Storage) (update.EventStorage, error)

NewGenericWatchStorage is an extended Storage implementation, which provides a watcher for watching changes in the directory managed by the embedded Storage's RawStorage. If the RawStorage is a MappedRawStorage instance, it's mappings will automatically be updated by the WatchStorage. Update events are sent to the given event stream. Note: This WatchStorage only works for one-frame files (i.e. only one YAML document per file is supported).

func NewManifestStorage

func NewManifestStorage(manifestDir string, ser serializer.Serializer) (update.EventStorage, error)

NewManifestStorage returns a pre-configured GenericWatchStorage backed by a storage.GenericStorage, and a GenericMappedRawStorage for the given manifestDir and Serializer. This should be sufficient for most users that want to watch changes in a directory with manifests.

Types

type GenericWatchStorage

type GenericWatchStorage struct {
	storage.Storage
	// contains filtered or unexported fields
}

GenericWatchStorage implements the WatchStorage interface

func (*GenericWatchStorage) Close

func (s *GenericWatchStorage) Close() error

func (*GenericWatchStorage) Create

func (s *GenericWatchStorage) Create(obj runtime.Object) error

Suspend modify events during Create

func (*GenericWatchStorage) Delete

func (s *GenericWatchStorage) Delete(key storage.ObjectKey) error

Suspend delete events during Delete

func (*GenericWatchStorage) Patch

func (s *GenericWatchStorage) Patch(key storage.ObjectKey, patch []byte) error

Suspend modify events during Patch

func (*GenericWatchStorage) SetUpdateStream

func (s *GenericWatchStorage) SetUpdateStream(eventStream update.UpdateStream)

func (*GenericWatchStorage) Update

func (s *GenericWatchStorage) Update(obj runtime.Object) error

Suspend modify events during Update

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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