Versions in this module Expand all Collapse all v0 v0.1.1 Feb 4, 2026 v0.1.0 Feb 3, 2026 Changes in this version + var ErrNoCredentials = errors.New("no oauth credentials configured") + var ErrNoToken = errors.New("no token found") + var ErrNotAuthenticated = errors.New("not authenticated") + func Authorize(ctx context.Context, creds OAuthCredentials, opts AuthorizeOptions) (string, error) + func DefaultRedirectURI(port int) string + func IsKeychainLockedError(msg string) bool + func ResolveRedirectURI(creds OAuthCredentials, port int) string + type AuthorizeOptions struct + Manual bool + Port int + Timeout time.Duration + type KeyringStore struct + func (s *KeyringStore) CredentialsExists() (bool, error) + func (s *KeyringStore) DeleteCredentials() error + func (s *KeyringStore) DeleteToken() error + func (s *KeyringStore) GetCredentials() (OAuthCredentials, error) + func (s *KeyringStore) GetToken() (Token, error) + func (s *KeyringStore) SetCredentials(creds OAuthCredentials) error + func (s *KeyringStore) SetToken(tok Token) error + type OAuthCredentials struct + ClientID string + ClientSecret string + RedirectURI string + type OAuthTokenSource struct + func NewOAuthTokenSource(store Store, creds OAuthCredentials) *OAuthTokenSource + func (ts *OAuthTokenSource) Invalidate() + func (ts *OAuthTokenSource) Token() (*oauth2.Token, error) + type RefreshTokenSource struct + func NewRefreshTokenSource(creds OAuthCredentials, refreshToken string) *RefreshTokenSource + func (ts *RefreshTokenSource) Token() (*oauth2.Token, error) + type Store interface + CredentialsExists func() (bool, error) + DeleteCredentials func() error + DeleteToken func() error + GetCredentials func() (OAuthCredentials, error) + GetToken func() (Token, error) + SetCredentials func(creds OAuthCredentials) error + SetToken func(tok Token) error + func OpenDefault() (Store, error) + type TestTokenSource struct + func NewTestTokenSource(store Store) *TestTokenSource + func (ts *TestTokenSource) Token() (*oauth2.Token, error) + type Token struct + CreatedAt time.Time + RefreshToken string + TestToken string