proxy.golang.org : github.com/ungerik/go-start
go-start is a high level web-framework for Go, like Django for Python or Rails for Ruby. Note: Don't use Go on 32 bit systems in production, it has severe memory leaks. (If the documentation URL above doesn't work, then godoc -html has has crashed because of that issue) ## Intro: Features: Planned Features: ## Views: The philosophy for creating HTML views is (unlike Rails/Django) that you should not have to learn yet another language to be able to write templates. There are several very simple template languages out there that reduce program code like logic within the template, but it’s still yet another syntax to learn. In go-start the HTML structure of a page is represented by a structure of type safe Go objects. It should feel like writing HTML but using the syntax of Go. And no, it has nothing to do with the mess of intertwined markup and code in PHP. Example of a static view: Example of a dynamic view: Beside DynamicView there is also a ModelIteratorView. It takes a model.Iterator and creates a dynamic view for every iterated data item: ## Pages and URLs: ## Models: Data is abstacted as models. The same model abstraction and data validation is used for HTML forms and for databases. So a model can be loaded from a database, displayed as an HTML form and saved back to the database after submit. This is not always a good practice, but it shows how easy things can be. A model is a simple Go struct that uses gostart/model types as struct members. Custom model wide validation is done by adding a Validate() method to the struct type: Here is how a HTML form is created that displays input fields for the SignupFormModel: MongoDB is the default database of go-start utilizing Gustavo Niemeyer's great lib mgo (http://labix.org/mgo). Mongo collections and queries are encapsulated to make them compatible with the go-start data model concept, and a little bit easier to use. Example of a collection and document struct: Example query: A new mongo.Document is always created by the corresponding collection object to initialize it with meta information about its collection. This way it is possible to implement Save() or Remove() methods for the document. Example for creating, modifying and saving a document:
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/ungerik/go-start
License: MIT
Latest release: about 10 years ago
First release: about 10 years ago
Namespace: github.com/ungerik
Stars: 268 on GitHub
Forks: 35 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: about 2 months ago