keepers

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: MIT Imports: 2 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 map[string]string

func (Config) Get

func (c Config) Get(name string) string

func (Config) Set

func (c Config) Set(name, value string) Config

type Configurator

type Configurator interface {
	Setup(input ...any) Config
}

type Encrypter

type Encrypter interface {
	Decrypt(config Config, content io.Reader) (io.Reader, error)
	Encrypt(config Config, content io.Reader) (io.Reader, error)
}

type Hasher

type Hasher interface {
	Hash(config Config, password string) (string, error)
	Verify(config Config, hashedPassword, password string) bool
}

type Keeper

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

func (*Keeper) Decrypt

func (k *Keeper) Decrypt(content io.Reader) (io.Reader, error)

func (*Keeper) Encrypt

func (k *Keeper) Encrypt(content io.Reader) (io.Reader, error)

func (*Keeper) Hash

func (k *Keeper) Hash(password string) (string, error)

func (*Keeper) SetConfigurator

func (k *Keeper) SetConfigurator(c Configurator) *Keeper

func (*Keeper) SetEncrypter

func (k *Keeper) SetEncrypter(e Encrypter) *Keeper

func (*Keeper) SetHasher

func (k *Keeper) SetHasher(h Hasher) *Keeper

func (*Keeper) Setup

func (k *Keeper) Setup(input ...any) *Keeper

func (*Keeper) Verify

func (k *Keeper) Verify(hashedPassword, password string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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