Django for Python or Rails for Ruby • Be Go-ish • Don’t make stuff more complicated than it has to be • Convention over configuration • Easy setup and deployment (will be improved with Go v1.0) Donnerstag, 22. März 12
sponsored by STARTeurope • Used in production for http://startuplive.in • Still Go v0.6, upgrade to v1.0 very soon • GoClipse + gb, but will move to Sublime Text 2 and go install with Go v1.0 Donnerstag, 22. März 12
use Go syntax? • DOM tree has a 1:1 Go object representation on the server • Every element has an ID to enable sync of DOM tree and server view representation Donnerstag, 22. März 12
Meta information for validation and display is added via tags • Forms and DB share the same model and validation mechanism • MongoDB is the default database Donnerstag, 22. März 12
a Mongo ID ! Person mongo.Ref `gostart:"to=people"` // Mongo ID ref to a document in "people" collection ! LongerText model.Text `gostart:"rows=5|cols=80|maxlen=400"` ! Integer model.Int `gostart:"min=1|max=100"` ! Email model.Email // Normalization + special treament in forms ! PhoneNumber model.Phone // Normalization + special treament in forms ! Password model.Password // Hashed + special treament in forms ! SubDoc struct { ! ! Day model.Date ! ! RealFloat model.Float `gostart:"valid" ! ! Drinks []mongo.Choice `gostart:"options=Beer,Wine,Water"` ! } } Donnerstag, 22. März 12