go-hello-world

command module
v0.0.0-...-cc6b18b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

README

#Go Hello World Overview

This app is a hello world plus a little big of basic functionality using Golang. The application uses Gin-Gonic for the app router and for templating.

Also check out a blog post on this topic as well for a more in depth look at Go and Gin-Gonic.

Build Status

Build Status Bluemix Deployments

Running the app on Bluemix

You can deploy your own instance of Go Hello World app to Bluemix. To do this, you can either use the Deploy to Bluemix button for an automated deployment or follow the step below to create and deploy your app manually.

Deploy to Bluemix

  1. Install Go. If you have Go installed skip to step 2.

  2. Create a Bluemix Account

    Sign up for Bluemix or use an existing account.

  3. Download and install the Cloud Foundry CLI tool

  4. cd into the $GOPATH/src directory

cd $GOPATH/src
  1. Clone the app to your local environment from your terminal using the following command:
git clone https://github.com/IBM-Bluemix/go-hello-world.git
  1. cd into this newly created directory
cd go-hello-world
  1. Compile the Go code:
$ make
  1. Open the manifest.yml file and change the host value to something unique

The host you choose will determinate the subdomain of your application's URL: <host>.mybluemix.net

  1. Connect to Bluemix in the command line tool and follow the prompts to log in:
$ cf api https://api.ng.bluemix.net
$ cf login
  1. Deploy your app to Bluemix:
$ cf push

And voila! You now have your very own instance of the Go Hello World app running on Bluemix.

Run the app locally

  1. Install Go. If you have Go installed skip to step 2.

  2. cd into the $GOPATH/src directory

cd $GOPATH/src
  1. Clone the app to your local environment from your terminal using the following command:
git clone https://github.com/IBM-Bluemix/go-hello-world.git
  1. cd into this newly created directory
cd go-hello-world
  1. Compile the Go code:
$ make

Your app will be automatically be available on port 8080. To access the app, go to localhost:8080 in your browser. Happy developing!

Contribute

We are more than happy to accept external contributions to this project, be it in the form of issues and pull requests. If you find a bug, please report it via the Issues section or even better, fork the project and submit a pull request with your fix! Pull requests will be evaulated on an individual basis based on value add to the sample application.

Troubleshooting

The primary source of debugging information for your Bluemix app is the logs. To see them, run the following command using the Cloud Foundry CLI:

$ cf logs go-hello-world --recent

For more detailed information on troubleshooting your application, see the Troubleshooting section in the Bluemix documentation.

Privacy Notice

The go-hello-world sample web application includes code to track deployments to Bluemix and other Cloud Foundry platforms. The following information is sent to a Deployment Tracker service on each deployment:

  • Application Name (application_name)
  • Space ID (space_id)
  • Application Version (application_version)
  • Application URIs (application_uris)

This data is collected from the VCAP_APPLICATION environment variable in IBM Bluemix and other Cloud Foundry platforms. This data is used by IBM to track metrics around deployments of sample applications to IBM Bluemix. Only deployments of sample applications that include code to ping the Deployment Tracker service will be tracked.

Disabling Deployment Tracking

To disable deployment tracking for this app remove the following 2 lines line 5 and line 13 in go-hello-world.go

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/parnurzeal/gorequest
Package gorequest inspired by Nodejs SuperAgent provides easy-way to write http client
Package gorequest inspired by Nodejs SuperAgent provides easy-way to write http client
_workspace/src/golang.org/x/net/context
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
_workspace/src/golang.org/x/net/context/ctxhttp
Package ctxhttp provides helper functions for performing context-aware HTTP requests.
Package ctxhttp provides helper functions for performing context-aware HTTP requests.
_workspace/src/golang.org/x/net/publicsuffix
Package publicsuffix provides a public suffix list based on data from http://publicsuffix.org/.
Package publicsuffix provides a public suffix list based on data from http://publicsuffix.org/.
_workspace/src/gopkg.in/bluesuncorp/validator.v5
Package validator implements value validations for structs and individual fields based on tags.
Package validator implements value validations for structs and individual fields based on tags.

Jump to

Keyboard shortcuts

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