Documentation ¶
Overview ¶
Package clientcredentials helps with oauth2 client-credentials flow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is context for invokations with client-credentials flow.
type Options ¶
type Options struct { TokenURL string ClientID string ClientSecret string Scope string HTTPClient *http.Client // 0 defaults to 10 seconds. Set to -1 to no soft expire. // // Example: consider expire_in = 30 seconds and soft expire = 10 seconds. // The token will hard expire after 30 seconds, but we will consider it // expired after (30-10) = 20 seconds, in order to attempt renewal before // hard expiration. // SoftExpireInSeconds int Cache token.TokenCache // Time source used to check token expiration. // If unspecified, defaults to time.Now(). TimeSource func() time.Time DisableSingleFlight bool // Logging function, if undefined defaults to log.Printf Logf func(format string, v ...any) // Enable debug logging. Debug bool }
Options define client options.
Click to show internal directories.
Click to hide internal directories.