persist

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

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 watcher for changes in index to name mapping that persists changes in name to idx mapping.

func NewNameToIdxPersist

func NewNameToIdxPersist(fileName string, config *nametoidx.Config, namespace string,
	registrations chan idxvpp.NameToIdxDto) *NameToIdxPersist

NewNameToIdxPersist creates new instance of watcher of index to name mapping that persists changes in name to idx 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.

Jump to

Keyboard shortcuts

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