fefd8ddb by astaxie

beego: update licence& fix #669

1 parent 14dee37a
Showing 160 changed files with 1076 additions and 775 deletions
1 {
2 "file_line": 500,
3 "func_line": 80,
4 "params_num":4,
5 "results_num":3,
6 "formated": true,
7 "pkg_name": true,
8 "camel_name":true,
9 "ignore":[
10 "a/*",
11 "b/*/c/*.go"
12 ],
13 "fatal":[
14 "formated"
15 ]
16 }
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package cache 10 package cache
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package cache 10 package cache
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package cache 10 package cache
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package cache 10 package cache
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package cache 10 package cache
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package cache 10 package cache
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package cache 10 package cache
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package cache 10 package cache
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package config 10 package config
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package config 10 package config
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package config 10 package config
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package config 10 package config
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package config 10 package config
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package config 10 package config
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package config 10 package config
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package config 10 package config
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package config 10 package config
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package config 10 package config
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package context 10 package context
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package context 10 package context
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package context 10 package context
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package context 10 package context
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 // FilterRouter defines filter operation before controller handler execution. 12 // FilterRouter defines filter operation before controller handler execution.
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 package elements
2
3 type Button struct {
4 Element
5 }
6
7 func NewButton() *Button {
8 b := &Button{}
9 b.options = make(map[string]interface{})
10 b.attributes = make(map[string]interface{})
11 b.labelAttributes = make(map[string]interface{})
12 b.labelOptions = make(map[string]interface{})
13 b.SetAttribute("type", "button")
14 return b
15 }
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
2
3 type LableInterface interface {
4 SetLable(label string)
5 GetLable() (label string)
6 SetLabelAttributes(labelattrs map[string]interface{})
7 GetLabelAttributes() (labelattrs map[string]interface{})
8 SetLabelOptions(labelOptions map[string]interface{})
9 GetLabelOptions() (labelOptions map[string]interface{})
10 ClearLabelOptions()
11 RemoveLabelOptions(keys []string)
12 SetLabelOption(key string, val interface{})
13 GetLabelOption(key string) (val interface{})
14 RemoveLabelOption(key string)
15 HasLabelOption(key string) bool
16 }
17
18 type ElementInterface interface {
19 SetName(name string)
20 GetName() (name string)
21 SetOptions(options map[string]interface{})
22 SetOption(key string, val interface{})
23 GetOptions() (options map[string]interface{})
24 GetOption(key string) (val interface{})
25 SetAttribute(key string, val interface{})
26 GetAttribute(key string) (val interface{})
27 RemoveAttribute(key string)
28 HasAttribute(key string) bool
29 SetAttributes(attributes map[string]interface{})
30 GetAttributes() (attributes map[string]interface{})
31 RemoveAttributes(keys []string)
32 ClearAttributes()
33 SetValue(val interface{})
34 GetValue() (val interface{})
35 SetMessages(msg string)
36 GetMessages() (msg string)
37 SetValidator(v ValidatorInterface)
38 Valid(val interface{}) bool
39 GetMessage() string
40 LableInterface
41 }
42
43 type ValidatorInterface interface {
44 IsValid(val interface{}) bool
45 GetMessages() (msg string)
46 }
47
48 type Element struct {
49 options map[string]interface{}
50 attributes map[string]interface{}
51 labelAttributes map[string]interface{}
52 labelOptions map[string]interface{}
53 value interface{}
54 lable string
55 messages string
56 validator ValidatorInterface
57 }
58
59 func (e *Element) SetName(name string) {
60 e.SetAttribute("name", name)
61 }
62
63 func (e *Element) GetName() (name string) {
64 return e.GetAttribute("name").(string)
65 }
66
67 func (e *Element) SetOptions(options map[string]interface{}) {
68 if val, ok := options["label"]; ok {
69 e.SetLable(val.(string))
70 }
71
72 if val, ok := options["label_attributes"]; ok {
73 e.SetLabelAttributes(val.(map[string]interface{}))
74 }
75
76 if val, ok := options["label_options"]; ok {
77 e.SetLabelOptions(val.(map[string]interface{}))
78 }
79 e.options = options
80 }
81
82 func (e *Element) SetOption(key string, val interface{}) {
83 e.options[key] = val
84 }
85
86 func (e *Element) GetOptions() (options map[string]interface{}) {
87 return e.options
88 }
89
90 func (e *Element) GetOption(key string) (val interface{}) {
91 if val, ok := e.options[key]; ok {
92 return val
93 }
94 return nil
95 }
96
97 func (e *Element) SetAttribute(key string, val interface{}) {
98 e.attributes[key] = val
99 }
100
101 func (e *Element) GetAttribute(key string) (val interface{}) {
102 if val, ok := e.attributes[key]; ok {
103 return val
104 }
105 return nil
106 }
107
108 func (e *Element) RemoveAttribute(key string) {
109 delete(e.attributes, key)
110 }
111
112 func (e *Element) HasAttribute(key string) bool {
113 if _, ok := e.attributes[key]; ok {
114 return true
115 }
116 return false
117 }
118
119 func (e *Element) SetAttributes(attributes map[string]interface{}) {
120 for key, val := range attributes {
121 e.SetAttribute(key, val)
122 }
123 }
124
125 func (e *Element) GetAttributes() (attributes map[string]interface{}) {
126 return e.attributes
127 }
128
129 func (e *Element) RemoveAttributes(keys []string) {
130 for _, key := range keys {
131 e.RemoveAttribute(key)
132 }
133 }
134
135 func (e *Element) ClearAttributes() {
136 e.attributes = make(map[string]interface{})
137 }
138
139 func (e *Element) SetValue(val interface{}) {
140 e.value = val
141 }
142
143 func (e *Element) GetValue() (val interface{}) {
144 return e.value
145 }
146
147 func (e *Element) SetLable(label string) {
148 e.lable = label
149 }
150
151 func (e *Element) GetLable() (label string) {
152 return e.lable
153 }
154
155 func (e *Element) SetLabelAttributes(labelattrs map[string]interface{}) {
156 e.labelAttributes = labelattrs
157 }
158
159 func (e *Element) GetLabelAttributes() (labelattrs map[string]interface{}) {
160 return e.labelAttributes
161 }
162
163 func (e *Element) SetLabelOptions(labelOptions map[string]interface{}) {
164 for key, val := range labelOptions {
165 e.SetLabelOption(key, val)
166 }
167 }
168
169 func (e *Element) GetLabelOptions() (labelOptions map[string]interface{}) {
170 return e.labelOptions
171 }
172
173 func (e *Element) ClearLabelOptions() {
174 e.labelOptions = make(map[string]interface{})
175 }
176
177 func (e *Element) RemoveLabelOptions(keys []string) {
178 for _, key := range keys {
179 e.RemoveLabelOption(key)
180 }
181 }
182
183 func (e *Element) SetLabelOption(key string, val interface{}) {
184 e.labelOptions[key] = val
185 }
186
187 func (e *Element) GetLabelOption(key string) (val interface{}) {
188 if v, ok := e.labelOptions[key]; ok {
189 return v
190 }
191 return nil
192 }
193
194 func (e *Element) RemoveLabelOption(key string) {
195 delete(e.labelOptions, key)
196 }
197
198 func (e *Element) HasLabelOption(key string) bool {
199 if _, ok := e.labelOptions[key]; ok {
200 return true
201 }
202 return false
203 }
204
205 func (e *Element) SetMessages(msg string) {
206 e.messages = msg
207 }
208
209 func (e *Element) GetMessages() (msg string) {
210 return e.messages
211 }
212
213 func (e *Element) SetValidator(v ValidatorInterface) {
214 e.validator = v
215 }
216
217 func (e *Element) Valid(val interface{}) bool {
218 if e.validator == nil {
219 return true
220 }
221 if e.validator.IsValid(val) {
222 return true
223 }
224 return false
225 }
226
227 func (e *Element) GetMessage() string {
228 if e.validator == nil {
229 return ""
230 }
231 return e.validator.GetMessages()
232 }
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
2
3 type Submit struct {
4 Element
5 }
6
7 func NewSubmit() *Submit {
8 b := &Submit{}
9 b.options = make(map[string]interface{})
10 b.attributes = make(map[string]interface{})
11 b.labelAttributes = make(map[string]interface{})
12 b.labelOptions = make(map[string]interface{})
13 b.SetAttribute("type", "submit")
14 return b
15 }
1 package elements
2
3 type Text struct {
4 Element
5 }
6
7 func NewText() *Text {
8 b := &Text{}
9 b.options = make(map[string]interface{})
10 b.attributes = make(map[string]interface{})
11 b.labelAttributes = make(map[string]interface{})
12 b.labelOptions = make(map[string]interface{})
13 b.SetAttribute("type", "text")
14 return b
15 }
1 package elements
2
3 type Textarea struct {
4 Element
5 }
6
7 func NewTextarea() *Textarea {
8 b := &Textarea{}
9 b.options = make(map[string]interface{})
10 b.attributes = make(map[string]interface{})
11 b.labelAttributes = make(map[string]interface{})
12 b.labelOptions = make(map[string]interface{})
13 b.SetAttribute("type", "textarea")
14 return b
15 }
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 package elements
...\ No newline at end of file ...\ No newline at end of file
1 // Beego (http://beego.me/)
2 // @description beego is an open-source, high-performance web framework for the Go programming language.
3 // @link http://github.com/astaxie/beego for the canonical source repository
4 // @license http://github.com/astaxie/beego/blob/master/LICENSE
5 // @authors astaxie
6
7 package forms
8
9 import (
10 "github.com/astaxie/beego/forms/elements"
11 )
12
13 type Form struct {
14 elements map[string]elements.ElementInterface
15 }
16
17 func NewForm() *Form {
18 f := &Form{}
19 f.elements = make(map[string]elements.ElementInterface)
20 return f
21 }
22
23 func (f *Form) Init() *Form {
24 f.elements = make(map[string]elements.ElementInterface)
25 }
26
27 func (f *Form) Valid(data map[string]interface{}) bool {
28 for k, val := range data {
29 if e, ok := f.elements[k]; ok {
30 if !e.Valid(val) {
31 return false
32 }
33 }
34 }
35 return true
36 }
37
38 func (f *Form) SetData() {
39
40 }
41
42 func (f *Form) Bind() {
43
44 }
45
46 func (f *Form) SaveData() {
47
48 }
49
50 func (f *Form) AddElement(e elements.ElementInterface) {
51 name := e.GetName()
52 f.elements[name] = e
53 }
54
55 func (f *Form) Render() string {
56
57 }
1 package forms
2
3 import (
4 "fmt"
5 "testing"
6
7 "./elements"
8 )
9
10 func formTest(t *testing.T) {
11 rf := NewForm()
12 username := elements.NewText()
13 username.SetAttribute("name", "username")
14 username.SetAttribute("id", "username")
15 rf.AddElement(username)
16
17 button := elements.NewSubmit()
18 rf.AddElement(rf)
19
20 fmt.Println(rf.Render())
21 }
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package httplib 10 package httplib
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package httplib 10 package httplib
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package logs 10 package logs
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package logs 10 package logs
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package logs 10 package logs
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package logs 10 package logs
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package logs 10 package logs
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package logs 10 package logs
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package logs 10 package logs
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package logs 10 package logs
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package logs 10 package logs
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package middleware 10 package middleware
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package middleware 10 package middleware
12 11
13 import "fmt" 12 import "fmt"
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package middleware 10 package middleware
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 // oracle dbBaser 12 // oracle dbBaser
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie, slene 9 // @authors astaxie, slene
10
11 package orm 10 package orm
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package auth 10 package auth
12 11
13 // Example: 12 // Example:
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
...@@ -66,6 +65,8 @@ var ( ...@@ -66,6 +65,8 @@ var (
66 "DelSession", "SessionRegenerateID", "DestroySession", "IsAjax", "GetSecureCookie", 65 "DelSession", "SessionRegenerateID", "DestroySession", "IsAjax", "GetSecureCookie",
67 "SetSecureCookie", "XsrfToken", "CheckXsrfCookie", "XsrfFormHtml", 66 "SetSecureCookie", "XsrfToken", "CheckXsrfCookie", "XsrfFormHtml",
68 "GetControllerAndAction"} 67 "GetControllerAndAction"}
68
69 url_placeholder = "{{placeholder}}"
69 ) 70 )
70 71
71 // To append a slice's value into "exceptMethod", for controller's methods shouldn't reflect to AutoRouter 72 // To append a slice's value into "exceptMethod", for controller's methods shouldn't reflect to AutoRouter
...@@ -428,6 +429,7 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin ...@@ -428,6 +429,7 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin
428 } 429 }
429 } 430 }
430 if t.wildcard != nil { 431 if t.wildcard != nil {
432 url = path.Join(url, url_placeholder)
431 ok, u := p.geturl(t.wildcard, url, controllName, methodName, params) 433 ok, u := p.geturl(t.wildcard, url, controllName, methodName, params)
432 if ok { 434 if ok {
433 return ok, u 435 return ok, u
...@@ -456,15 +458,14 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin ...@@ -456,15 +458,14 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin
456 if find { 458 if find {
457 if l.regexps == nil { 459 if l.regexps == nil {
458 if len(l.wildcards) == 0 { 460 if len(l.wildcards) == 0 {
459 return true, url 461 return true, strings.Replace(url, "/"+url_placeholder, "", 1)
460 } 462 }
461 if len(l.wildcards) == 1 { 463 if len(l.wildcards) == 1 {
462 if v, ok := params[l.wildcards[0]]; ok { 464 if v, ok := params[l.wildcards[0]]; ok {
463 delete(params, l.wildcards[0]) 465 delete(params, l.wildcards[0])
464 return true, url + "/" + v + tourl(params) 466 return true, strings.Replace(url, url_placeholder, v, 1) + tourl(params)
465 } 467 } else {
466 if l.wildcards[0] == ":splat" { 468 return false, ""
467 return true, url + tourl(params)
468 } 469 }
469 } 470 }
470 if len(l.wildcards) == 3 && l.wildcards[0] == "." { 471 if len(l.wildcards) == 3 && l.wildcards[0] == "." {
...@@ -472,7 +473,7 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin ...@@ -472,7 +473,7 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin
472 if e, isok := params[":ext"]; isok { 473 if e, isok := params[":ext"]; isok {
473 delete(params, ":path") 474 delete(params, ":path")
474 delete(params, ":ext") 475 delete(params, ":ext")
475 return true, url + "/" + p + "." + e + tourl(params) 476 return true, strings.Replace(url, url_placeholder, p+"."+e, -1) + tourl(params)
476 } 477 }
477 } 478 }
478 } 479 }
...@@ -483,7 +484,8 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin ...@@ -483,7 +484,8 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin
483 continue 484 continue
484 } 485 }
485 if u, ok := params[v]; ok { 486 if u, ok := params[v]; ok {
486 url += "/" + u 487 delete(params, v)
488 url = strings.Replace(url, url_placeholder, u, 1)
487 } else { 489 } else {
488 if canskip { 490 if canskip {
489 canskip = false 491 canskip = false
...@@ -493,7 +495,7 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin ...@@ -493,7 +495,7 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin
493 } 495 }
494 } 496 }
495 } 497 }
496 return true, url 498 return true, url + tourl(params)
497 } else { 499 } else {
498 var i int 500 var i int
499 var startreg bool 501 var startreg bool
...@@ -516,11 +518,11 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin ...@@ -516,11 +518,11 @@ func (p *ControllerRegistor) geturl(t *Tree, url, controllName, methodName strin
516 } 518 }
517 } 519 }
518 if l.regexps.MatchString(regurl) { 520 if l.regexps.MatchString(regurl) {
519 if url == "/" { 521 ps := strings.Split(regurl, "/")
520 return true, url + regurl + tourl(params) 522 for _, p := range ps {
521 } else { 523 url = strings.Replace(url, url_placeholder, p, 1)
522 return true, url + "/" + regurl + tourl(params)
523 } 524 }
525 return true, url + tourl(params)
524 } 526 }
525 } 527 }
526 } 528 }
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
...@@ -95,10 +94,10 @@ func TestUrlFor(t *testing.T) { ...@@ -95,10 +94,10 @@ func TestUrlFor(t *testing.T) {
95 func TestUrlFor3(t *testing.T) { 94 func TestUrlFor3(t *testing.T) {
96 handler := NewControllerRegister() 95 handler := NewControllerRegister()
97 handler.AddAuto(&TestController{}) 96 handler.AddAuto(&TestController{})
98 if a := handler.UrlFor("TestController.Myext"); a != "/test/myext" { 97 if a := handler.UrlFor("TestController.Myext"); a != "/test/myext" && a != "/Test/Myext" {
99 t.Errorf("TestController.Myext must equal to /test/myext, but get " + a) 98 t.Errorf("TestController.Myext must equal to /test/myext, but get " + a)
100 } 99 }
101 if a := handler.UrlFor("TestController.GetUrl"); a != "/test/geturl" { 100 if a := handler.UrlFor("TestController.GetUrl"); a != "/test/geturl" && a != "/Test/GetUrl" {
102 t.Errorf("TestController.GetUrl must equal to /test/geturl, but get " + a) 101 t.Errorf("TestController.GetUrl must equal to /test/geturl, but get " + a)
103 } 102 }
104 } 103 }
...@@ -106,8 +105,14 @@ func TestUrlFor3(t *testing.T) { ...@@ -106,8 +105,14 @@ func TestUrlFor3(t *testing.T) {
106 func TestUrlFor2(t *testing.T) { 105 func TestUrlFor2(t *testing.T) {
107 handler := NewControllerRegister() 106 handler := NewControllerRegister()
108 handler.Add("/v1/:v/cms_:id(.+)_:page(.+).html", &TestController{}, "*:List") 107 handler.Add("/v1/:v/cms_:id(.+)_:page(.+).html", &TestController{}, "*:List")
108 handler.Add("/v1/:username/edit", &TestController{}, "get:GetUrl")
109 handler.Add("/v1/:v(.+)_cms/ttt_:id(.+)_:page(.+).html", &TestController{}, "*:Param") 109 handler.Add("/v1/:v(.+)_cms/ttt_:id(.+)_:page(.+).html", &TestController{}, "*:Param")
110 handler.Add("/:year:int/:month:int/:title/:entid", &TestController{}) 110 handler.Add("/:year:int/:month:int/:title/:entid", &TestController{})
111 if handler.UrlFor("TestController.GetUrl", ":username", "astaxie") != "/v1/astaxie/edit" {
112 Info(handler.UrlFor("TestController.GetUrl"))
113 t.Errorf("TestController.List must equal to /v1/astaxie/edit")
114 }
115
111 if handler.UrlFor("TestController.List", ":v", "za", ":id", "12", ":page", "123") != 116 if handler.UrlFor("TestController.List", ":v", "za", ":id", "12", ":page", "123") !=
112 "/v1/za/cms_12_123.html" { 117 "/v1/za/cms_12_123.html" {
113 Info(handler.UrlFor("TestController.List")) 118 Info(handler.UrlFor("TestController.List"))
...@@ -162,6 +167,18 @@ func TestAutoFunc(t *testing.T) { ...@@ -162,6 +167,18 @@ func TestAutoFunc(t *testing.T) {
162 } 167 }
163 } 168 }
164 169
170 func TestAutoFunc2(t *testing.T) {
171 r, _ := http.NewRequest("GET", "/Test/List", nil)
172 w := httptest.NewRecorder()
173
174 handler := NewControllerRegister()
175 handler.AddAuto(&TestController{})
176 handler.ServeHTTP(w, r)
177 if w.Body.String() != "i am list" {
178 t.Errorf("user define func can't run")
179 }
180 }
181
165 func TestAutoFuncParams(t *testing.T) { 182 func TestAutoFuncParams(t *testing.T) {
166 r, _ := http.NewRequest("GET", "/test/params/2009/11/12", nil) 183 r, _ := http.NewRequest("GET", "/test/params/2009/11/12", nil)
167 w := httptest.NewRecorder() 184 w := httptest.NewRecorder()
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 // mysql session support need create table as sql: 12 // mysql session support need create table as sql:
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 /* 12 /*
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package session 10 package session
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10 package beego 10 package beego
11 11
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package swagger 10 package swagger
12 11
13 const SwaggerVersion = "1.2" 12 const SwaggerVersion = "1.2"
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 //@todo add template funcs 12 //@todo add template funcs
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
...@@ -361,10 +360,10 @@ func RenderForm(obj interface{}) template.HTML { ...@@ -361,10 +360,10 @@ func RenderForm(obj interface{}) template.HTML {
361 360
362 fieldT := objT.Field(i) 361 fieldT := objT.Field(i)
363 362
364 label, name, fType, ignored := parseFormTag(fieldT) 363 label, name, fType, ignored := parseFormTag(fieldT)
365 if ignored { 364 if ignored {
366 continue 365 continue
367 } 366 }
368 367
369 raw = append(raw, renderFormField(label, name, fType, fieldV.Interface())) 368 raw = append(raw, renderFormField(label, name, fType, fieldV.Interface()))
370 } 369 }
...@@ -373,60 +372,60 @@ func RenderForm(obj interface{}) template.HTML { ...@@ -373,60 +372,60 @@ func RenderForm(obj interface{}) template.HTML {
373 372
374 // renderFormField returns a string containing HTML of a single form field. 373 // renderFormField returns a string containing HTML of a single form field.
375 func renderFormField(label, name, fType string, value interface{}) string { 374 func renderFormField(label, name, fType string, value interface{}) string {
376 if isValidForInput(fType) { 375 if isValidForInput(fType) {
377 return fmt.Sprintf(`%v<input name="%v" type="%v" value="%v">`, label, name, fType, value) 376 return fmt.Sprintf(`%v<input name="%v" type="%v" value="%v">`, label, name, fType, value)
378 } 377 }
379 378
380 return fmt.Sprintf(`%v<%v name="%v">%v</%v>`, label, fType, name, value, fType) 379 return fmt.Sprintf(`%v<%v name="%v">%v</%v>`, label, fType, name, value, fType)
381 } 380 }
382 381
383 // isValidForInput checks if fType is a valid value for the `type` property of an HTML input element. 382 // isValidForInput checks if fType is a valid value for the `type` property of an HTML input element.
384 func isValidForInput(fType string) bool { 383 func isValidForInput(fType string) bool {
385 validInputTypes := strings.Fields("text password checkbox radio submit reset hidden image file button search email url tel number range date month week time datetime datetime-local color") 384 validInputTypes := strings.Fields("text password checkbox radio submit reset hidden image file button search email url tel number range date month week time datetime datetime-local color")
386 for _, validType := range validInputTypes { 385 for _, validType := range validInputTypes {
387 if fType == validType { 386 if fType == validType {
388 return true 387 return true
389 } 388 }
390 } 389 }
391 return false 390 return false
392 } 391 }
393 392
394 // parseFormTag takes the stuct-tag of a StructField and parses the `form` value. 393 // parseFormTag takes the stuct-tag of a StructField and parses the `form` value.
395 // returned are the form label, name-property, type and wether the field should be ignored. 394 // returned are the form label, name-property, type and wether the field should be ignored.
396 func parseFormTag(fieldT reflect.StructField) (label, name, fType string, ignored bool) { 395 func parseFormTag(fieldT reflect.StructField) (label, name, fType string, ignored bool) {
397 tags := strings.Split(fieldT.Tag.Get("form"), ",") 396 tags := strings.Split(fieldT.Tag.Get("form"), ",")
398 label = fieldT.Name + ": " 397 label = fieldT.Name + ": "
399 name = fieldT.Name 398 name = fieldT.Name
400 fType = "text" 399 fType = "text"
401 ignored = false; 400 ignored = false
402 401
403 switch len(tags) { 402 switch len(tags) {
404 case 1: 403 case 1:
405 if tags[0] == "-" { 404 if tags[0] == "-" {
406 ignored = true 405 ignored = true
407 } 406 }
408 if len(tags[0]) > 0 { 407 if len(tags[0]) > 0 {
409 name = tags[0] 408 name = tags[0]
410 } 409 }
411 case 2: 410 case 2:
412 if len(tags[0]) > 0 { 411 if len(tags[0]) > 0 {
413 name = tags[0] 412 name = tags[0]
414 } 413 }
415 if len(tags[1]) > 0 { 414 if len(tags[1]) > 0 {
416 fType = tags[1] 415 fType = tags[1]
417 } 416 }
418 case 3: 417 case 3:
419 if len(tags[0]) > 0 { 418 if len(tags[0]) > 0 {
420 name = tags[0] 419 name = tags[0]
421 } 420 }
422 if len(tags[1]) > 0 { 421 if len(tags[1]) > 0 {
423 fType = tags[1] 422 fType = tags[1]
424 } 423 }
425 if len(tags[2]) > 0 { 424 if len(tags[2]) > 0 {
426 label = tags[2] 425 label = tags[2]
427 } 426 }
428 } 427 }
429 return 428 return
430 } 429 }
431 430
432 func isStructPtr(t reflect.Type) bool { 431 func isStructPtr(t reflect.Type) bool {
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
14 "html/template" 13 "html/template"
15 "net/url" 14 "net/url"
15 "reflect"
16 "testing" 16 "testing"
17 "time" 17 "time"
18 "reflect"
19 ) 18 )
20 19
21 func TestSubstr(t *testing.T) { 20 func TestSubstr(t *testing.T) {
...@@ -141,17 +140,17 @@ func TestParseForm(t *testing.T) { ...@@ -141,17 +140,17 @@ func TestParseForm(t *testing.T) {
141 140
142 func TestRenderForm(t *testing.T) { 141 func TestRenderForm(t *testing.T) {
143 type user struct { 142 type user struct {
144 Id int `form:"-"` 143 Id int `form:"-"`
145 tag string `form:"tag"` 144 tag string `form:"tag"`
146 Name interface{} `form:"username"` 145 Name interface{} `form:"username"`
147 Age int `form:"age,text,年龄:"` 146 Age int `form:"age,text,年龄:"`
148 Sex string 147 Sex string
149 Email []string 148 Email []string
150 Intro string `form:",textarea"` 149 Intro string `form:",textarea"`
151 Ignored string `form:"-"` 150 Ignored string `form:"-"`
152 } 151 }
153 152
154 u := user{Name: "test", Intro: "Some Text"} 153 u := user{Name: "test", Intro: "Some Text"}
155 output := RenderForm(u) 154 output := RenderForm(u)
156 if output != template.HTML("") { 155 if output != template.HTML("") {
157 t.Errorf("output should be empty but got %v", output) 156 t.Errorf("output should be empty but got %v", output)
...@@ -168,51 +167,51 @@ func TestRenderForm(t *testing.T) { ...@@ -168,51 +167,51 @@ func TestRenderForm(t *testing.T) {
168 } 167 }
169 168
170 func TestRenderFormField(t *testing.T) { 169 func TestRenderFormField(t *testing.T) {
171 html := renderFormField("Label: ", "Name", "text", "Value") 170 html := renderFormField("Label: ", "Name", "text", "Value")
172 if html != `Label: <input name="Name" type="text" value="Value">` { 171 if html != `Label: <input name="Name" type="text" value="Value">` {
173 t.Errorf("Wrong html output for input[type=text]: %v ", html) 172 t.Errorf("Wrong html output for input[type=text]: %v ", html)
174 } 173 }
175 174
176 html = renderFormField("Label: ", "Name", "textarea", "Value") 175 html = renderFormField("Label: ", "Name", "textarea", "Value")
177 if html != `Label: <textarea name="Name">Value</textarea>` { 176 if html != `Label: <textarea name="Name">Value</textarea>` {
178 t.Errorf("Wrong html output for textarea: %v ", html) 177 t.Errorf("Wrong html output for textarea: %v ", html)
179 } 178 }
180 } 179 }
181 180
182 func TestParseFormTag(t *testing.T) { 181 func TestParseFormTag(t *testing.T) {
183 // create struct to contain field with different types of struct-tag `form` 182 // create struct to contain field with different types of struct-tag `form`
184 type user struct { 183 type user struct {
185 All int `form:"name,text,年龄:"` 184 All int `form:"name,text,年龄:"`
186 NoName int `form:",hidden,年龄:"` 185 NoName int `form:",hidden,年龄:"`
187 OnlyLabel int `form:",,年龄:"` 186 OnlyLabel int `form:",,年龄:"`
188 OnlyName int `form:"name"` 187 OnlyName int `form:"name"`
189 Ignored int `form:"-"` 188 Ignored int `form:"-"`
190 } 189 }
191 190
192 objT := reflect.TypeOf(&user{}).Elem() 191 objT := reflect.TypeOf(&user{}).Elem()
193 192
194 label, name, fType, ignored := parseFormTag(objT.Field(0)) 193 label, name, fType, ignored := parseFormTag(objT.Field(0))
195 if !(name == "name" && label == "年龄:" && fType == "text" && ignored == false) { 194 if !(name == "name" && label == "年龄:" && fType == "text" && ignored == false) {
196 t.Errorf("Form Tag with name, label and type was not correctly parsed.") 195 t.Errorf("Form Tag with name, label and type was not correctly parsed.")
197 } 196 }
198 197
199 label, name, fType, ignored = parseFormTag(objT.Field(1)) 198 label, name, fType, ignored = parseFormTag(objT.Field(1))
200 if !(name == "NoName" && label == "年龄:" && fType == "hidden" && ignored == false) { 199 if !(name == "NoName" && label == "年龄:" && fType == "hidden" && ignored == false) {
201 t.Errorf("Form Tag with label and type but without name was not correctly parsed.") 200 t.Errorf("Form Tag with label and type but without name was not correctly parsed.")
202 } 201 }
203 202
204 label, name, fType, ignored = parseFormTag(objT.Field(2)) 203 label, name, fType, ignored = parseFormTag(objT.Field(2))
205 if !(name == "OnlyLabel" && label == "年龄:" && fType == "text" && ignored == false) { 204 if !(name == "OnlyLabel" && label == "年龄:" && fType == "text" && ignored == false) {
206 t.Errorf("Form Tag containing only label was not correctly parsed.") 205 t.Errorf("Form Tag containing only label was not correctly parsed.")
207 } 206 }
208 207
209 label, name, fType, ignored = parseFormTag(objT.Field(3)) 208 label, name, fType, ignored = parseFormTag(objT.Field(3))
210 if !(name == "name" && label == "OnlyName: " && fType == "text" && ignored == false) { 209 if !(name == "name" && label == "OnlyName: " && fType == "text" && ignored == false) {
211 t.Errorf("Form Tag containing only name was not correctly parsed.") 210 t.Errorf("Form Tag containing only name was not correctly parsed.")
212 } 211 }
213 212
214 label, name, fType, ignored = parseFormTag(objT.Field(4)) 213 label, name, fType, ignored = parseFormTag(objT.Field(4))
215 if (ignored == false) { 214 if ignored == false {
216 t.Errorf("Form Tag that should be ignored was not correctly parsed.") 215 t.Errorf("Form Tag that should be ignored was not correctly parsed.")
217 } 216 }
218 } 217 }
......
1 // Beego (http://beego.me/)
2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository
6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 //
9 // @authors astaxie
10 package testing
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package testing 10 package testing
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package toolbox 10 package toolbox
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package toolbox 10 package toolbox
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package toolbox 10 package toolbox
12 11
13 //type DatabaseCheck struct { 12 //type DatabaseCheck struct {
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package toolbox 10 package toolbox
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package toolbox 10 package toolbox
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package toolbox 10 package toolbox
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package toolbox 10 package toolbox
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package toolbox 10 package toolbox
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package toolbox 10 package toolbox
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package beego 10 package beego
12 11
13 import "testing" 12 import "testing"
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package utils 10 package utils
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package utils 10 package utils
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10 10 //
11 // an example for use captcha 11 // an example for use captcha
12 // 12 //
13 // ``` 13 // ```
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package captcha 10 package captcha
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package captcha 10 package captcha
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package captcha 10 package captcha
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package captcha 10 package captcha
12 11
13 import "testing" 12 import "testing"
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package utils 10 package utils
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package utils 10 package utils
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package utils 10 package utils
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package utils 10 package utils
12 11
13 import "testing" 12 import "testing"
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10 package utils 10 package utils
11 11
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package utils 10 package utils
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package utils 10 package utils
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package utils 10 package utils
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package utils 10 package utils
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package validation 10 package validation
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package validation 10 package validation
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package validation 10 package validation
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package validation 10 package validation
12 11
13 import ( 12 import (
......
1 // Beego (http://beego.me/) 1 // Beego (http://beego.me/)
2 2 //
3 // @description beego is an open-source, high-performance web framework for the Go programming language. 3 // @description beego is an open-source, high-performance web framework for the Go programming language.
4 4 //
5 // @link http://github.com/astaxie/beego for the canonical source repository 5 // @link http://github.com/astaxie/beego for the canonical source repository
6 6 //
7 // @license http://github.com/astaxie/beego/blob/master/LICENSE 7 // @license http://github.com/astaxie/beego/blob/master/LICENSE
8 8 //
9 // @authors astaxie 9 // @authors astaxie
10
11 package validation 10 package validation
12 11
13 import ( 12 import (
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!