tokenstore

package
v0.0.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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.

func (TokenStore) SetAll

func (ts TokenStore) SetAll(tokens map[string]any) error

SetAll sets multiple tokens in the keyring.

Directories

Path Synopsis
Package keyring is a simple wrapper that adds timeouts to the zalando/go-keyring package.
Package keyring is a simple wrapper that adds timeouts to the zalando/go-keyring package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL