service

package
v0.0.0-...-9f2da65 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_DATABASE_NAME = "harpocrates.db"
View Source
const DEFAULT_SETTINGS_NAME = "harpocrates.ini"

Variables

View Source
var PRIVATE_KEY_LOCATION string
View Source
var PUBLIC_KEY_LOCATION string

Functions

This section is empty.

Types

type Password

type Password struct {
	Url               string
	EncryptedPassword []byte
}

type PasswordRepresentation

type PasswordRepresentation struct {
	Name     string
	Url      string
	Password string
}

type PasswordService

type PasswordService struct {
	// contains filtered or unexported fields
}

func NewPasswordService

func NewPasswordService(
	cryptoManager core.CryptoManager,
	privateKey *rsa.PrivateKey,
	publicKey *rsa.PublicKey,
	storageService Storage,
) *PasswordService

func (*PasswordService) DeletePassword

func (p *PasswordService) DeletePassword(name string) error

func (*PasswordService) ExportToCsv

func (p *PasswordService) ExportToCsv(filename string)

func (*PasswordService) GetPassword

func (p *PasswordService) GetPassword(name string) (*PasswordRepresentation, error)

func (*PasswordService) ListPasswords

func (p *PasswordService) ListPasswords() []*PasswordRepresentation

func (*PasswordService) StorePassword

func (p *PasswordService) StorePassword(representation PasswordRepresentation) (*PasswordRepresentation, error)

type Storage

type Storage interface {
	StorePasswords(passwords map[string]Password)
	ReadPasswords() map[string]Password
	StoreSettings(settings map[string]string)
	ReadSettings() map[string]string
	AreSettingsExists() bool
}

func NewStorage

func NewStorage(passwordLocation, defaultSettingsLocation, mode string) Storage

Jump to

Keyboard shortcuts

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