client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package client provides an extended client that is capable of caching multiple secrets without relying on informers

Index

Constants

View Source
const DefaultTTLSeconds = 10

DefaultTTLSeconds is the default TTL in seconds of cache entries

Variables

This section is empty.

Functions

func NewExtendedClient

func NewExtendedClient(
	baseClient client.Client,
) client.Client

NewExtendedClient returns an extended client capable of caching secrets on the 'Get' operation

Types

type ExtendedClient

type ExtendedClient struct {
	client.Client
	// contains filtered or unexported fields
}

ExtendedClient is an extended client that is capable of caching multiple secrets without relying on informers

func (*ExtendedClient) Delete

func (e *ExtendedClient) Delete(
	ctx context.Context,
	obj client.Object,
	opts ...client.DeleteOption,
) error

Delete behaves like the original Delete method, but on secrets it removes the secret from the cache

func (*ExtendedClient) Get

func (e *ExtendedClient) Get(
	ctx context.Context,
	key client.ObjectKey,
	obj client.Object,
	opts ...client.GetOption,
) error

Get behaves like the original Get method, but uses a cache for secrets

func (*ExtendedClient) Patch

func (e *ExtendedClient) Patch(
	ctx context.Context,
	obj client.Object,
	patch client.Patch,
	opts ...client.PatchOption,
) error

Patch behaves like the original Patch method, but on secrets it removes the secret from the cache

func (*ExtendedClient) Update

func (e *ExtendedClient) Update(
	ctx context.Context,
	obj client.Object,
	opts ...client.UpdateOption,
) error

Update behaves like the original Update method, but on secrets it removes the secret from the cache

Jump to

Keyboard shortcuts

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