// SPDX-License-Identifier: AGPL-3.0-only // Code generated by informer-gen. DO NOT EDIT. package v0alpha1 import ( "context" time "time" alertingnotificationsv0alpha1 "github.com/grafana/grafana/pkg/apis/alerting_notifications/v0alpha1" versioned "github.com/grafana/grafana/pkg/generated/clientset/versioned" internalinterfaces "github.com/grafana/grafana/pkg/generated/informers/externalversions/internalinterfaces" v0alpha1 "github.com/grafana/grafana/pkg/generated/listers/alerting_notifications/v0alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" ) // RoutingTreeInformer provides access to a shared informer and lister for // RoutingTrees. type RoutingTreeInformer interface { Informer() cache.SharedIndexInformer Lister() v0alpha1.RoutingTreeLister } type routingTreeInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc namespace string } // NewRoutingTreeInformer constructs a new informer for RoutingTree type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewRoutingTreeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { return NewFilteredRoutingTreeInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredRoutingTreeInformer constructs a new informer for RoutingTree type. // Always prefer using an informer factory to get a shared informer instead of getting an independent // one. This reduces memory footprint and number of connections to the server. func NewFilteredRoutingTreeInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NotificationsV0alpha1().RoutingTrees(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } return client.NotificationsV0alpha1().RoutingTrees(namespace).Watch(context.TODO(), options) }, }, &alertingnotificationsv0alpha1.RoutingTree{}, resyncPeriod, indexers, ) } func (f *routingTreeInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { return NewFilteredRoutingTreeInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *routingTreeInformer) Informer() cache.SharedIndexInformer { return f.factory.InformerFor(&alertingnotificationsv0alpha1.RoutingTree{}, f.defaultInformer) } func (f *routingTreeInformer) Lister() v0alpha1.RoutingTreeLister { return v0alpha1.NewRoutingTreeLister(f.Informer().GetIndexer()) }