tokenstore

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultTokenStoreFactory

type DefaultTokenStoreFactory struct{}

func NewDefaultTokenStoreFactory

func NewDefaultTokenStoreFactory() *DefaultTokenStoreFactory

func (*DefaultTokenStoreFactory) NewTokenStore

func (d *DefaultTokenStoreFactory) NewTokenStore(storeType StoreType) (TokenStore, error)

type FileTokenStore

type FileTokenStore struct {
	// contains filtered or unexported fields
}

func NewFileTokenStore

func NewFileTokenStore() (*FileTokenStore, error)

NewFileTokenStore creates a new FileTokenStore with the default file path in the user's home directory

func NewFileTokenStoreWithBasePath

func NewFileTokenStoreWithBasePath(basePath string) (*FileTokenStore, error)

func (*FileTokenStore) DeleteSession

func (f *FileTokenStore) DeleteSession() error

func (*FileTokenStore) GetFilePath

func (f *FileTokenStore) GetFilePath() string

func (*FileTokenStore) GetSession

func (f *FileTokenStore) GetSession() (*auth.AuthSession, error)

func (*FileTokenStore) HasSession

func (f *FileTokenStore) HasSession() (bool, error)

func (*FileTokenStore) PutSession

func (f *FileTokenStore) PutSession(session auth.AuthSession) error

type KeychainTokenStore

type KeychainTokenStore struct{}

KeychainTokenStore provides a keychain-based implementation of TokenStore

func NewKeychainTokenStore

func NewKeychainTokenStore() (*KeychainTokenStore, error)

func (*KeychainTokenStore) DeleteSession

func (k *KeychainTokenStore) DeleteSession() error

func (*KeychainTokenStore) GetSession

func (k *KeychainTokenStore) GetSession() (*auth.AuthSession, error)

func (*KeychainTokenStore) HasSession

func (k *KeychainTokenStore) HasSession() (bool, error)

func (*KeychainTokenStore) PutSession

func (k *KeychainTokenStore) PutSession(session auth.AuthSession) error

type StoreType

type StoreType int
const (
	StoreTypeKeychain StoreType
	StoreTypeFile
)

func ParseStoreType

func ParseStoreType(s string) (StoreType, error)

func (StoreType) String

func (t StoreType) String() string

type TokenStore

type TokenStore interface {
	PutSession(session auth.AuthSession) error
	GetSession() (*auth.AuthSession, error)
	HasSession() (bool, error)
	DeleteSession() error
}

type TokenStoreFactory

type TokenStoreFactory interface {
	NewTokenStore(storeType StoreType) (TokenStore, error)
}

Jump to

Keyboard shortcuts

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