filevault

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Location is the location of the saved vault file.
	Location string
	// Key is the key to use to unlock the vault file. It must be 32 bit.
	// If it isn't, it will be padded if it's larger, it will be cropped.
	Key string
}

Config has the configuration options for the file vault.

type Dependencies

type Dependencies struct {
	Logger zerolog.Logger
}

Dependencies defines the dependencies for the plugin provider.

type FileStorer

type FileStorer struct {
	Config
	Dependencies
	// contains filtered or unexported fields
}

FileStorer is a vault backed by an encrypted file.

func NewFileStorer

func NewFileStorer(cfg Config, deps Dependencies) *FileStorer

NewFileStorer creates a vault which contains secrets. The format is: KEY=VALUE KEY2=VALUE2

func (*FileStorer) Init

func (v *FileStorer) Init() error

Init initializes the vault file.

func (*FileStorer) Read

func (v *FileStorer) Read() ([]byte, error)

Read defines a read for the FileVaultStorer. It decrypts the file to get to the content.

func (*FileStorer) Write

func (v *FileStorer) Write(data []byte) error

Write will store the passed in data. How, is up to the implementor. Syncing is up the caller. Otherwise data will be overwritten. The file vault storer will encrypt the file upon writing.

Jump to

Keyboard shortcuts

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