Documentation
¶
Overview ¶
Package hashcache provides a thread-safe hash cache implementation for Kubernetes objects
Index ¶
- Variables
- type HashCache
- func (hc *HashCache) AddClowdObjectToObject(clowdObj object.ClowdObject, obj client.Object) error
- func (hc *HashCache) CreateOrUpdateObject(obj client.Object, alwaysUpdate bool) (bool, error)
- func (hc *HashCache) Delete(obj client.Object)
- func (hc *HashCache) GetSuperHashForClowdObject(clowdObj object.ClowdObject) string
- func (hc *HashCache) Read(obj client.Object) (*HashObject, error)
- func (hc *HashCache) RemoveClowdObjectFromObjects(obj client.Object)
- type HashObject
- type Ident
- type ItemNotFoundError
Constants ¶
This section is empty.
Variables ¶
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 ¶
AddClowdObjectToObject associates a Clowder object with a Kubernetes object in the cache
func (*HashCache) CreateOrUpdateObject ¶
CreateOrUpdateObject creates or updates a HashObject and adds attribute alwaysUpdate. This function returns a boolean indicating whether the hashCache should be updated.
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) RemoveClowdObjectFromObjects ¶
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