Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOAuth2Client ¶
NewOAuth2Client takes the user through the three-legged OAuth flow. It opens a browser in the native OS or outputs a URL, then blocks until the redirect completes to the /oauth2callback URI. It returns an instance of an HTTP client that can be passed to the constructor of an OAuth client. scopes is a variable number of OAuth scopes
func NewOAuth2TokenSource ¶
func NewOAuth2TokenSource(scopes ...string) (oauth2.TokenSource, error)
NewOAuth2TokenSource takes the user through the three-legged OAuth flow. It opens a browser in the native OS or outputs a URL, then blocks until the redirect completes to the /oauth2callback URI. It returns an instance of an OAuth token source that can be passed to the constructor of an OAuth client. scopes is a variable number of OAuth scopes
Types ¶
type ClientConfig ¶
type ClientConfig struct {
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
RedirectURIs []string `json:"redirect_uris"`
AuthURI string `json:"auth_uri"`
TokenURI string `json:"token_uri"`
}
ClientConfig is a data structure definition for the client_secrets.json file. The code unmarshals the JSON configuration file into this structure.
type Config ¶
type Config struct {
Installed ClientConfig `json:"installed"`
Web ClientConfig `json:"web"`
}
Config is a root-level configuration object.