restore

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Restore

func Restore(cfg Config, p PasswordProvider, log logr.Logger) error

Restore merges a set of parts into the original secret.

Types

type Config

type Config interface {
	Format() (format.Format, error)
	Decrypt() bool
	Output() (io.Writer, error)
	FileNames() []string
}

Config holds the values controlling the restore behaviour.

type PasswordProvider

type PasswordProvider interface {
	GetPassword(prompt string) ([]byte, error)
}

PasswordProvider allows Restore to ask for passwords of encrypted parts.

type StdinPasswordProvider

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

StdinPasswordProvider implements PasswordProvider It uses a given writer for writing input prompts and STDIN for reading passwords from.

func NewPasswordProvider

func NewPasswordProvider(w io.Writer) *StdinPasswordProvider

NewPasswordProvider returns an instance of StdinPasswordProvider.

func (*StdinPasswordProvider) GetPassword

func (p *StdinPasswordProvider) GetPassword(prompt string) ([]byte, error)

GetPassword prompts the user and returns the password read from the terminal.

Jump to

Keyboard shortcuts

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