Documentation ¶
Index ¶
- Variables
- func DebugTransport(base http.RoundTripper, debug bool) http.RoundTripper
- func OAuth2ClientCredentials(ctx context.Context, uri, clientID, clientSecret string) oauth2.TokenSource
- func RateLimitTransport(base http.RoundTripper) http.RoundTripper
- func StaticToken(token string) oauth2.TokenSource
- func UserAgentTransport(base http.RoundTripper, userAgent string) http.RoundTripper
- func Wrap(base *http.Client, tokenSource oauth2.TokenSource, options ...Option) *http.Client
- type Option
- type RoundTripFunc
Constants ¶
This section is empty.
Variables ¶
var UserAgent = fmt.Sprintf("Go-Auth0-SDK/%s", auth0.Version)
UserAgent is the default user agent string.
Functions ¶
func DebugTransport ¶
func DebugTransport(base http.RoundTripper, debug bool) http.RoundTripper
DebugTransport wraps base transport with the ability to log the contents of requests and responses.
func OAuth2ClientCredentials ¶
func OAuth2ClientCredentials(ctx context.Context, uri, clientID, clientSecret string) oauth2.TokenSource
OAuth2ClientCredentials sets the oauth2 client credentials.
func RateLimitTransport ¶
func RateLimitTransport(base http.RoundTripper) http.RoundTripper
RateLimitTransport wraps base transport with rate limiting functionality.
When a 429 status code is returned by the remote server, the "X-RateLimit-Reset" header is used to determine how long the transport will wait until re-issuing the failed request.
func StaticToken ¶
func StaticToken(token string) oauth2.TokenSource
StaticToken sets a static token to be used for oauth2.
func UserAgentTransport ¶
func UserAgentTransport(base http.RoundTripper, userAgent string) http.RoundTripper
UserAgentTransport wraps base transport with a customized "User-Agent" header.
Types ¶
type Option ¶
Option is the type used to configure a client.
func WithRateLimit ¶
func WithRateLimit() Option
WithRateLimit configures the client to enable rate limiting.
func WithUserAgent ¶
WithUserAgent configures the client to overwrite the user agent header.
type RoundTripFunc ¶
RoundTripFunc is an adapter to allow the use of ordinary functions as HTTP round trips.