Download Gmail credentials

In Chapter 12Concurrency, Networking, and Cloud Services, we wrote the OAuth2 handlers and Gmail integration using only the standard library. For this final code exploration, we'll use the helpful library that Google has created for interacting with Gmail servers. To use this library, we need the client credentials in a different format (credentials.json). To access this, log in to your Google account and go to the Go quickstart page at https://developers.google.com/gmail/api/quickstart/go. Once here, you'll need to click on ENABLE THE GMAIL API and then DOWNLOAD CLIENT CONFIGURATION. This will download the credentials.json file that we'll need to initialize the library in the next section, Creating server provider.

Once you've downloaded the credentials file, you'll need to install the two required libraries using go get -u google.golang.org/api/gmail/v1 and go get -u golang.org/x/oauth2/google. You're then ready to add the code to connect to Gmail and access your emails.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.28.179