app

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotRegistered ...
	ErrNotFound = errors.New("no database")
	// ErrNotLogged ...
	ErrNotLogged = errors.New("not logged in")
)

Common errors

Functions

func GeneratePassword

func GeneratePassword(length, numDigits, numSymbols int, noUpper, allowRepeat bool) (string, error)

GeneratePassword ...

Types

type Dir

type Dir string

Dir defines the current workspace. An empty Dir is treated as ".".

func (Dir) Join

func (d Dir) Join(path string) string

Join joins the given ptha to the current directory.

func (Dir) String

func (d Dir) String() string

String implements the fmt.Stringer interface.

type Login

type Login struct {
	Username string `json:"user"`
	Password string `json:"pass"`
	URL      string `json:"url,omitempty"`
	Note     string `json:"note,omitempty"`
}

Login contains all login's data as plaintext.

type Safe

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

Safe ...

func New

func New(db safe.Service, salt, root string, session Session) *Safe

New ...

func (*Safe) Close

func (s *Safe) Close() (err error)

Close ...

func (*Safe) CreateTag

func (s *Safe) CreateTag(name string) (*safe.Tag, error)

CreateTag ...

func (*Safe) CreateVault

func (s *Safe) CreateVault(name, tag string, data Login) (*safe.Vault, error)

CreateVault ...

func (*Safe) DeleteTag

func (s *Safe) DeleteTag(name string) error

DeleteTag ...

func (*Safe) DeleteVault

func (s *Safe) DeleteVault(name, tag string) error

DeleteVault ...

func (*Safe) ListTagByNames

func (s *Safe) ListTagByNames() ([]*safe.Tag, error)

ListTagByNames ...

func (*Safe) ListVaultByNames

func (s *Safe) ListVaultByNames(tag, prefix string) ([]*safe.Vault, error)

ListVaultByNames ...

func (*Safe) LogOut

func (s *Safe) LogOut()

LogOut ..

func (*Safe) Logged

func (s *Safe) Logged() error

Logged ...

func (*Safe) Login

func (s *Safe) Login(pass string) error

Login ...

func (*Safe) Root

func (s *Safe) Root() Dir

Root ...

func (*Safe) SignIn

func (s *Safe) SignIn(pass string) (ok bool)

SignIn ...

func (*Safe) SignUp

func (s *Safe) SignUp(pass string) (err error)

SignUp ...

func (*Safe) UpdateVault

func (s *Safe) UpdateVault(name, tag string, data Login) (*safe.Vault, error)

UpdateVault ...

func (*Safe) Vault

func (s *Safe) Vault(name, tag string) (*safe.Vault, error)

Vault ...

type Session

type Session interface {
	Lifetime() time.Duration
	Tick() time.Duration
}

Session ...

func NewSession

func NewSession(lifetime, tick time.Duration) Session

NewSession ...

Jump to

Keyboard shortcuts

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