pmemstate

package
v0.5.20 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Copyright 2019 Intel Corporation.

SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetAllFunc

type GetAllFunc func(id string) bool

GetAllFunc callback function used for StateManager.GetAll(). This function is called with ID, for each entry found in the state.

type StateManager

type StateManager interface {
	// Create creates an entry in the state with given id and data
	Create(id string, data interface{}) error
	// Delete deletes an entry found with the id from the state
	Delete(id string) error
	// Get retrives the entry data into location pointed by dataPtr.
	Get(id string, dataPtr interface{}) error
	// GetAll retrieves all entries found in the state, foreach functions is
	// called with id for every entry found in the state, and entry data is filled in dataPtr.
	// the caller has to copy the data if needed.
	GetAll(dataPtr interface{}, foreach GetAllFunc) error
}

StateManager manages the driver persistent state, i.e, volumes information

func NewFileState

func NewFileState(directory string) (StateManager, error)

NewFileState instantiates the file state manager with given directory location. It ensures the provided directory exists. Returns error, if fails to create the direcotry incase of not pre-existing.

Jump to

Keyboard shortcuts

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