persist

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 13 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 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.

Jump to

Keyboard shortcuts

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