diff options
author | Franck Cuny <franck@lumberjaph.net> | 2013-04-26 22:06:54 -0700 |
---|---|---|
committer | Franck Cuny <franck@lumberjaph.net> | 2013-04-26 22:06:54 -0700 |
commit | c3c8c5191618f41ca8cefbbfc09d4dc538886875 (patch) | |
tree | 2f9717d5dcabb2e6b29fac2b5ba9630a859a6011 /README.md | |
parent | Add Validations for URL parameters. (diff) | |
download | path-router-c3c8c5191618f41ca8cefbbfc09d4dc538886875.tar.gz |
Let's start to write some documentation.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/README.md b/README.md index 39f8057..adc173a 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,41 @@ ![mooh](http://farm9.staticflickr.com/8347/8162712205_a7e5a16a3e_z.jpg) -This is a really really *really* strongly opinionated web framework in Go. +## What is mooh -It's a playground for me to test ideas and concept for what I want in a web framework. Since I'm probably the only person in the world to want it to behave that way, you should probably stay away. +moo is a playground for me to test ideas and concept for what I want in a web framework. -It's definitely not designed with speed in mind, and yes, I'm stilling ideas and concepts from a lot of different places (especially from the amazing iinteractive's gang). +## What moo is not -That being said, he you want to share your opinion with me, you're more than welcome. +It's definitely not designed with speed in mind. Stability in the API and design is not done, so things are changing frequently. + +## Documentation + +### Route + +To create a new route, you'll need to create a new Route with the following attributes: + +* Method +* Path +* Code +* Validations + +or: + + &Route{ + Method: "GET", + Path: "/blog/:year/:month/:day", + Code: GetArticle, + Validations: map[string]*regexp.Regexp{ + "year": regexp.MustCompile("[\\d]{4}"), + "month": regexp.MustCompile("[\\d]{2}"), + "day": regexp.MustCompile("[\\d]{2}"), + }, + } + +The attribute Validations is optional, but all the keys defined in the map need to be parameters in the URL. + +## External links + +* [Build status](https://drone.io/github.com/franckcuny/mooh/latest) +* [Internal Documentation](http://godoc.org/github.com/franckcuny/mooh) |