safe

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2017 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backup added in v0.3.0

func Backup(client backends.Client) error

func NewEmptyNote added in v0.4.0

func NewEmptyNote(name string) note

Types

type Account

type Account struct {
	Username   string         `json:"username"`
	Password   string         `json:"password"`
	CreatedOn  int64          `json:"createdOn"`
	ModifiedOn int64          `json:"modifiedOn"`
	History    accountHistory `json:"history,omitempty"`
}

func NewAccount

func NewAccount(name, username, password string) *Account

func (*Account) SyncWith added in v0.4.0

func (acc *Account) SyncWith(otherAccount *Account, name string) (bool, error)

func (*Account) Update added in v0.4.0

func (acc *Account) Update(cb func(*Account))

type Safe

type Safe struct {
	Config *config.Config

	Accounts map[string]Account `json:"accounts"`
	Notes    *notesManager
	// contains filtered or unexported fields
}

func Load

func Load(password []byte, backend backends.Client, encryptionClient crypto.Client, config *config.Config) (*Safe, error)

func (*Safe) Add

func (s *Safe) Add(name, username, password string) (*Account, error)

func (*Safe) Edit added in v0.4.0

func (s *Safe) Edit(name, username, password string) (*Account, error)

func (*Safe) Get added in v0.3.0

func (s *Safe) Get(name string) (*Account, error)

func (*Safe) List

func (s *Safe) List() map[string]Account

func (*Safe) Move added in v0.4.0

func (s *Safe) Move(name, newName string) error

func (*Safe) Remove

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

func (*Safe) SyncWith added in v0.4.0

func (s *Safe) SyncWith(otherSafe *Safe) error

SyncWith syncs the current safe with another safe if they're branching off the same safe, i.e. are not completely different safes. It simply imports non-existing accounts & notes into the current safe and updates existing accounts & notes if the other safe has a more recent version of an account / note. A backup is made when existing accounts / notes are updated.

Jump to

Keyboard shortcuts

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