Documentation
¶
Index ¶
- type TokenStore
- func (ts TokenStore) Available() (bool, error)
- func (ts TokenStore) Delete(keys ...string) error
- func (ts TokenStore) Get(key string) (string, error)
- func (ts TokenStore) GetAll(keys ...string) (map[string]string, error)
- func (ts TokenStore) Set(key, token string) error
- func (ts TokenStore) SetAll(tokens map[string]any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenStore ¶
type TokenStore struct {
Service string
}
TokenStore provides methods to manage authentication tokens using the keyring package.
func New ¶
func New() TokenStore
New creates a new TokenStore instance with the default service name.
func (TokenStore) Available ¶
func (ts TokenStore) Available() (bool, error)
Available checks if the keyring service is available for storing tokens.
func (TokenStore) Delete ¶
func (ts TokenStore) Delete(keys ...string) error
Delete removes the given keys from the keyring. If no keys are provided, it clears all keys for the service.
func (TokenStore) Get ¶
func (ts TokenStore) Get(key string) (string, error)
Get retrieves a token from the keyring for a specific key.
func (TokenStore) GetAll ¶
func (ts TokenStore) GetAll(keys ...string) (map[string]string, error)
GetAll retrieves a map of tokens from the keyring for the specified keys. If a key is not found, it is skipped.
func (TokenStore) Set ¶
func (ts TokenStore) Set(key, token string) error
Set stores a token in the keyring for a specific key.
Click to show internal directories.
Click to hide internal directories.