Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadKubevirtMetadata ¶
func LoadKubevirtMetadata(metadataCache *Cache) api.KubeVirtMetadata
LoadKubevirtMetadata loads and returns all KubeVirt metadata. It serves as a convenient helper for processing the `KubeVirtMetadata` data structure as a whole. It is recommended to use individual loaders when possible.
Types ¶
type Cache ¶
type Cache struct { UID SafeData[types.UID] Migration SafeData[api.MigrationMetadata] GracePeriod SafeData[api.GracePeriodMetadata] AccessCredential SafeData[api.AccessCredentialMetadata] MemoryDump SafeData[api.MemoryDumpMetadata] // contains filtered or unexported fields }
func (*Cache) Listen ¶
func (c *Cache) Listen() <-chan struct{}
Listen to a notification signal about the cache content changes. Notifications are sent implicitly when the cache data is being changed.
func (*Cache) ResetNotification ¶
func (c *Cache) ResetNotification()
ResetNotification clears the notification signal.
type SafeData ¶
type SafeData[T comparable] struct { // contains filtered or unexported fields }
func (*SafeData[T]) Load ¶
Load reads and returns safely the data and a flag. The flag specifies if the data is already initialized (true) or not (false). Data which is not yet initialized has never been stored.
func (*SafeData[T]) Set ¶
func (d *SafeData[T]) Set(data T)
Set persists safely the inputted data. As a side effect, it marks the data as initialized.
Note: Unlike Store, this method does not have a notification side effect.
func (*SafeData[T]) Store ¶
func (d *SafeData[T]) Store(data T)
Store persists safely the inputted data. As a side effect, it marks the data as initialized and in case a notification channel exists, a signal is sent.
func (*SafeData[T]) WithSafeBlock ¶
WithSafeBlock calls the provided function with the data (reference) and a flag that specifies if the data is already initialized (true) or not (false). Data which is not yet initialized has never been stored. As a side effect, the method marks the data as initialized. In case a notification channel exists and the data changed, a signal is sent.
Access to the data is protected by locks during the execution.