model

package
v0.0.0-...-ce9cd71 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorProfileDoesNotExist         = errors.New("profile does not exist")
	ErrorProfileAlreadyExists        = errors.New("profile already exists")
	ErrorLoginAlreadyExistsInProfile = errors.New("login already exists in profile")
	ErrorLoginDoesNotExistInProfile  = errors.New("login does not exist in profile")
)

Functions

This section is empty.

Types

type Login

type Login struct {
	Username string
	Domain   string
	// contains filtered or unexported fields
}

func (Login) DecryptPassword

func (l Login) DecryptPassword() (string, error)

type Profile

type Profile struct {
	Username string
	// contains filtered or unexported fields
}

func NewProfile

func NewProfile(username, secret string) (*Profile, error)

func (*Profile) AddLogin

func (p *Profile) AddLogin(username, domain, password string) error

func (*Profile) GetLogins

func (p *Profile) GetLogins() loginList

func (*Profile) HasLogin

func (p *Profile) HasLogin(username, domain string) bool

func (*Profile) RemoveLogin

func (p *Profile) RemoveLogin(username, domain string) error

type ProfileRepository

type ProfileRepository interface {
	Save(*Profile) error
	GetProfileByUsername(string) (*Profile, error)
}

Jump to

Keyboard shortcuts

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