quickstart

package module
v0.0.0-...-cad2c4e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2014 License: Apache-2.0 Imports: 19 Imported by: 0

README

Deprecation Notice

This sample project has been deprecated. It is no longer being actively maintained and is probably out of date.

In other words, if you decide to clone this repository, you're on your own.

Google Mirror API's Quickstart for Go

This project shows you how to implement a simple piece of Glassware that demos the major functionality of the Google Mirror API.

To see a fully-working demo of the quick start project, go to https://glass-python-starter-demo.appspot.com/. Otherwise, read on to see how to deploy your own version.

Prerequisites

The Go quick start project is implemented using App Engine. You need the Go App Engine SDK to develop and deploy your project. Run the installer if appropriate for your platform, or extract the zip file in a convenient place.

Configuring the project

Configure the Quick Start project to use your API client information:

  1. Enter your client ID and secret in config.go:
    // Created at http://code.google.com/apis/console, these identify
    // our app for the OAuth protocol.
    clientId     = "[[YOUR_CLIENT_ID]]"
    clientSecret = "[[YOUR_CLIENT_SECRET]]"
    
  2. Generate a session secret string and set it in config.go:
    secret      = "This should really be a secret." // Make it a random string
    
  3. Edit app.yaml to enter your App Engine application ID:
    application: your_appengine_application_id
    version: 1
    runtime: go
    api_version: go1
    ...

Deploying the project

Press the blue Deploy button in the App Engine Launch GUI interface or run this shell command to deploy your code:

$ appcfg.py --oauth2 update .

Documentation

Overview

Package quickstart provides examples to quickly get started on the Google Mirror API with Go on Google App Engine.

The main entry points are:

  • main.go: Displays the main page and handles requests from the main UI; this where most of the Mirror API logic is implemented.
  • auth.go: Handles authentication and log-out though OAuth 2.0
  • notify.go: Handles push notifications from the Mirror API.
  • attachment.go: Proxies requests from the main page to retrieve media attachments for the current user.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleToken

type SimpleToken struct {
	AccessToken  string
	RefreshToken string
	Expiry       time.Time // If zero the token has no (known) expiry time.
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL