Documentation
¶
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) Copy(source, dest string) error
- func (store *PasswordStore) GetPassword(pwname string) (string, error)
- func (store *PasswordStore) GetPasswordsList() []string
- func (store *PasswordStore) Init(gpgID string) error
- func (store *PasswordStore) InsertPassword(pwname, pwtext string) error
- func (store *PasswordStore) Move(source, dest string) error
- func (store *PasswordStore) Remove(pwname 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
GPGID string //The GPG ID used to encrypt the passwords
}
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 ¶ added in v1.0.0
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 ¶ added in v1.0.0
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) Copy ¶
func (store *PasswordStore) Copy(source, dest string) error
Copy copies a password or directory 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 ¶ added in v1.0.0
func (store *PasswordStore) Init(gpgID 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) Move ¶
func (store *PasswordStore) Move(source, dest string) error
Move moves a passsword or directory from source to dest.
func (*PasswordStore) Remove ¶
func (store *PasswordStore) Remove(pwname string) error
Remove removes a password or a directory of the store