memory

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigType = "memory"

ConfigType is the name of the config type for the memory secret keeper.

Variables

This section is empty.

Functions

func Builder

func Builder(_ context.Context, c any) (secrets.Keeper, error)

Builder constructs a new internal secret store.

func MapSecret

func MapSecret(in map[string]string) secrets.Secret

func SecretMap

func SecretMap(in secrets.Secret) map[string]string

Types

type Config

type Config struct{}

Config is the configuration required for the secret store.

type Memory

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

Memory is a Keeper that stores secrets in memory.

func MustNew

func MustNew() *Memory

MustNew calls New and panics if it returns an error.

func New

func New() (*Memory, error)

New constructs a new secret memory store.

func (*Memory) CopySecret

func (i *Memory) CopySecret(ctx context.Context, id string, location string) (secrets.Secret, error)

CopySecret copies the secret into a new location while leaving the original in the old location.

func (*Memory) DeleteSecret

func (i *Memory) DeleteSecret(_ context.Context, id string) error

DeleteSecret removes the identified secret from the store.

func (*Memory) GetSecret

func (i *Memory) GetSecret(_ context.Context, id string) (secrets.Secret, error)

GetSecret retrieves the identified secret from the internal memory store.

func (*Memory) GetSecretsByName

func (i *Memory) GetSecretsByName(_ context.Context, name string) ([]secrets.Secret, error)

GetSecretsByName retrieves all secrets with the given name.

func (*Memory) ListLocations

func (i *Memory) ListLocations(context.Context) ([]string, error)

ListLocations returns a list of all the secret names in the store.

func (*Memory) ListSecrets

func (i *Memory) ListSecrets(_ context.Context, loc string) ([]string, error)

ListSecrets returns a list of all the secret IDs at the given location.

func (*Memory) MoveSecret

func (i *Memory) MoveSecret(ctx context.Context, id string, location string) (secrets.Secret, error)

MoveSecret moves the secret into another location of the memory store.

func (*Memory) SetSecret

func (i *Memory) SetSecret(_ context.Context, secret secrets.Secret) (secrets.Secret, error)

SetSecret saves the named secret to the given value in the internal memory store.

Jump to

Keyboard shortcuts

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