func NewSharedCachedFactory(sharedClientFactory client.SharedClientFactory, opts *SharedCacheFactoryOptions) SharedCacheFactory {
	opts = applyDefaults(opts)
	factory := &sharedCacheFactory{
		lock:                sync.Mutex{},
		tweakList:           opts.DefaultTweakList,
		defaultResync:       opts.DefaultResync,
		defaultNamespace:    opts.DefaultNamespace,
		customResync:        opts.KindResync,
		customNamespaces:    opts.KindNamespace,
		customTweakList:     opts.KindTweakList,
		caches:              map[schema.GroupVersionKind]cache.SharedIndexInformer{},
		startedCaches:       map[schema.GroupVersionKind]bool{},
		sharedClientFactory: sharedClientFactory,
		healthcheck: healthcheck{
			callback: opts.HealthCallback,
		},
	}
	return factory
}
NewSharedInformerFactoryWithOptions constructs a new instance of a SharedInformerFactory with additional options.
package cache
import (
	"context"
	"sync"
	"time"
	"github.com/rancher/lasso/pkg/client"
	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
	"k8s.io/client-go/tools/cache"
)
type TweakListOptionsFunc func(*v1.ListOptions)
type SharedCacheFactoryOptions struct {
	DefaultResync    time.Duration
	DefaultNamespace string
	DefaultTweakList TweakListOptionsFunc
	KindResync     map[schema.GroupVersionKind]time.Duration
	KindNamespace  map[schema.GroupVersionKind]string
	KindTweakList  map[schema.GroupVersionKind]TweakListOptionsFunc
	HealthCallback func(healthy bool)
}
type sharedCacheFactory struct {
	lock sync.Mutex
	tweakList           TweakListOptionsFunc
	defaultResync       time.Duration
	defaultNamespace    string
	customResync        map[schema.GroupVersionKind]time.Duration
	customNamespaces    map[schema.GroupVersionKind]string
	customTweakList     map[schema.GroupVersionKind]TweakListOptionsFunc
	sharedClientFactory client.SharedClientFactory
	healthcheck         healthcheck
	caches        map[schema.GroupVersionKind]cache.SharedIndexInformer
	startedCaches map[schema.GroupVersionKind]bool
}