Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct { State string // contains filtered or unexported fields }
Authenticator encapsulates authentication operations for Gmail APIs.
func NewAuthenticator ¶
func NewAuthenticator(credentials io.Reader) (*Authenticator, error)
NewAuthenticator creates an Authenticator instance from credentials JSON file contents.
Credentials can be obtained by creating a new OAuth client ID at the Google API console https://console.developers.google.com/apis/credentials.
func (Authenticator) AuthURL ¶
func (a Authenticator) AuthURL(redirectURL string) string
AuthURL returns the URL the user has to visit to authorize the application and obtain an auth code.
func (Authenticator) CacheToken ¶
CacheToken creates and caches a token JSON file from an auth code.
The token can be subsequently used to authorize a GmailAPI instance.
Click to show internal directories.
Click to hide internal directories.