Documentation ¶
Overview ¶
Package auth provides Google oauth2 bindings for mantle.
Index ¶
- func GoogleClient() (*http.Client, error)
- func GoogleClientFromJSONKey(jsonKey []byte, scope ...string) (*http.Client, error)
- func GoogleServiceClient() *http.Client
- func GoogleServiceTokenSource() oauth2.TokenSource
- func GoogleTokenSource() (oauth2.TokenSource, error)
- func GoogleTokenSourceFromJSONKey(jsonKey []byte, scope ...string) (oauth2.TokenSource, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GoogleClient ¶
GoogleClient provides an http.Client authorized with an oauth2 token that is automatically cached and refreshed from a file named '.mantle-cache-google.json'. This uses interactive oauth2 authorization and requires a user follow to follow a web link and paste in an authorization token.
func GoogleClientFromJSONKey ¶
GoogleClientFromJSONKey provides an http.Client authorized with an oauth2 token retrieved using a Google Developers service account's private JSON key file.
func GoogleServiceClient ¶
GoogleServiceClient fetchs a token from Google Compute Engine's metadata service. This should be used on GCE vms. The Default account is used.
func GoogleServiceTokenSource ¶
func GoogleServiceTokenSource() oauth2.TokenSource
GoogleServiceTokenSource provides an oauth2.TokenSource authorized in the same manner as GoogleServiceClient().
func GoogleTokenSource ¶
func GoogleTokenSource() (oauth2.TokenSource, error)
GoogleTokenSource provides an outh2.TokenSource authorized in the same manner as GoogleClient.
func GoogleTokenSourceFromJSONKey ¶
func GoogleTokenSourceFromJSONKey(jsonKey []byte, scope ...string) (oauth2.TokenSource, error)
GoogleTokenSourceFromJSONKey provides an oauth2.TokenSource authorized in the same manner as GoogleClientFromJSONKey.
Types ¶
This section is empty.