Documentation ¶
Overview ¶
Package passwords contains the in memory data manipulations for password repo
Index ¶
- type PasswordDB
- type PasswordEntry
- type PasswordRepository
- func (p *PasswordRepository) Add(id, uN, password string, labels []string) error
- func (p *PasswordRepository) GetPassword(id string, showPassword bool) error
- func (p *PasswordRepository) ImportFromCSV(csvFilePath string) error
- func (p *PasswordRepository) SearchID(id string, showPassword bool) ([]string, error)
- func (p *PasswordRepository) SearchLabel(label string, showPassword bool) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PasswordDB ¶
type PasswordDB struct { Entries map[string]PasswordEntry `json:"entries"` Labels map[string][]string `json:"labels"` }
PasswordDB struct represents password db
type PasswordEntry ¶
type PasswordEntry struct { ID string `json:"id"` Username string `json:"username"` Password string `json:"password"` }
PasswordEntry struct represents entry in the password db
type PasswordRepository ¶
type PasswordRepository struct {
// contains filtered or unexported fields
}
PasswordRepository struct handles Password db
func InitPasswordRepo ¶
func InitPasswordRepo(mPassword string) (*PasswordRepository, error)
InitPasswordRepo initializes the Password repository
func (*PasswordRepository) Add ¶
func (p *PasswordRepository) Add(id, uN, password string, labels []string) error
Add method add new password entry to Password db
func (*PasswordRepository) GetPassword ¶
func (p *PasswordRepository) GetPassword(id string, showPassword bool) error
GetPassword method retrieve password entry from Password db
func (*PasswordRepository) ImportFromCSV ¶
func (p *PasswordRepository) ImportFromCSV(csvFilePath string) error
func (*PasswordRepository) SearchID ¶
func (p *PasswordRepository) SearchID(id string, showPassword bool) ([]string, error)
SearchID will return the password entries if the password ID contains the provide key
func (*PasswordRepository) SearchLabel ¶
func (p *PasswordRepository) SearchLabel(label string, showPassword bool) ([]string, error)
SearchLabel will return the password ids if the password labels contains the provide label
Click to show internal directories.
Click to hide internal directories.