package mock

import "github.com/hashicorp/vault/sdk/plugin/mock"

Index

Constants

const (
	MockPluginVersionEnv           = "TESTING_MOCK_VAULT_PLUGIN_VERSION"
	MockPluginDefaultInternalValue = "bar"
)

Functions

func Backend

func Backend() *backend

Backend returns a private embedded struct of framework.Backend.

func ExpectInternalValue

func ExpectInternalValue(t *testing.T, client *api.Client, mountPath, expected string)

ExpectInternalValue checks the internal in-memory value.

func Factory

func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend, error)

Factory returns a new backend as logical.Backend.

func FactoryType

func FactoryType(backendType logical.BackendType) logical.Factory

FactoryType is a wrapper func that allows the Factory func to specify the backend type for the mock backend plugin instance.

func New

func New() (interface{}, error)

New returns a new backend as an interface. This func is only necessary for builtin backend plugins.

func WriteInternalValue

func WriteInternalValue(t *testing.T, client *api.Client, mountPath, value string)

WriteInternalValue is a helper to set an in-memory value in the plugin, allowing tests to later assert that the plugin either has or hasn't been restarted.

Source Files

backend.go path_config.go path_env.go path_errors.go path_internal.go path_kv.go path_raw.go path_special.go

Version
v0.18.0 (latest)
Published
Jun 5, 2025
Platform
linux/amd64
Imports
14 packages
Last checked
1 month ago

Tools for package owners.