passwords

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package passwords contains the in memory data manipulations for password repo

Index

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

Jump to

Keyboard shortcuts

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