Documentation ¶
Overview ¶
Package store implements the Password Store.
Index ¶
- type PasswordStore
- func (store *PasswordStore) AddAndCommit(message string, paths ...string) error
- func (store *PasswordStore) ContainsDirectory(dirname string) (bool, string)
- func (store *PasswordStore) ContainsPassword(pwname string) (bool, string)
- func (store *PasswordStore) CopyDirectory(source, dest string) error
- func (store *PasswordStore) CopyPassword(source, dest string) error
- func (store *PasswordStore) GetPassword(pwname string) (string, error)
- func (store *PasswordStore) GetPasswordsList() []string
- func (store *PasswordStore) Init(gpgIDs []string) error
- func (store *PasswordStore) InsertPassword(pwname, pwtext string) error
- func (store *PasswordStore) MoveDirectory(source, dest string) error
- func (store *PasswordStore) MovePassword(source, dest string) error
- func (store *PasswordStore) ReencryptPassword(pwname string) error
- func (store *PasswordStore) RemoveDirectory(dirname string) error
- func (store *PasswordStore) RemovePassword(pwname string) error
- func (store *PasswordStore) SetGPGIDs(gpgIDs []string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PasswordStore ¶
type PasswordStore struct { Path string // path of the store GitDir string // The path of the git directory GPGBin string // The GPG binary to use GPGIDs []string // The GPG IDs used for the store UsesGit bool // Whether or not the store uses git }
PasswordStore represents a password store.
func NewPasswordStore ¶
func NewPasswordStore(storePath string) *PasswordStore
NewPasswordStore returns a new password store.
func (*PasswordStore) AddAndCommit ¶
func (store *PasswordStore) AddAndCommit(message string, paths ...string) error
AddAndCommit adds paths to the index and creates a commit
func (*PasswordStore) ContainsDirectory ¶
func (store *PasswordStore) ContainsDirectory(dirname string) (bool, string)
ContainsDirectory returns whether or not the store contains a directory with this name. it also conveniently returns the directory path that was checked
func (*PasswordStore) ContainsPassword ¶
func (store *PasswordStore) ContainsPassword(pwname string) (bool, string)
ContainsPassword returns whether or not the store contains a password with this name. it also conveniently returns the password path that was checked
func (*PasswordStore) CopyDirectory ¶
func (store *PasswordStore) CopyDirectory(source, dest string) error
CopyDirectory copies a directory from source to dest
func (*PasswordStore) CopyPassword ¶
func (store *PasswordStore) CopyPassword(source, dest string) error
CopyPassword copies a password from source to dest
func (*PasswordStore) GetPassword ¶
func (store *PasswordStore) GetPassword(pwname string) (string, error)
GetPassword returns a decrypted password
func (*PasswordStore) GetPasswordsList ¶
func (store *PasswordStore) GetPasswordsList() []string
GetPasswordsList returns a list of all the passwords
func (*PasswordStore) Init ¶
func (store *PasswordStore) Init(gpgIDs []string) error
Init creates a Password Store at the Path
func (*PasswordStore) InsertPassword ¶
func (store *PasswordStore) InsertPassword(pwname, pwtext string) error
InsertPassword inserts a new password or overwrites an existing one
func (*PasswordStore) MoveDirectory ¶
func (store *PasswordStore) MoveDirectory(source, dest string) error
MoveDirectory moves a directory from source to dest
func (*PasswordStore) MovePassword ¶
func (store *PasswordStore) MovePassword(source, dest string) error
MovePassword moves a passsword or directory from source to dest.
func (*PasswordStore) ReencryptPassword ¶
func (store *PasswordStore) ReencryptPassword(pwname string) error
ReencryptPassword will reencrypt a password to the current GPG ids
func (*PasswordStore) RemoveDirectory ¶
func (store *PasswordStore) RemoveDirectory(dirname string) error
RemoveDirectory removes the directory at the given path
func (*PasswordStore) RemovePassword ¶
func (store *PasswordStore) RemovePassword(pwname string) error
RemovePassword removes the password at the given path
func (*PasswordStore) SetGPGIDs ¶
func (store *PasswordStore) SetGPGIDs(gpgIDs []string) error
SetGPGIDs will set the store's GPG ids