Documentation
¶
Index ¶
- type ImpersonationCache
- func (c *ImpersonationCache) Get(ns, name string) (client.Client, bool)
- func (c *ImpersonationCache) Invalidate(namespace, name string)
- func (c *ImpersonationCache) LoadOrCreate(ctx context.Context, log logr.Logger, baseREST *rest.Config, ...) (client.Client, error)
- func (c *ImpersonationCache) Reset()
- func (c *ImpersonationCache) Set(namespace, name string, cl client.Client)
- func (c *ImpersonationCache) Stats() (entries int)
- type Key
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ImpersonationCache ¶
type ImpersonationCache struct {
// contains filtered or unexported fields
}
func NewImpersonationCache ¶
func NewImpersonationCache() *ImpersonationCache
func (*ImpersonationCache) Get ¶
func (c *ImpersonationCache) Get(ns, name string) (client.Client, bool)
Get returns a cached client if present.
func (*ImpersonationCache) Invalidate ¶
func (c *ImpersonationCache) Invalidate(namespace, name string)
Invalidate removes one entry.
func (*ImpersonationCache) LoadOrCreate ¶
func (c *ImpersonationCache) LoadOrCreate( ctx context.Context, log logr.Logger, baseREST *rest.Config, scheme *runtime.Scheme, sa meta.NamespacedRFC1123ObjectReferenceWithNamespace, ) (client.Client, error)
LoadOrCreate returns a cached impersonated client for the given service account, creating and caching it if missing.
func (*ImpersonationCache) Reset ¶
func (c *ImpersonationCache) Reset()
Clear drops all cached clients.
func (*ImpersonationCache) Set ¶
func (c *ImpersonationCache) Set(namespace, name string, cl client.Client)
Set stores a client explicitly (rarely needed).
func (*ImpersonationCache) Stats ¶
func (c *ImpersonationCache) Stats() (entries int)
Stats helps you log cache state.
Click to show internal directories.
Click to hide internal directories.