Documentation
¶
Overview ¶
Package oauther encapsulates common OAuth patterns for Google data APIs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Client ¶
func Client(ctx context.Context, filename string, creds []byte, scope ...string) (*http.Client, error)
Client obtains an oauth2-authorized HTTP client. Arguments are the same as for Token, and authorization works the same way.
func Token ¶
func Token(ctx context.Context, filename string, creds []byte, scope ...string) (*oauth2.Token, error)
Token obtains an oauth2 token from the given filename. If the file does not exist, or the token is invalid (e.g. expired), Token first tries to refresh the token (if applicable) and falls back to doing "loopback auth" in the user's browser, storing the resulting token in the named file on success before returning it. Creds are the bytes of a JSON credentials file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.