Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a new http.Client suitable for passing to the New functions from the packages under google.golang.org/api/. An interactive OAuth flow is performed if the credentials don't exist in the config file. An attempt to be open a web browser will done if opts.OpenBrowser is true.
TODO(razvanm): add support for refresh tokens. TODO(razvanm): add support for Application Default Credentials.
Types ¶
type Options ¶
type Options struct { ClientID string ClientSecret string // Scopes indicates what scope to request. Scopes []string // AccessType indicates what type of access is desireed. The two possible // options are oauth2.AccessTypeOnline and oauth2.AccessTypeOffline. AccessType oauth2.AuthCodeOption // ConfigFile indicates where to look for and save the credentials. On Linux // this is something like ~/.config/grail-role-group/credentials.json. ConfigFile string // OpenBrowser indicates that a browser should be open to obtain the proper // credentials if they are missing. OpenBrowser bool }
Options describes various options that can be used to create the client.
Click to show internal directories.
Click to hide internal directories.