Documentation ¶
Index ¶
- type Credential
- type Crypt
- func (c *Crypt) FindCredential(service string) *Credential
- func (c *Crypt) GetCreatedAt() time.Time
- func (c *Crypt) GetJSON() ([]byte, error)
- func (c *Crypt) GetSuggestions(service string) []string
- func (c *Crypt) GetUpdatedAt() time.Time
- func (c *Crypt) IsValid(service string) bool
- func (c *Crypt) Len() int
- func (c *Crypt) RemoveCredential(service string)
- func (c *Crypt) SetCredential(cred Credential)
- type SecurityQuestion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credential ¶
type Credential struct { Service string `json:"service"` Email string `json:"email"` Username string `json:"username"` Password string `json:"password"` Description string `json:"description"` SecurityQuestions []SecurityQuestion `json:"security_questions"` CreatedAt int64 `json:"created_at"` UpdatedAt int64 `json:"updated_at"` }
Credential houses all pertinent information for a given service
func (*Credential) GetCreatedAt ¶
func (c *Credential) GetCreatedAt() time.Time
GetCreatedAt retrieves the credential's creation time
func (*Credential) GetUpdatedAt ¶
func (c *Credential) GetUpdatedAt() time.Time
GetUpdatedAt retrieves the credential's last update time
func (Credential) PrintCredential ¶
func (c Credential) PrintCredential()
PrintCredential prints the credentials while redacting the password
type Crypt ¶
type Crypt struct { Credentials map[string]Credential `json:"credentials"` UpdatedAt int64 `json:"updated_at"` CreatedAt int64 `json:"created_at"` }
Crypt represents contents of a crypt file
func (*Crypt) FindCredential ¶
func (c *Crypt) FindCredential(service string) *Credential
FindCredential finds the Credential struct corresponding to the given service name.
func (*Crypt) GetCreatedAt ¶
GetCreatedAt retrieves the crypt's creation time
func (*Crypt) GetSuggestions ¶
GetSuggestions get the closest services to the given input service based on the edit distance of the service name
func (*Crypt) GetUpdatedAt ¶
GetUpdatedAt retrieves the crypt's last update time
func (*Crypt) RemoveCredential ¶
RemoveCredential removes the given service from the Store
func (*Crypt) SetCredential ¶
func (c *Crypt) SetCredential(cred Credential)
SetCredential is used to add/update the list of credentials
type SecurityQuestion ¶
SecurityQuestion holds a security question and its answer