1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-11 09:00:39 +00:00

update the documents & comments

This commit is contained in:
astaxie
2014-08-18 16:41:43 +08:00
parent e07d780dcf
commit a144769515
143 changed files with 1911 additions and 908 deletions

View File

@ -1,12 +1,17 @@
// Beego (http://beego.me/)
// Copyright 2014 beego Author. All Rights Reserved.
//
// @description beego is an open-source, high-performance web framework for the Go programming language.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// @link http://github.com/astaxie/beego for the canonical source repository
// http://www.apache.org/licenses/LICENSE-2.0
//
// @license http://github.com/astaxie/beego/blob/master/LICENSE
//
// @authors astaxie
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package validation
import (

View File

@ -1,12 +1,17 @@
// Beego (http://beego.me/)
// Copyright 2014 beego Author. All Rights Reserved.
//
// @description beego is an open-source, high-performance web framework for the Go programming language.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// @link http://github.com/astaxie/beego for the canonical source repository
// http://www.apache.org/licenses/LICENSE-2.0
//
// @license http://github.com/astaxie/beego/blob/master/LICENSE
//
// @authors astaxie
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package validation
import (

View File

@ -1,12 +1,49 @@
// Beego (http://beego.me/)
// Copyright 2014 beego Author. All Rights Reserved.
//
// @description beego is an open-source, high-performance web framework for the Go programming language.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// @link http://github.com/astaxie/beego for the canonical source repository
// http://www.apache.org/licenses/LICENSE-2.0
//
// @license http://github.com/astaxie/beego/blob/master/LICENSE
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// package for validations
//
// @authors astaxie
// import (
// "github.com/astaxie/beego/validation"
// "log"
// )
//
// type User struct {
// Name string
// Age int
// }
//
// func main() {
// u := User{"man", 40}
// valid := validation.Validation{}
// valid.Required(u.Name, "name")
// valid.MaxSize(u.Name, 15, "nameMax")
// valid.Range(u.Age, 0, 140, "age")
// if valid.HasErrors() {
// // validation does not pass
// // print invalid message
// for _, err := range valid.Errors {
// log.Println(err.Key, err.Message)
// }
// }
// // or use like this
// if v := valid.Max(u.Age, 140); !v.Ok {
// log.Println(v.Error.Key, v.Error.Message)
// }
// }
//
// more info: http://beego.me/docs/mvc/controller/validation.md
package validation
import (

View File

@ -1,12 +1,17 @@
// Beego (http://beego.me/)
// Copyright 2014 beego Author. All Rights Reserved.
//
// @description beego is an open-source, high-performance web framework for the Go programming language.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// @link http://github.com/astaxie/beego for the canonical source repository
// http://www.apache.org/licenses/LICENSE-2.0
//
// @license http://github.com/astaxie/beego/blob/master/LICENSE
//
// @authors astaxie
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package validation
import (

View File

@ -1,12 +1,17 @@
// Beego (http://beego.me/)
// Copyright 2014 beego Author. All Rights Reserved.
//
// @description beego is an open-source, high-performance web framework for the Go programming language.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// @link http://github.com/astaxie/beego for the canonical source repository
// http://www.apache.org/licenses/LICENSE-2.0
//
// @license http://github.com/astaxie/beego/blob/master/LICENSE
//
// @authors astaxie
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package validation
import (