Documentation ¶
Overview ¶
Package persist asynchronously writes changes in the map (name->idx) to file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Marshalling ¶
func Marshalling(agentLabel string, idxMap idxvpp.NameToIdx, loadedFromFile idxvpp.NameToIdxRW) error
Marshalling loads the config and starts watching for changes.
Types ¶
type NameToIdxPersist ¶
type NameToIdxPersist struct {
// contains filtered or unexported fields
}
NameToIdxPersist is a decorator for NameToIdxRW implementing persistent storage.
func NewNameToIdxPersist ¶
func NewNameToIdxPersist(fileName string, config *nametoidx.Config, namespace string, registrations chan idxvpp.NameToIdxDto) *NameToIdxPersist
NewNameToIdxPersist initializes decorator for persistent storage of index-to-name mapping.
func (*NameToIdxPersist) Close ¶
func (persist *NameToIdxPersist) Close() error
Close triggers explicit synchronization and closes the underlying mapping.
func (*NameToIdxPersist) Init ¶
func (persist *NameToIdxPersist) Init() error
Init starts Go routine that watches chan idxvpp.NameToIdxDto.
func (*NameToIdxPersist) Sync ¶
func (persist *NameToIdxPersist) Sync() error
Sync triggers immediate synchronization between the underlying registry and the persistent storage. The function doesn't return until the operation has fully finished.
Click to show internal directories.
Click to hide internal directories.