A Go Microservice to return a state for latitude and longitude.
Input must have 2 arguments:
- Latitude
- Longitude
Input:
go run main.go 40.774576 -73.952545
Output (Success):
{"error":"","state":"Florida"}
Output (Failure):
{
"error":"<error message>",
"state":""
}
Requirements:
- Golang environment set up
- Git
- Boot2docker running
go get github.com/cloudspace/Go_Location_Country
cd <Go_Location_Country Directory>
docker run --rm -v $(pwd):/src centurylink/golang-builder
docker build -t <username>/go_location_state:0.1 ./
In order for the golang-builder to work, you need to have the github url on the top line of main.go. It should look like this:
package main // import "github.com/cloudspace/Go_Location_State"
You also must push your code to github before building the docker image.