Versions in this module Expand all Collapse all v0 v0.0.1 Apr 15, 2022 Changes in this version + var HTTPClient internal.ContextKey + var NoContext = context.TODO() + func NewClient(ctx context.Context, src TokenSource) *http.Client + func RegisterBrokenAuthHeaderProvider(tokenURL string) + type AuthCodeOption interface + var AccessTypeOffline AuthCodeOption = SetAuthURLParam("access_type", "offline") + var AccessTypeOnline AuthCodeOption = SetAuthURLParam("access_type", "online") + var ApprovalForce AuthCodeOption = SetAuthURLParam("prompt", "consent") + func SetAuthURLParam(key, value string) AuthCodeOption + type AuthStyle int + const AuthStyleAutoDetect + const AuthStyleInHeader + const AuthStyleInParams + type Config struct + ClientID string + ClientSecret string + Endpoint Endpoint + RedirectURL string + Scopes []string + func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string + func (c *Config) Client(ctx context.Context, t *Token) *http.Client + func (c *Config) Exchange(ctx context.Context, code string, opts ...AuthCodeOption) (*Token, error) + func (c *Config) PasswordCredentialsToken(ctx context.Context, username, password string) (*Token, error) + func (c *Config) TokenSource(ctx context.Context, t *Token) TokenSource + type Endpoint struct + AuthStyle AuthStyle + AuthURL string + TokenURL string + type RetrieveError struct + Body []byte + Response *http.Response + func (r *RetrieveError) Error() string + type Token struct + AccessToken string + Expiry time.Time + RefreshToken string + TokenType string + func (t *Token) Extra(key string) interface{} + func (t *Token) SetAuthHeader(r *http.Request) + func (t *Token) Type() string + func (t *Token) Valid() bool + func (t *Token) WithExtra(extra interface{}) *Token + type TokenSource interface + Token func() (*Token, error) + func ReuseTokenSource(t *Token, src TokenSource) TokenSource + func StaticTokenSource(t *Token) TokenSource + type Transport struct + Base http.RoundTripper + Source TokenSource + func (t *Transport) CancelRequest(req *http.Request) + func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error)