How Do I Write And Deploy Simple Web Apps With Go? cover page
How Do I Write And Deploy Simple Web Apps With Go?

How Do I Write And Deploy Simple Web Apps With Go?


A comprehensive tutorial.
How Do I Write And Deploy Simple Web Apps With Go? Edit
This book is 100% Complete

Updated

  • $5.99

    Minimum

  • $9.99

    Suggested

About the Book

The aim of the book is to get Go newbies started with developing and deploying web applications written using the Go programming language. By the time you finish reading the book, you would have developed and deployed many fun Go web apps on Heroku and Google App Engine.

You will learn to:

  • create static sites with Go
  • consume JSON apis with a Go web app
  • interact with Google apis with a Go web app
  • use MongoDB with Go on the web and 
  • use Martini the Go web framework.

Read More

Table of Contents

  • Preface
    • Who is the eBook for?
    • Acknowledgements
    • How to Use This eBook
    • Using Code Examples
    • Getting the Code
    • How to Contact Me
    • Thanks
  • 1. Go Code Organization
    • 1.1 Workspaces
    • 1.2 The GOPATH environment variable
    • 1.3 Package paths
  • 2. A basic Go web app
  • 3. Static Sites with Go
  • 4. Using a Web Service - JSON with Go
    • 4.1 hosttip.info service
  • 5. Package template
    • 5.1 struct
    • 5.2 array
    • 5.3 slice
    • 5.4 text/template
      • 5.4.1 Pipelines
      • 5.4.2 Variables
    • 5.5 html/template
      • 5.5.1 Modify dosasite.go to use templates
    • 5.6 Handling Forms
    • 5.7 Web app stringupper
  • 6. Using Google Geocoding and Street View Image APIs
    • 6.1 APIs to be used
    • 6.2 Create folders
    • 6.3 File goview.css
    • 6.4 Program geoweb.go
      • 6.4.1 User Form
      • 6.4.2 QueryEscape
      • 6.4.3 defer
      • 6.4.4 Unmarshal
      • 6.4.5 Using Google Geocoding and Street View Image APIs
        • 6.4.5.1 Required parameters
  • 7. Go and MongoDB on MongoLab
    • 7.1 What’s NoSQL?
    • 7.2 What’s MongoDB?
      • 7.2.1 MongoDB Core Concepts
    • 7.3 MongoLab - The Fully-managed MongoDB-as-a-Service
      • 7.3.1 Sign Up
      • 7.3.2 Create a database
      • 7.3.3 Database User
      • 7.3.4 mgo
      • 7.3.5 JSON Recap
      • 7.3.6 package mgo
        • 7.3.6.1 Function Close
        • 7.3.6.2 Function SetSafe
        • 7.3.6.3 Function Safe
        • 7.3.6.4 Function DB
        • 7.3.6.5 Function C
        • 7.3.6.6 Function Insert
        • 7.3.6.7 Function Find
        • 7.3.6.8 Function One
      • 7.3.7 package bson
        • 7.3.7.1 type M
      • 7.3.8 Program mongohqconnect.go
      • 7.3.9 Web app trails.go
  • 8. Go and Gmail
  • 9. A Fun, Weather Forecast Go Web App
    • 9.1 Register for an account at Forecast for Developers
      • 9.1.1 Study the API documentation
        • 9.1.1.1 The Forecast Call
        • 9.1.1.2 Data Points
      • 9.1.2 Our app weather.go
        • 9.1.2.1 Concurrent Queries
        • 9.1.2.2 Run the program
  • 10. Deploying Go Web Apps to Heroku
    • 10.1 Cloud Computing Service Levels
      • 10.1.1 SaaS
      • 10.1.2 IaaS
      • 10.1.3 PaaS
    • 10.2 Create an account on Heroku
    • 10.3 Install the Heroku Toolbelt
    • 10.4 Create a Procfile
    • 10.5 Use Git
    • 10.6 Install Godep
    • 10.7 Heroku deploy
    • 10.8 Program gomongohq.go
  • 11. Deploying Go Web Apps to Google App Engine
    • 11.1 Google App Engine
      • 11.1.1 Sandbox
      • 11.1.2 Services
      • 11.1.3 The Administration Console
      • 11.1.4 Applications (web and non-web)
      • 11.1.5 DataStore
    • 11.2 The Go runtime environment
    • 11.3 Download and Install the App Engine SDK
    • 11.4 Let us build a small app (mytext.go) locally
      • 11.4.1 Program mytext.go
      • 11.4.2 Create the Configuration File
      • 11.4.3 Test the App
      • 11.4.4 Iterative Development
    • 11.5 Uploading Your App to Google’s App Engine
      • 11.5.1 Registering the App
      • 11.5.2 Upload and Access the app
    • 11.6 Web app upperstring.go
    • 11.7 Web app EXIF Map - blobstrex.go
      • 11.7.1 Program blobstrex.go
        • 11.7.1.1 File app.yaml
      • 11.7.2 Blobstore Go API
        • 11.7.2.1 The appengine package
          • 11.7.2.1.1 NewContext
        • 11.7.2.2 The blobstore package
          • 11.7.2.2.1 UploadUrl
      • 11.7.3 Uploading a photo (blob)
        • 11.7.3.1 Create an upload URL
        • 11.7.3.2 Create an upload form
      • 11.7.4 Using goexif
      • 11.7.5 Google Static Maps API
    • 11.8 Modifying geoweb.go for Google App Engine
    • 11.9 Check out
  • 12. Web Toolkits and App Frameworks for Go
    • 12.1 Martini
    • 12.2 Installation of Martini
      • 12.2.1 Check whether Martini works
      • 12.2.2 Classic Martini
      • 12.2.3 Handlers
        • 12.2.3.1 Return Values
      • 12.2.4 Routing
      • 12.2.5 Serving Static Files
      • 12.2.6 Middleware Handlers
    • 12.3 Upload a Martini app to Google App Engine
    • 12.4 What next?

Read More

About the Author

About the Contributors

Face

Victor Goff


Mentoring at RubyLearning.org since 2008.

Read More

Sanat

Sanat Gersappa

Mr.


Occupation: Web Guy, Early Adopter, Alpha Geek, Options Trader. Skills: Specialist in Web technologies. Good at ASP.NET, Node.js, Go, Client-side Javascript frameworks.

Read More

The Leanpub Unconditional, No Risk, 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks. We process the refunds manually, so they may take a few days to show up.
See full terms