snapshots

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: MPL-2.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 Option added in v0.19.0

type Option func(o *options)

func WithModifyRequests added in v0.19.0

func WithModifyRequests(modify func(req *logical.Request)) Option

WithModifyRequests allows you to modify the request before it is sent to the backend. This is useful for setting the client token or other request data

func WithRecoverSourcePath added in v0.19.0

func WithRecoverSourcePath(recoverSourcePath string) Option

WithRecoverSourcePath allows you to specify a different path to read from when performing a recover operation.

type SnapshotTestCase

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

func NewSnapshotTestCase

func NewSnapshotTestCase(t testing.TB, backend logical.Backend) *SnapshotTestCase

NewSnapshotTestCase is used to create a snapshot test case for a particular backend. The test case is used to ensure that the backend behaves correctly when it receives snapshot operations, without having to do the end-to-end setup of creating a raft cluster, taking a snapshot, and loading it.

func NewSnapshotTestCaseWithStorages added in v0.19.0

func NewSnapshotTestCaseWithStorages(t testing.TB, backend logical.Backend, regularStorage, snapshotStorage logical.Storage) *SnapshotTestCase

NewSnapshotTestCaseWithStorages is used to create a snapshot test case for a particular backend, using the provided storage instances. The test case is used to ensure that the backend behaves correctly when it receives snapshot operations, without having to do the end-to-end setup of creating a raft cluster, taking a snapshot, and loading it.

func (*SnapshotTestCase) DoRecover

func (s *SnapshotTestCase) DoRecover(t testing.TB, path string, additionalOpts ...Option) (*logical.Response, error)

DoRecover performs a read operation from a snapshot, and then a recover. The test returns the results of the recover operation

func (*SnapshotTestCase) RegularStorage

func (s *SnapshotTestCase) RegularStorage() logical.Storage

func (*SnapshotTestCase) RunList

func (s *SnapshotTestCase) RunList(t testing.TB, path string, additionalOpts ...Option)

RunList runs a list operation without a snapshot, a list operation from a snapshot, and then another list operation without a snapshot. The test verifies that the list operation from the snapshot does not cause the results to change

func (*SnapshotTestCase) RunRead

func (s *SnapshotTestCase) RunRead(t testing.TB, path string, additionalOpts ...Option)

RunRead runs a read operation without a snapshot, a read operation from a snapshot, and then another read operation without a snapshot. The test verifies that the read operation from the snapshot does not cause the results to change

func (*SnapshotTestCase) SnapshotStorage

func (s *SnapshotTestCase) SnapshotStorage() logical.Storage

Jump to

Keyboard shortcuts

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