fileinformer

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Overview

Package fileinformer implements a kube-style Informer and InformerFactory that can be used to watch files instead of kube apis.

Index

Constants

This section is empty.

Variables

View Source
var FileGroupVersion = schema.GroupVersion{
	Group:   "//LocalFile",
	Version: "v1",
}

FileGroupVersion is a sythetic GroupVersion that the informers use.

Functions

This section is empty.

Types

type Factory

type Factory struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Factory implements dynamicinformer.DynamicSharedInformerFactory, but for starting and managing FileInformers.

func NewFileInformerFactory

func NewFileInformerFactory() (*Factory, error)

NewFileInformerFactory creates a new Factory.

func (*Factory) ForResource

ForResource will create an informer for a specific file.

func (*Factory) Start

func (f *Factory) Start(stopCh <-chan struct{})

Start starts watching the files defined byt the informers.

func (*Factory) WaitForCacheSync

func (f *Factory) WaitForCacheSync(stopCh <-chan struct{}) map[schema.GroupVersionResource]bool

WaitForCacheSync waits until all files in the informers have been synced once.

type FileInformer

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

FileInformer is an informer that watches files instead of the kube api.

func NewFileInformer

func NewFileInformer(watcher *fsnotify.Watcher, gvr schema.GroupVersionResource) (*FileInformer, error)

NewFileInformer returns a new FileInformer.

func (*FileInformer) Informer

func (f *FileInformer) Informer() cache.SharedIndexInformer

func (*FileInformer) Lister

func (f *FileInformer) Lister() cache.GenericLister

type FileSharedIndexInformer

type FileSharedIndexInformer struct {
	sync.Once
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewFileSharedIndexInformer

func NewFileSharedIndexInformer(fileName string, watcher *fsnotify.Watcher, defaultEventHandlerResyncPeriod time.Duration) *FileSharedIndexInformer

NewFileSharedIndexInformer creates a new informer watching the file Note that currently all event handlers share the default resync period.

func (*FileSharedIndexInformer) AddEventHandler

func (f *FileSharedIndexInformer) AddEventHandler(handler cache.ResourceEventHandler)

func (*FileSharedIndexInformer) AddEventHandlerWithResyncPeriod

func (f *FileSharedIndexInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, resyncPeriod time.Duration)

func (*FileSharedIndexInformer) AddIndexers

func (f *FileSharedIndexInformer) AddIndexers(indexers cache.Indexers) error

func (*FileSharedIndexInformer) GetController

func (f *FileSharedIndexInformer) GetController() cache.Controller

func (*FileSharedIndexInformer) GetIndexer

func (f *FileSharedIndexInformer) GetIndexer() cache.Indexer

func (*FileSharedIndexInformer) GetStore

func (f *FileSharedIndexInformer) GetStore() cache.Store

func (*FileSharedIndexInformer) HasSynced

func (f *FileSharedIndexInformer) HasSynced() bool

func (*FileSharedIndexInformer) LastSyncResourceVersion

func (f *FileSharedIndexInformer) LastSyncResourceVersion() string

func (*FileSharedIndexInformer) Run

func (f *FileSharedIndexInformer) Run(stopCh <-chan struct{})

func (*FileSharedIndexInformer) SetTransform

func (f *FileSharedIndexInformer) SetTransform(handler cache.TransformFunc) error

func (*FileSharedIndexInformer) SetWatchErrorHandler

func (f *FileSharedIndexInformer) SetWatchErrorHandler(handler cache.WatchErrorHandler) error

Jump to

Keyboard shortcuts

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