Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TokenFetcher ¶
type TokenFetcher interface {
FetchToken(ctx context.Context) (token string, expiry time.Time, err error)
}
TokenFetcher is the interface for fetching fresh tokens from an external source (e.g., Databricks CLI, OAuth provider, etc.).
type TokenProvider ¶
type TokenProvider struct {
// contains filtered or unexported fields
}
TokenProvider caches tokens obtained via a TokenFetcher, refreshing them when they are within 5 minutes of expiry.
func NewTokenProvider ¶
func NewTokenProvider(fetcher TokenFetcher) *TokenProvider
NewTokenProvider creates a new TokenProvider backed by the given fetcher.
func (*TokenProvider) CachedToken ¶
func (tp *TokenProvider) CachedToken() string
CachedToken returns the currently cached token (for testing).
Click to show internal directories.
Click to hide internal directories.