Documentation
¶
Overview ¶
Package credentials provides a token provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCredentialsProvider ¶
WithCredentialsProvider sets keychain as a credential provider.
Types ¶
type Credentials ¶
type Credentials struct {
// contains filtered or unexported fields
}
Credentials provides credentials from keychain.
func New ¶
func New(deviceID uuid.UUID, options ...Option) *Credentials
New initiates a new Credentials.
func (*Credentials) Delete ¶
func (c *Credentials) Delete() error
Delete deletes the credentials in keychain.
func (*Credentials) KeychainCredentials ¶
func (c *Credentials) KeychainCredentials() KeychainCredentials
KeychainCredentials provides KeychainCredentials.
func (*Credentials) Password ¶
func (c *Credentials) Password() string
Password returns the password from keychain.
func (*Credentials) Update ¶
func (c *Credentials) Update(username, password string) error
Update persists new credentials to keychain.
func (*Credentials) Username ¶
func (c *Credentials) Username() string
Username returns the username from keychain.
type KeychainCredentials ¶
type KeychainCredentials interface {
n26api.CredentialsProvider
// Update persists new credentials to keychain.
Update(username, password string) error
// Delete deletes the credentials in keychain.
Delete() error
}
KeychainCredentials manages credentials in keychain.
type KeychainCredentialsProvider ¶
type KeychainCredentialsProvider interface {
KeychainCredentials() KeychainCredentials
}
KeychainCredentialsProvider provides KeychainCredentials.
type Option ¶
type Option func(p *Credentials)
Option configures Credentials.
func WithLogger ¶
WithLogger sets logger for Credentials.
func WithStorage ¶
func WithStorage(storage n26keychain.Storage) Option
WithStorage sets storage for Credentials.
Click to show internal directories.
Click to hide internal directories.