Documentation ¶
Overview ¶
Package oauth2 provides support for making oAuth2 authorized and authenticated HTTP requests for interactions with Equinix APIs, in particular Equinix specific client credencials grant type
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // ClientID is the application's ID. ClientID string // ClientSecret is the application's secret. ClientSecret string // BaseURL is the base endpoint of a server that token endpoint BaseURL string }
Config describes oauth2 client credentials flow
func (*Config) New ¶
New creates *http.Client with Equinix oAuth2 tokensource. The returned client is not valid beyond the lifetime of the context.
func (*Config) NewWithClient ¶
NewWithClient creates *http.Client with Equinix oAuth2 tokensource and custom *http.Client. The returned client is not valid beyond the lifetime of the context.
func (*Config) TokenSource ¶
TokenSource returns a TokenSource that returns t until t expires, automatically refreshing it as necessary using the provided context and the client ID and client secret.