Documentation ¶
Overview ¶
Package credentials implements our struct stored in keychain. Store struct is kind of like a database client. Credentials struct is kind of like one record from the database.
Index ¶
- Variables
- type Credentials
- func (s *Credentials) CheckPassword(password string) error
- func (s *Credentials) EmailList() []string
- func (s *Credentials) IsConnected() bool
- func (s *Credentials) Logout()
- func (s *Credentials) Marshal() string
- func (s *Credentials) SetEmailList(list []string)
- func (s *Credentials) Unmarshal(secret string) error
- type Store
- func (s *Store) Add(userID, userName, apiToken, mailboxPassword string, emails []string) (creds *Credentials, err error)
- func (s *Store) Delete(userID string) (err error)
- func (s *Store) Get(userID string) (creds *Credentials, err error)
- func (s *Store) GetAndCheckPassword(userID, password string) (creds *Credentials, err error)
- func (s *Store) List() (userIDs []string, err error)
- func (s *Store) Logout(userID string) error
- func (s *Store) SwitchAddressMode(userID string) error
- func (s *Store) UpdateEmails(userID string, emails []string) error
- func (s *Store) UpdatePassword(userID, password string) error
- func (s *Store) UpdateToken(userID, apiToken string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrWrongFormat = errors.New("malformed credentials")
)
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct { UserID, Name, Emails, APIToken, MailboxPassword, BridgePassword, Version string Timestamp int64 IsHidden, IsCombinedAddressMode bool }
func (*Credentials) CheckPassword ¶
func (s *Credentials) CheckPassword(password string) error
func (*Credentials) EmailList ¶
func (s *Credentials) EmailList() []string
func (*Credentials) IsConnected ¶
func (s *Credentials) IsConnected() bool
func (*Credentials) Logout ¶
func (s *Credentials) Logout()
func (*Credentials) Marshal ¶
func (s *Credentials) Marshal() string
func (*Credentials) SetEmailList ¶
func (s *Credentials) SetEmailList(list []string)
func (*Credentials) Unmarshal ¶
func (s *Credentials) Unmarshal(secret string) error
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is an encrypted credentials store.
func (*Store) Add ¶
func (s *Store) Add(userID, userName, apiToken, mailboxPassword string, emails []string) (creds *Credentials, err error)
func (*Store) GetAndCheckPassword ¶
func (s *Store) GetAndCheckPassword(userID, password string) (creds *Credentials, err error)
func (*Store) SwitchAddressMode ¶
func (*Store) UpdatePassword ¶
func (*Store) UpdateToken ¶
Click to show internal directories.
Click to hide internal directories.