persist

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package persist provides persistent implementation of the interfaces defined in core.name_mapping.go (please see the documentation in there)

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