storage

package
v0.0.0-...-2bc4a0e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const KeySize = 32

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Storage

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

func New

func New(blob, nonce, key []byte) (*Storage, error)

func (*Storage) Encrypt

func (st *Storage) Encrypt(key []byte) (blob []byte, nonce []byte, err error)

Encrypt encrypts passwords into a blob.

func (*Storage) Get

func (st *Storage) Get(label string) (string, error)

Get returns a password for the given label.

func (*Storage) List

func (st *Storage) List() []string

List returns all labels.

func (*Storage) Put

func (st *Storage) Put(label, passwd string)

Put adds a new password with the given label.

func (*Storage) Remove

func (st *Storage) Remove(label string) error

Remove returns a label with corresponding password.

Jump to

Keyboard shortcuts

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