vault

package
v0.0.0-...-1f0a743 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Vault

type Vault struct {
	Accounts []account.Info
	// contains filtered or unexported fields
}

Vault defines our vault with path and password. Only the accounts should be exported

func New

func New(p string, pwd []byte) (*Vault, error)

New instantiates a new vault

func (*Vault) AddAccount

func (v *Vault) AddAccount(account account.Info)

AddAccount adds a new account to the vault

func (*Vault) GetAccountInfo

func (v *Vault) GetAccountInfo(addr address.Address) (*account.Info, error)

GetAccountInfo tries to find the given address and returns the account from the vault

func (*Vault) HasAccount

func (v *Vault) HasAccount(addr address.Address) bool

HasAccount returns true when the vault has an account for the given address

func (*Vault) RemoveAccount

func (v *Vault) RemoveAccount(addr address.Address)

RemoveAccount removes the given account from the vault

func (*Vault) Save

func (v *Vault) Save() error

Save saves the account data back into the vault on disk

Jump to

Keyboard shortcuts

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