stdstore

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SealedDataFname is the file name in which the state is sealed on disk in seal_dir.
	SealedDataFname string = "sealed_data"

	// SealedKeyFname is the file name in which the key is sealed with the seal key on disk in seal_dir.
	SealedKeyFname string = "sealed_key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type StdIterator

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

StdIterator is the standard Iterator implementation.

func (*StdIterator) GetNext

func (i *StdIterator) GetNext() (string, error)

GetNext implements the Iterator interface.

func (*StdIterator) HasNext

func (i *StdIterator) HasNext() bool

HasNext implements the Iterator interface.

type StdStore

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

StdStore is the standard implementation of the Store interface.

func New

func New(sealer seal.Sealer, fs afero.Fs, sealDir string) *StdStore

New creates and initializes a new StdStore object.

func (*StdStore) BeginTransaction

func (s *StdStore) BeginTransaction(_ context.Context) (store.Transaction, error)

BeginTransaction starts a new transaction.

func (*StdStore) Delete

func (s *StdStore) Delete(request string) error

Delete removes a value from StdStore.

func (*StdStore) Get

func (s *StdStore) Get(request string) ([]byte, error)

Get retrieves a value from StdStore by Type and Name.

func (*StdStore) Iterator

func (s *StdStore) Iterator(prefix string) (store.Iterator, error)

Iterator returns an iterator for keys saved in StdStore with a given prefix. For an empty prefix this is an iterator for all keys in StdStore.

func (*StdStore) LoadState

func (s *StdStore) LoadState() ([]byte, error)

LoadState loads sealed data into StdStore's data.

func (*StdStore) Put

func (s *StdStore) Put(request string, requestData []byte) error

Put saves a value in StdStore by Type and Name.

func (*StdStore) SetEncryptionKey

func (s *StdStore) SetEncryptionKey(encryptionKey []byte) error

SetEncryptionKey sets the encryption key for sealing and unsealing.

func (*StdStore) SetRecoveryData

func (s *StdStore) SetRecoveryData(recoveryData []byte)

SetRecoveryData sets the recovery data that is added to the sealed data.

type StdTransaction

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

StdTransaction is a transaction for StdStore.

func (*StdTransaction) Commit

func (t *StdTransaction) Commit(_ context.Context) error

Commit ends a transaction and persists the changes.

func (*StdTransaction) Delete

func (t *StdTransaction) Delete(request string) error

Delete removes a value.

func (*StdTransaction) Get

func (t *StdTransaction) Get(request string) ([]byte, error)

Get retrieves a value.

func (*StdTransaction) Iterator

func (t *StdTransaction) Iterator(prefix string) (store.Iterator, error)

Iterator returns an iterator for all keys in the transaction with a given prefix.

func (*StdTransaction) Put

func (t *StdTransaction) Put(request string, requestData []byte) error

Put saves a value.

func (*StdTransaction) Rollback

func (t *StdTransaction) Rollback()

Rollback aborts a transaction.

Jump to

Keyboard shortcuts

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