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) SplitAPIToken() (string, string, error)
- func (s *Credentials) Unmarshal(secret string) error
- type Store
- func (s *Store) Add(userID, userName, uid, ref string, mailboxPassword []byte, emails []string) (*Credentials, 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) (*Credentials, error)
- func (s *Store) SwitchAddressMode(userID string) (*Credentials, error)
- func (s *Store) UpdateEmails(userID string, emails []string) (*Credentials, error)
- func (s *Store) UpdatePassword(userID string, password []byte) (*Credentials, error)
- func (s *Store) UpdateToken(userID, uid, ref string) (*Credentials, 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 string MailboxPassword []byte 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) SplitAPIToken ¶ added in v1.8.0
func (s *Credentials) SplitAPIToken() (string, string, error)
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) GetAndCheckPassword ¶
func (s *Store) GetAndCheckPassword(userID, password string) (creds *Credentials, err error)
func (*Store) SwitchAddressMode ¶
func (s *Store) SwitchAddressMode(userID string) (*Credentials, error)
func (*Store) UpdateEmails ¶
func (s *Store) UpdateEmails(userID string, emails []string) (*Credentials, error)
func (*Store) UpdatePassword ¶
func (s *Store) UpdatePassword(userID string, password []byte) (*Credentials, error)
func (*Store) UpdateToken ¶
func (s *Store) UpdateToken(userID, uid, ref string) (*Credentials, error)
Click to show internal directories.
Click to hide internal directories.