-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathdoc.go
60 lines (59 loc) · 1.62 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// a golang web mvc framework, mostly like asp.net mvc.
// Base Features:
// + mvc (Lightweight model)
// + route
// + multi template engine and layout
// + simple database api
// + form validation
// + filter for controller or action
// + middleware
//
// Example:
//
// package main
//
// import (
// "github.com/QLeelulu/goku"
// "log"
// "path"
// "runtime"
// )
//
// /**
// * Controller & Action
// */
// var _ = goku.Controller("home").
// Get("index", func(ctx *goku.HttpContext) goku.ActionResulter {
// return ctx.Html("Hello World")
// })
//
// // routes
// var routes []*goku.Route = []*goku.Route{
// &goku.Route{
// Name: "default",
// Pattern: "/{controller}/{action}/",
// Default: map[string]string{"controller": "home", "action": "index"},
// },
// }
//
// // server config
// var config *goku.ServerConfig = &goku.ServerConfig{Addr: ":8080"}
//
// func init() {
// // project root dir, this code can not put to main func
// _, filename, _, _ := runtime.Caller(1)
// config.RootDir = path.Dir(filename)
// }
//
// func main() {
// rt := &goku.RouteTable{Routes: routes}
// s := goku.CreateServer(rt, nil, config)
//
// goku.Logger().Logln("Server start on", s.Addr)
// log.Fatal(s.ListenAndServe())
// }
//
package goku
func GetVersion() string {
return "0.1"
}