state

package
v0.40.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PersistentStorage

type PersistentStorage struct {
	// contains filtered or unexported fields
}

PersistentStorage is a wrapper around persistent K:V db that provides thread safe functions to set and fetch state variables of the Inner Ring and Storage applications.

func NewPersistentStorage

func NewPersistentStorage(path string) (*PersistentStorage, error)

NewPersistentStorage creates a new instance of a storage with 0o600 rights.

func (PersistentStorage) Bytes added in v0.39.0

func (p PersistentStorage) Bytes(key []byte) (res []byte, err error)

Bytes reads binary value by specified key. Returns nil if value is missing.

func (PersistentStorage) Close

func (p PersistentStorage) Close() error

Close closes persistent database instance.

func (PersistentStorage) SetBytes added in v0.39.0

func (p PersistentStorage) SetBytes(key []byte, value []byte) error

SetBytes saves binary value in the storage by specified key.

func (PersistentStorage) SetUInt32

func (p PersistentStorage) SetUInt32(key []byte, value uint32) error

SetUInt32 sets a uint32 value in the storage.

func (PersistentStorage) UInt32

func (p PersistentStorage) UInt32(key []byte) (n uint32, err error)

UInt32 returns a uint32 value from persistent storage. If the value does not exist, returns 0.

Jump to

Keyboard shortcuts

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