Documentation ¶
Overview ¶
Package fileinformer implements a kube-style Informer and InformerFactory that can be used to watch files instead of kube apis.
Index ¶
- Variables
- type Factory
- type FileInformer
- type FileSharedIndexInformer
- func (f *FileSharedIndexInformer) AddEventHandler(handler cache.ResourceEventHandler) (cache.ResourceEventHandlerRegistration, error)
- func (f *FileSharedIndexInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, resyncPeriod time.Duration) (cache.ResourceEventHandlerRegistration, error)
- func (f *FileSharedIndexInformer) AddIndexers(indexers cache.Indexers) error
- func (f *FileSharedIndexInformer) GetController() cache.Controller
- func (f *FileSharedIndexInformer) GetIndexer() cache.Indexer
- func (f *FileSharedIndexInformer) GetStore() cache.Store
- func (f *FileSharedIndexInformer) HasSynced() bool
- func (f *FileSharedIndexInformer) IsStopped() bool
- func (f *FileSharedIndexInformer) LastSyncResourceVersion() string
- func (*FileSharedIndexInformer) RemoveEventHandler(handle cache.ResourceEventHandlerRegistration) error
- func (f *FileSharedIndexInformer) Run(stopCh <-chan struct{})
- func (f *FileSharedIndexInformer) SetTransform(handler cache.TransformFunc) error
- func (f *FileSharedIndexInformer) SetWatchErrorHandler(handler cache.WatchErrorHandler) error
Constants ¶
This section is empty.
Variables ¶
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 ¶
Factory implements dynamicinformer.DynamicSharedInformerFactory, but for starting and managing FileInformers.
func NewFileInformerFactory ¶
NewFileInformerFactory creates a new Factory.
func (*Factory) ForResource ¶
func (f *Factory) ForResource(gvr schema.GroupVersionResource) informers.GenericInformer
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(log logr.Logger, 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 { // contains filtered or unexported fields }
func NewFileSharedIndexInformer ¶
func NewFileSharedIndexInformer(log logr.Logger, 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) (cache.ResourceEventHandlerRegistration, error)
func (*FileSharedIndexInformer) AddEventHandlerWithResyncPeriod ¶
func (f *FileSharedIndexInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEventHandler, resyncPeriod time.Duration) (cache.ResourceEventHandlerRegistration, error)
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) IsStopped ¶ added in v0.6.0
func (f *FileSharedIndexInformer) IsStopped() bool
func (*FileSharedIndexInformer) LastSyncResourceVersion ¶
func (f *FileSharedIndexInformer) LastSyncResourceVersion() string
func (*FileSharedIndexInformer) RemoveEventHandler ¶ added in v0.6.0
func (*FileSharedIndexInformer) RemoveEventHandler(handle cache.ResourceEventHandlerRegistration) error
RemoveEventHandler implements cache.SharedInformer
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