hashcache

package
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package hashcache provides a thread-safe hash cache implementation for Kubernetes objects

Index

Constants

This section is empty.

Variables

View Source
var DefaultHashCache = NewHashCache()

DefaultHashCache is the global default hash cache instance

Functions

This section is empty.

Types

type HashCache

type HashCache struct {
	// contains filtered or unexported fields
}

HashCache provides a thread-safe cache for hash objects

func NewHashCache

func NewHashCache() HashCache

NewHashCache creates and returns a new HashCache instance

func (*HashCache) AddClowdObjectToObject

func (hc *HashCache) AddClowdObjectToObject(clowdObj object.ClowdObject, obj client.Object) error

AddClowdObjectToObject associates a Clowder object with a Kubernetes object in the cache

func (*HashCache) CreateOrUpdateObject

func (hc *HashCache) CreateOrUpdateObject(obj client.Object, alwaysUpdate bool) (bool, error)

CreateOrUpdateObject creates or updates a HashObject and adds attribute alwaysUpdate. This function returns a boolean indicating whether the hashCache should be updated.

func (*HashCache) Delete

func (hc *HashCache) Delete(obj client.Object)

Delete removes an object from the hash cache

func (*HashCache) GetSuperHashForClowdObject

func (hc *HashCache) GetSuperHashForClowdObject(clowdObj object.ClowdObject) string

GetSuperHashForClowdObject returns the combined hash of all objects associated with a Clowder object

func (*HashCache) Read

func (hc *HashCache) Read(obj client.Object) (*HashObject, error)

func (*HashCache) RemoveClowdObjectFromObjects

func (hc *HashCache) RemoveClowdObjectFromObjects(obj client.Object)

RemoveClowdObjectFromObjects removes a Clowder object from all cached objects

type HashObject

type HashObject struct {
	Hash      string
	ClowdApps map[types.NamespacedName]bool
	ClowdEnvs map[types.NamespacedName]bool
	Always    bool // Secret/ConfigMap should be always updated
}

HashObject represents a cached hash object with associated ClowdApps and ClowdEnvs

func NewHashObject

func NewHashObject(hash string, always bool) HashObject

NewHashObject creates and returns a new HashObject with the provided hash and always flag

type Ident

type Ident struct {
	NN   types.NamespacedName
	Type string
}

Ident represents an identifier for a hash cache entry with namespaced name and type

type ItemNotFoundError

type ItemNotFoundError struct {
	// contains filtered or unexported fields
}

ItemNotFoundError represents an error when an item is not found in the hash cache

func (ItemNotFoundError) Error

func (a ItemNotFoundError) Error() string

Jump to

Keyboard shortcuts

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