seq

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigType = "seq"

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

Variables

This section is empty.

Functions

func Builder

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

Builder constructs a new seq secret keeper.

func Validator

func Validator(ctx context.Context, c any) error

Validator validates the seq keeper configuration.

Types

type Config

type Config struct {
	// Keepers is the list of keepers to use for the seq keeper.
	Keepers []string `mapstructure:"keepers" yaml:"keepers"`
}

Config is the configuration for the seq secret keeper.

type Seq

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

Seq is a Keeper that gets secrets from the first Keeper that returns it.

func NewSeq

func NewSeq(keepers ...secrets.Keeper) (*Seq, error)

NewSeq returns a new sequential keeper with the given list of Keepers.

func (*Seq) CopySecret

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

CopySecret gets the secret from any of the Keepers in the Seq and makes a copy of it in the first Keeper at the new location.

func (*Seq) DeleteSecret

func (s *Seq) DeleteSecret(
	ctx context.Context,
	id string,
) error

DeleteSecret deletes the secret from all Keepers.

func (*Seq) GetSecret

func (s *Seq) GetSecret(
	ctx context.Context,
	id string,
) (secrets.Secret, error)

GetSecret returns the secret from the first Keeper that returns it.

func (*Seq) GetSecretsByName

func (s *Seq) GetSecretsByName(
	ctx context.Context,
	name string,
) ([]secrets.Secret, error)

GetSecretsByName returns all secrets with the given name from all Keepers.

func (*Seq) ListLocations

func (s *Seq) ListLocations(ctx context.Context) ([]string, error)

ListLocations returns the list of locations from all Keepers.

func (*Seq) ListSecrets

func (s *Seq) ListSecrets(
	ctx context.Context,
	location string,
) ([]string, error)

ListSecrets returns the list of secrets from all Keepers in the named location.

func (*Seq) MoveSecret

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

MoveSecret gets the secret from any of the Keepers in the Seq, then deletes it from all Keepers, and then stores it in the first Keeper at the new location.

func (*Seq) SetSecret

func (s *Seq) SetSecret(
	ctx context.Context,
	sec secrets.Secret,
) (secrets.Secret, error)

SetSecret stores the secret in the first Keeper.

Jump to

Keyboard shortcuts

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