Documentation ¶
Index ¶
Constants ¶
View Source
const ( AuthTimeout = 90 * time.Second AuthListenAddr = "127.0.0.1" AuthScheme = "http://" )
Variables ¶
View Source
var ( ErrOAuthUUID = errors.New("unable to generate UUID") ErrOAuthFreePort = errors.New("unable to get a free port") ErrOAuthHTTPServer = errors.New("unable to start HTTP server") ErrOAuthBrowser = errors.New("unable to open system browser") ErrOAuthTimeout = errors.New("timeout while waiting for authentication to finish") ErrOAuthTokenFetch = errors.New("unable to retrieve token from Google API") ErrOAuthTokenSave = errors.New("unable to save token to file") ErrOAuthTokenEncode = errors.New("unable to encode OAuth token to JSON") )
Functions ¶
func GetClient ¶
GetClient retrieves an HTTP client with OAuth2 authentication.
It takes the following parameters: - ctx: the context.Context to use for the HTTP client. - config: the *oauth2.Config object containing the OAuth2 configuration. - tokenPath: the path to the token file.
It returns a *http.Client and an error.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.