pmemstate

package
v0.7.25 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 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 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 ids of all entries found in the state
	GetAll() ([]string, 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. State entries are mapped to files with the .json suffix in that directory and vice versa. Other directory content is ignored, which makes it possible to use the directory also for other state information.

Jump to

Keyboard shortcuts

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