Data, Maps, Usability, and Performance

API canvas d3 data geo GeoJSON html5 image JavaScript json maps mysql PHP WordPress

Results for tag: golang

Playing Cards API with Go Lang and JSON

Deck of Cards API with GO Lang

This is a continuation from the previous post on setting up Google App Engine with Go and Martini.

Last week, I showed how you can quickly create and launch a project with Google App Engine and Go. I integrated Martini on GAE and today, I will finish the tutorial by actually designing an API to properly respond to requests with JSON. I will also enable CORS and create some functions in GO that will shuffle an array of objects, split the array according to a user provided number, and reorder the array of objects for multiple keys. If we translate that to playing cards, the API will handle shuffling a deck, dealing out the cards to the amount of players provided, and ordering them by suit and numbers. Any remainder of cards based on provided players will go into the kitty. JSON is a popular content type so I will use that and follow the RESTful style of API design.
Read more

Go Examples and GoLang Resources

Go Language Demos and Examples

I have been working on a pretty large project with Go in the last few weeks and wanted to dedicate a blog post to various GoLang examples, demos, and resources. A tour of Go was certainly helpful in getting started and the Go Playground is very useful for quick code examples, but there are more blogs, forums, and resources that can really help when developing with the Go Language. Here is what I found helpful:
Read more

Martini App with Ajax, JSON, and User Sessions

Go language application

Previously, I have created a really simple web app with Go Lang and Martini that communicated with MySQL to retrieve a list of posts, an individual post, and allowed creation of a post. Now, we are going to handle updates and deletion, transform responses to use JSON for client side Ajax requests, and implement the user relation: user login, logout, managing sessions and authentication, as well as, retrieving posts by user. Supporting PUT (update) and delete requests with Ajax and JSON was pretty trivial (thanks to Martini) but evolving the app to handle users properly with good validation was much more work then I originally expected. Still, Go does make the code easy to understand and Martini contributed utilities have been a great help. Lets start.

GoLang and Martini Web Application
Read more