From a144769515b8ddfb69046b3ef9e29c38bab94f3b Mon Sep 17 00:00:00 2001 From: astaxie Date: Mon, 18 Aug 2014 16:41:43 +0800 Subject: [PATCH] update the documents & comments --- README.md | 20 +++----- admin.go | 17 +++--- adminui.go | 17 +++--- app.go | 17 +++--- beego.go | 26 ++++++++-- cache/cache.go | 31 +++++++++-- cache/cache_test.go | 17 +++--- cache/conv.go | 17 +++--- cache/conv_test.go | 17 +++--- cache/file.go | 17 +++--- cache/memcache/memcache.go | 30 +++++++++-- cache/memory.go | 17 +++--- cache/redis/redis.go | 30 +++++++++-- cache/redis/redis_test.go | 22 ++++---- config.go | 17 +++--- config/config.go | 42 +++++++++++++-- config/fake.go | 17 +++--- config/ini.go | 17 +++--- config/ini_test.go | 17 +++--- config/json.go | 17 +++--- config/json_test.go | 17 +++--- config/xml/xml.go | 30 +++++++++-- config/xml/xml_test.go | 17 +++--- config/yaml/yaml.go | 30 +++++++++-- config/yaml/yaml_test.go | 17 +++--- config_test.go | 17 +++--- context/context.go | 22 ++++++-- context/input.go | 17 +++--- context/input_test.go | 17 +++--- context/output.go | 17 +++--- controller.go | 17 +++--- docs.go | 17 +++--- filter.go | 17 +++--- filter_test.go | 17 +++--- flash.go | 17 +++--- flash_test.go | 17 +++--- httplib/httplib.go | 31 +++++++++-- httplib/httplib_test.go | 17 +++--- log.go | 17 +++--- logs/conn.go | 17 +++--- logs/conn_test.go | 17 +++--- logs/console.go | 17 +++--- logs/console_test.go | 17 +++--- logs/file.go | 17 +++--- logs/file_test.go | 17 +++--- logs/log.go | 33 ++++++++++-- logs/smtp.go | 19 ++++--- logs/smtp_test.go | 17 +++--- memzipfile.go | 17 +++--- middleware/error.go | 17 +++--- middleware/exceptions.go | 17 +++--- middleware/i18n.go | 22 ++++++-- migration/migration.go | 18 +++++-- mime.go | 17 +++--- namespace.go | 17 +++--- namespace_test.go | 17 +++--- orm/README.md | 7 +-- orm/cmd.go | 17 +++--- orm/cmd_utils.go | 17 +++--- orm/db.go | 17 +++--- orm/db_alias.go | 17 +++--- orm/db_mysql.go | 17 +++--- orm/db_oracle.go | 17 +++--- orm/db_postgres.go | 17 +++--- orm/db_sqlite.go | 17 +++--- orm/db_tables.go | 17 +++--- orm/db_utils.go | 17 +++--- orm/models.go | 17 +++--- orm/models_boot.go | 17 +++--- orm/models_fields.go | 17 +++--- orm/models_info_f.go | 17 +++--- orm/models_info_m.go | 17 +++--- orm/models_test.go | 17 +++--- orm/models_utils.go | 17 +++--- orm/orm.go | 51 ++++++++++++++++-- orm/orm_conds.go | 17 +++--- orm/orm_log.go | 17 +++--- orm/orm_object.go | 17 +++--- orm/orm_querym2m.go | 17 +++--- orm/orm_queryset.go | 17 +++--- orm/orm_raw.go | 17 +++--- orm/orm_test.go | 17 +++--- orm/types.go | 17 +++--- orm/utils.go | 17 +++--- parser.go | 17 +++--- plugins/auth/basic.go | 10 ++-- plugins/cors/cors.go | 37 +++++++------ plugins/cors/cors_test.go | 1 - router.go | 17 +++--- router_test.go | 17 +++--- session/couchbase/sess_couchbase.go | 33 ++++++++++-- session/memcache/sess_memcache.go | 49 +++++++++++++----- session/mysql/sess_mysql.go | 37 ++++++++++--- session/postgres/sess_postgresql.go | 80 +++++++++++++++++------------ session/redis/sess_redis.go | 35 ++++++++++--- session/sess_cookie.go | 17 +++--- session/sess_cookie_test.go | 17 +++--- session/sess_file.go | 17 +++--- session/sess_mem.go | 17 +++--- session/sess_mem_test.go | 17 +++--- session/sess_test.go | 17 +++--- session/sess_utils.go | 17 +++--- session/session.go | 28 ++++++++-- staticfile.go | 17 +++--- swagger/docsSpec.go | 18 ++++--- template.go | 19 ++++--- template_test.go | 17 +++--- templatefunc.go | 17 +++--- templatefunc_test.go | 17 +++--- testing/assertions.go | 17 +++--- testing/client.go | 17 +++--- toolbox/healthcheck.go | 38 ++++++++------ toolbox/profile.go | 17 +++--- toolbox/profile_test.go | 17 +++--- toolbox/statistics.go | 17 +++--- toolbox/statistics_test.go | 17 +++--- toolbox/task.go | 17 +++--- toolbox/task_test.go | 17 +++--- tree.go | 17 +++--- tree_test.go | 17 +++--- utils/caller.go | 17 +++--- utils/caller_test.go | 17 +++--- utils/captcha/captcha.go | 19 ++++--- utils/captcha/image.go | 17 +++--- utils/captcha/image_test.go | 17 +++--- utils/captcha/siprng.go | 17 +++--- utils/captcha/siprng_test.go | 17 +++--- utils/debug.go | 17 +++--- utils/debug_test.go | 17 +++--- utils/file.go | 17 +++--- utils/file_test.go | 17 +++--- utils/mail.go | 17 +++--- utils/mail_test.go | 17 +++--- utils/rand.go | 17 +++--- utils/safemap.go | 17 +++--- utils/safemap_test.go | 17 +++--- utils/slice.go | 17 +++--- utils/slice_test.go | 17 +++--- validation/util.go | 17 +++--- validation/util_test.go | 17 +++--- validation/validation.go | 47 +++++++++++++++-- validation/validation_test.go | 17 +++--- validation/validators.go | 17 +++--- 143 files changed, 1911 insertions(+), 908 deletions(-) diff --git a/README.md b/README.md index a5b30a88..3357beef 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,7 @@ [![Build Status](https://drone.io/github.com/astaxie/beego/status.png)](https://drone.io/github.com/astaxie/beego/latest) -beego is a Go Framework inspired by tornado and sinatra. - -It is a simple & powerful web framework. +beego is an open-source, high-performance, modularity, full-stack web framework. More info [beego.me](http://beego.me) @@ -12,20 +10,18 @@ More info [beego.me](http://beego.me) * RESTful support * MVC architecture -* Session support (store in memory, file, Redis or MySQL) -* Cache support (store in memory, Redis or Memcache) -* Global Config -* Intelligent routing -* Thread-safe map -* Friendly displaying of errors -* Useful template functions - +* modularity +* auto API documents +* annotation router +* namespace +* powerful develop tools +* full stack for web & API ## Documentation [English](http://beego.me/docs/intro/) -[API](http://gowalker.org/github.com/astaxie/beego) +[API](http://godoc.org/github.com/astaxie/beego) [中文文档](http://beego.me/docs/intro/) diff --git a/admin.go b/admin.go index 9b2f3dc3..e464a0e3 100644 --- a/admin.go +++ b/admin.go @@ -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 beego import ( diff --git a/adminui.go b/adminui.go index 241fd5ea..0c82775e 100644 --- a/adminui.go +++ b/adminui.go @@ -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 beego var indexTpl = ` diff --git a/app.go b/app.go index 64bafde8..f1706616 100644 --- a/app.go +++ b/app.go @@ -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 beego import ( diff --git a/beego.go b/beego.go index f7cfa56a..a16f9ceb 100644 --- a/beego.go +++ b/beego.go @@ -1,12 +1,28 @@ -// 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. + +// beego is an open-source, high-performance, modularity, full-stack web framework // -// @authors astaxie +// package main +// +// import "github.com/astaxie/beego" +// +// func main() { +// beego.Run() +// } +// +// more infomation: http://beego.me package beego import ( diff --git a/cache/cache.go b/cache/cache.go index 26e40fa3..d4ad5d59 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -1,12 +1,33 @@ -// 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. + +// Usage: // -// @authors astaxie +// import( +// "github.com/astaxie/beego/cache" +// ) +// +// bm, err := cache.NewCache("memory", `{"interval":60}`) +// +// Use it like this: +// +// bm.Put("astaxie", 1, 10) +// bm.Get("astaxie") +// bm.IsExist("astaxie") +// bm.Delete("astaxie") +// +// more docs http://beego.me/docs/module/cache.md package cache import ( diff --git a/cache/cache_test.go b/cache/cache_test.go index 9426e159..bf9e79c2 100644 --- a/cache/cache_test.go +++ b/cache/cache_test.go @@ -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 cache import ( diff --git a/cache/conv.go b/cache/conv.go index 57167706..724abfd2 100644 --- a/cache/conv.go +++ b/cache/conv.go @@ -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 cache import ( diff --git a/cache/conv_test.go b/cache/conv_test.go index d98db9e3..267bb0c9 100644 --- a/cache/conv_test.go +++ b/cache/conv_test.go @@ -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 cache import ( diff --git a/cache/file.go b/cache/file.go index b4af2211..6ecf6568 100644 --- a/cache/file.go +++ b/cache/file.go @@ -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 cache import ( diff --git a/cache/memcache/memcache.go b/cache/memcache/memcache.go index 7e8b6a73..f5a5c6ef 100644 --- a/cache/memcache/memcache.go +++ b/cache/memcache/memcache.go @@ -1,12 +1,32 @@ -// 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 memcahe for cache provider // -// @authors astaxie +// depend on github.com/bradfitz/gomemcache/memcache +// +// go install github.com/bradfitz/gomemcache/memcache +// +// Usage: +// import( +// _ "github.com/astaxie/beego/cache/memcache" +// "github.com/astaxie/beego/cache" +// ) +// +// bm, err := cache.NewCache("memcache", `{"conn":"127.0.0.1:11211"}`) +// +// more docs http://beego.me/docs/module/cache.md package memcache import ( diff --git a/cache/memory.go b/cache/memory.go index cc4835c1..b90d227c 100644 --- a/cache/memory.go +++ b/cache/memory.go @@ -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 cache import ( diff --git a/cache/redis/redis.go b/cache/redis/redis.go index bd9d44c9..35cf88cd 100644 --- a/cache/redis/redis.go +++ b/cache/redis/redis.go @@ -1,12 +1,32 @@ -// 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 redis for cache provider // -// @authors astaxie +// depend on github.com/garyburd/redigo/redis +// +// go install github.com/garyburd/redigo/redis +// +// Usage: +// import( +// _ "github.com/astaxie/beego/cache/redis" +// "github.com/astaxie/beego/cache" +// ) +// +// bm, err := cache.NewCache("redis", `{"conn":"127.0.0.1:11211"}`) +// +// more docs http://beego.me/docs/module/cache.md package redis import ( diff --git a/cache/redis/redis_test.go b/cache/redis/redis_test.go index 5128d249..fbe82ac5 100644 --- a/cache/redis/redis_test.go +++ b/cache/redis/redis_test.go @@ -1,12 +1,16 @@ -// Beego (http://beego.me/) - -// @description beego is an open-source, high-performance web framework for the Go programming language. - -// @link http://github.com/astaxie/beego for the canonical source repository - -// @license http://github.com/astaxie/beego/blob/master/LICENSE - -// @authors astaxie +// Copyright 2014 beego Author. All Rights Reserved. +// +// 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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// 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 redis diff --git a/config.go b/config.go index 802365ee..db234e16 100644 --- a/config.go +++ b/config.go @@ -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 beego import ( diff --git a/config/config.go b/config/config.go index 744adb4b..8d9261b8 100644 --- a/config/config.go +++ b/config/config.go @@ -1,12 +1,44 @@ -// 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. + +// Usage: +// import( +// "github.com/astaxie/beego/config" +// ) // -// @authors astaxie +// cnf, err := config.NewConfig("ini", "config.conf") +// +// cnf APIS: +// +// cnf.Set(key, val string) error +// cnf.String(key string) string +// cnf.Strings(key string) []string +// cnf.Int(key string) (int, error) +// cnf.Int64(key string) (int64, error) +// cnf.Bool(key string) (bool, error) +// cnf.Float(key string) (float64, error) +// cnf.DefaultString(key string, defaultval string) string +// cnf.DefaultStrings(key string, defaultval []string) []string +// cnf.DefaultInt(key string, defaultval int) int +// cnf.DefaultInt64(key string, defaultval int64) int64 +// cnf.DefaultBool(key string, defaultval bool) bool +// cnf.DefaultFloat(key string, defaultval float64) float64 +// cnf.DIY(key string) (interface{}, error) +// cnf.GetSection(section string) (map[string]string, error) +// cnf.SaveConfigFile(filename string) error +// +// more docs http://beego.me/docs/module/config.md package config import ( diff --git a/config/fake.go b/config/fake.go index fec4250d..54588e5e 100644 --- a/config/fake.go +++ b/config/fake.go @@ -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 config import ( diff --git a/config/ini.go b/config/ini.go index 1a8e1a12..ec72a718 100644 --- a/config/ini.go +++ b/config/ini.go @@ -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 config import ( diff --git a/config/ini_test.go b/config/ini_test.go index fc4d88dd..7599ab8b 100644 --- a/config/ini_test.go +++ b/config/ini_test.go @@ -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 config import ( diff --git a/config/json.go b/config/json.go index 0ddca1f0..ae86ea53 100644 --- a/config/json.go +++ b/config/json.go @@ -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 config import ( diff --git a/config/json_test.go b/config/json_test.go index 80f5148c..409e2c12 100644 --- a/config/json_test.go +++ b/config/json_test.go @@ -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 config import ( diff --git a/config/xml/xml.go b/config/xml/xml.go index 6a8494cd..a1d9fcdb 100644 --- a/config/xml/xml.go +++ b/config/xml/xml.go @@ -1,12 +1,32 @@ -// 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 xml for config provider // -// @authors astaxie +// depend on github.com/beego/x2j +// +// go install github.com/beego/x2j +// +// Usage: +// import( +// _ "github.com/astaxie/beego/config/xml" +// "github.com/astaxie/beego/config" +// ) +// +// cnf, err := config.NewConfig("xml", "config.xml") +// +// more docs http://beego.me/docs/module/config.md package xml import ( diff --git a/config/xml/xml_test.go b/config/xml/xml_test.go index 564d6344..fa3c17f1 100644 --- a/config/xml/xml_test.go +++ b/config/xml/xml_test.go @@ -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 xml import ( diff --git a/config/yaml/yaml.go b/config/yaml/yaml.go index 89244e34..c5be44a9 100644 --- a/config/yaml/yaml.go +++ b/config/yaml/yaml.go @@ -1,12 +1,32 @@ -// 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 yaml for config provider // -// @authors astaxie +// depend on github.com/beego/goyaml2 +// +// go install github.com/beego/goyaml2 +// +// Usage: +// import( +// _ "github.com/astaxie/beego/config/yaml" +// "github.com/astaxie/beego/config" +// ) +// +// cnf, err := config.NewConfig("yaml", "config.yaml") +// +// more docs http://beego.me/docs/module/config.md package yaml import ( diff --git a/config/yaml/yaml_test.go b/config/yaml/yaml_test.go index d960f501..19ecdca1 100644 --- a/config/yaml/yaml_test.go +++ b/config/yaml/yaml_test.go @@ -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 yaml import ( diff --git a/config_test.go b/config_test.go index 9b355c45..17645f80 100644 --- a/config_test.go +++ b/config_test.go @@ -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 beego import ( diff --git a/context/context.go b/context/context.go index 26753a6a..1f683ff5 100644 --- a/context/context.go +++ b/context/context.go @@ -1,12 +1,24 @@ -// 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. + +// Usage: // -// @authors astaxie +// import "github.com/astaxie/beego/context" +// +// ctx := context.Context{Request:req,ResponseWriter:rw} +// +// more docs http://beego.me/docs/module/context.md package context import ( diff --git a/context/input.go b/context/input.go index 13f78fbc..c6038693 100644 --- a/context/input.go +++ b/context/input.go @@ -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 context import ( diff --git a/context/input_test.go b/context/input_test.go index dc554786..ddd1a056 100644 --- a/context/input_test.go +++ b/context/input_test.go @@ -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 context import ( diff --git a/context/output.go b/context/output.go index 8f59c94d..6298ee77 100644 --- a/context/output.go +++ b/context/output.go @@ -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 context import ( diff --git a/controller.go b/controller.go index d23a0c8b..eee79513 100644 --- a/controller.go +++ b/controller.go @@ -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 beego import ( diff --git a/docs.go b/docs.go index 8dfd3d82..aaad205e 100644 --- a/docs.go +++ b/docs.go @@ -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 beego import ( diff --git a/filter.go b/filter.go index d9024f9a..294966d4 100644 --- a/filter.go +++ b/filter.go @@ -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 beego // FilterRouter defines filter operation before controller handler execution. diff --git a/filter_test.go b/filter_test.go index 089fea03..ff6f750b 100644 --- a/filter_test.go +++ b/filter_test.go @@ -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 beego import ( diff --git a/flash.go b/flash.go index 68de09c9..6e85141f 100644 --- a/flash.go +++ b/flash.go @@ -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 beego import ( diff --git a/flash_test.go b/flash_test.go index 383a10b7..7c581e6a 100644 --- a/flash_test.go +++ b/flash_test.go @@ -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 beego import ( diff --git a/httplib/httplib.go b/httplib/httplib.go index 7bd7e743..7348791e 100644 --- a/httplib/httplib.go +++ b/httplib/httplib.go @@ -1,12 +1,33 @@ -// 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. + +// Usage: // -// @authors astaxie +// import "github.com/astaxie/beego/context" +// +// b:=httplib.Post("http://beego.me/") +// b.Param("username","astaxie") +// b.Param("password","123456") +// b.PostFile("uploadfile1", "httplib.pdf") +// b.PostFile("uploadfile2", "httplib.txt") +// str, err := b.String() +// if err != nil { +// t.Fatal(err) +// } +// fmt.Println(str) +// +// more docs http://beego.me/docs/module/httplib.md package httplib import ( diff --git a/httplib/httplib_test.go b/httplib/httplib_test.go index 9a94116e..3d0273b7 100644 --- a/httplib/httplib_test.go +++ b/httplib/httplib_test.go @@ -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 httplib import ( diff --git a/log.go b/log.go index d888b17a..5afba8ed 100644 --- a/log.go +++ b/log.go @@ -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 beego import ( diff --git a/logs/conn.go b/logs/conn.go index b7255b5c..612634fa 100644 --- a/logs/conn.go +++ b/logs/conn.go @@ -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 logs import ( diff --git a/logs/conn_test.go b/logs/conn_test.go index 4e200424..747fb890 100644 --- a/logs/conn_test.go +++ b/logs/conn_test.go @@ -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 logs import ( diff --git a/logs/console.go b/logs/console.go index 96a34c0f..0248a329 100644 --- a/logs/console.go +++ b/logs/console.go @@ -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 logs import ( diff --git a/logs/console_test.go b/logs/console_test.go index 8b775baa..2fad7241 100644 --- a/logs/console_test.go +++ b/logs/console_test.go @@ -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 logs import ( diff --git a/logs/file.go b/logs/file.go index 2d371a1e..e80b955c 100644 --- a/logs/file.go +++ b/logs/file.go @@ -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 logs import ( diff --git a/logs/file_test.go b/logs/file_test.go index 66ebb01c..c71e9bb4 100644 --- a/logs/file_test.go +++ b/logs/file_test.go @@ -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 logs import ( diff --git a/logs/log.go b/logs/log.go index 8e6c0308..4349e8a5 100644 --- a/logs/log.go +++ b/logs/log.go @@ -1,12 +1,35 @@ -// 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. + +// Usage: // -// @authors astaxie +// import "github.com/astaxie/beego/logs" +// +// log := NewLogger(10000) +// log.SetLogger("console", "") +// +// > the first params stand for how many channel +// +// Use it like this: +// +// log.Trace("trace") +// log.Info("info") +// log.Warn("warning") +// log.Debug("debug") +// log.Critical("critical") +// +// more docs http://beego.me/docs/module/logs.md package logs import ( diff --git a/logs/smtp.go b/logs/smtp.go index fa5dc78e..3373d7f4 100644 --- a/logs/smtp.go +++ b/logs/smtp.go @@ -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 logs import ( @@ -77,7 +82,7 @@ func (s *SmtpWriter) WriteMsg(msg string, level int) error { // Set up authentication information. auth := s.GetSmtpAuth(hp[0]) - + // Connect to the server, authenticate, set the sender and recipient, // and send the email all in one step. content_type := "Content-Type: text/plain" + "; charset=UTF-8" diff --git a/logs/smtp_test.go b/logs/smtp_test.go index 58e15134..28e762d2 100644 --- a/logs/smtp_test.go +++ b/logs/smtp_test.go @@ -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 logs import ( diff --git a/memzipfile.go b/memzipfile.go index 2fce9b81..cc5e3851 100644 --- a/memzipfile.go +++ b/memzipfile.go @@ -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 beego import ( diff --git a/middleware/error.go b/middleware/error.go index 49ed1673..3b7191e9 100644 --- a/middleware/error.go +++ b/middleware/error.go @@ -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 middleware import ( diff --git a/middleware/exceptions.go b/middleware/exceptions.go index 4165c3e6..a08a7358 100644 --- a/middleware/exceptions.go +++ b/middleware/exceptions.go @@ -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 middleware import "fmt" diff --git a/middleware/i18n.go b/middleware/i18n.go index 3009b46d..e4dab693 100644 --- a/middleware/i18n.go +++ b/middleware/i18n.go @@ -1,12 +1,24 @@ -// 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. + +// Usage: // -// @authors astaxie +// import "github.com/astaxie/beego/middleware" +// +// I18N = middleware.NewLocale("conf/i18n.conf", beego.AppConfig.String("language")) +// +// more docs: http://beego.me/docs/module/i18n.md package middleware import ( diff --git a/migration/migration.go b/migration/migration.go index 47035e6a..d64d60d3 100644 --- a/migration/migration.go +++ b/migration/migration.go @@ -1,12 +1,20 @@ -// 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. + +// migration package for migration // -// @authors astaxie +// The table structure is as follow: // // CREATE TABLE `migrations` ( // `id_migration` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'surrogate key', diff --git a/mime.go b/mime.go index 57487398..155e5e12 100644 --- a/mime.go +++ b/mime.go @@ -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 beego import ( diff --git a/namespace.go b/namespace.go index c8ec2488..d0109291 100644 --- a/namespace.go +++ b/namespace.go @@ -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 beego import ( diff --git a/namespace_test.go b/namespace_test.go index 7587f4b2..a92ae3ef 100644 --- a/namespace_test.go +++ b/namespace_test.go @@ -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 beego import ( diff --git a/orm/README.md b/orm/README.md index d4721307..74f1b47b 100644 --- a/orm/README.md +++ b/orm/README.md @@ -154,10 +154,5 @@ note: not recommend use this in product env. more details and examples in docs and test -* [中文](http://beego.me/docs/Models_Overview?lang=zh) -* [English](http://beego.me/docs/Models_Overview?lang=en) +[documents](http://beego.me/docs/mvc/model/overview.md) -## TODO -- some unrealized api -- examples -- docs diff --git a/orm/cmd.go b/orm/cmd.go index e31b0ef4..2358ef3c 100644 --- a/orm/cmd.go +++ b/orm/cmd.go @@ -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, slene +// 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 orm import ( diff --git a/orm/cmd_utils.go b/orm/cmd_utils.go index 82f125d3..8304da6b 100644 --- a/orm/cmd_utils.go +++ b/orm/cmd_utils.go @@ -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, slene +// 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 orm import ( diff --git a/orm/db.go b/orm/db.go index f4a9f42c..2addff22 100644 --- a/orm/db.go +++ b/orm/db.go @@ -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, slene +// 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 orm import ( diff --git a/orm/db_alias.go b/orm/db_alias.go index 5a00d620..0a862241 100644 --- a/orm/db_alias.go +++ b/orm/db_alias.go @@ -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, slene +// 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 orm import ( diff --git a/orm/db_mysql.go b/orm/db_mysql.go index 85582966..3c2ad3a4 100644 --- a/orm/db_mysql.go +++ b/orm/db_mysql.go @@ -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, slene +// 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 orm import ( diff --git a/orm/db_oracle.go b/orm/db_oracle.go index c8321c5a..1e385c9a 100644 --- a/orm/db_oracle.go +++ b/orm/db_oracle.go @@ -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, slene +// 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 orm // oracle dbBaser diff --git a/orm/db_postgres.go b/orm/db_postgres.go index ac94446e..296ee6a0 100644 --- a/orm/db_postgres.go +++ b/orm/db_postgres.go @@ -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, slene +// 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 orm import ( diff --git a/orm/db_sqlite.go b/orm/db_sqlite.go index 8f6aae76..0a2f32c8 100644 --- a/orm/db_sqlite.go +++ b/orm/db_sqlite.go @@ -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, slene +// 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 orm import ( diff --git a/orm/db_tables.go b/orm/db_tables.go index 56e19759..a9aa10ab 100644 --- a/orm/db_tables.go +++ b/orm/db_tables.go @@ -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, slene +// 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 orm import ( diff --git a/orm/db_utils.go b/orm/db_utils.go index 713eb51c..4a3ba464 100644 --- a/orm/db_utils.go +++ b/orm/db_utils.go @@ -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, slene +// 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 orm import ( diff --git a/orm/models.go b/orm/models.go index c1c51deb..dcb32b55 100644 --- a/orm/models.go +++ b/orm/models.go @@ -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, slene +// 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 orm import ( diff --git a/orm/models_boot.go b/orm/models_boot.go index 138a4844..cb44bc05 100644 --- a/orm/models_boot.go +++ b/orm/models_boot.go @@ -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, slene +// 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 orm import ( diff --git a/orm/models_fields.go b/orm/models_fields.go index dd99596f..f038dd0f 100644 --- a/orm/models_fields.go +++ b/orm/models_fields.go @@ -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, slene +// 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 orm import ( diff --git a/orm/models_info_f.go b/orm/models_info_f.go index ebd140f7..a79ffab2 100644 --- a/orm/models_info_f.go +++ b/orm/models_info_f.go @@ -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, slene +// 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 orm import ( diff --git a/orm/models_info_m.go b/orm/models_info_m.go index e9d2e65f..3600ee7c 100644 --- a/orm/models_info_m.go +++ b/orm/models_info_m.go @@ -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, slene +// 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 orm import ( diff --git a/orm/models_test.go b/orm/models_test.go index 99377bfa..fe78c45f 100644 --- a/orm/models_test.go +++ b/orm/models_test.go @@ -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, slene +// 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 orm import ( diff --git a/orm/models_utils.go b/orm/models_utils.go index b682040b..ffde40ea 100644 --- a/orm/models_utils.go +++ b/orm/models_utils.go @@ -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, slene +// 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 orm import ( diff --git a/orm/orm.go b/orm/orm.go index 96cb3430..cdb7f27c 100644 --- a/orm/orm.go +++ b/orm/orm.go @@ -1,12 +1,53 @@ -// 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. + +// Simple Usage // -// @authors astaxie, slene +// package main +// +// import ( +// "fmt" +// "github.com/astaxie/beego/orm" +// _ "github.com/go-sql-driver/mysql" // import your used driver +// ) +// +// // Model Struct +// type User struct { +// Id int `orm:"auto"` +// Name string `orm:"size(100)"` +// } +// +// func init() { +// orm.RegisterDataBase("default", "mysql", "root:root@/my_db?charset=utf8", 30) +// } +// +// func main() { +// o := orm.NewOrm() +// user := User{Name: "slene"} +// // insert +// id, err := o.Insert(&user) +// // update +// user.Name = "astaxie" +// num, err := o.Update(&user) +// // read one +// u := User{Id: user.Id} +// err = o.Read(&u) +// // delete +// num, err = o.Delete(&u) +// } +// +// more docs: http://beego.me/docs/mvc/model/overview.md package orm import ( diff --git a/orm/orm_conds.go b/orm/orm_conds.go index c5a57305..6344653a 100644 --- a/orm/orm_conds.go +++ b/orm/orm_conds.go @@ -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, slene +// 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 orm import ( diff --git a/orm/orm_log.go b/orm/orm_log.go index ad9ae70c..419d8e11 100644 --- a/orm/orm_log.go +++ b/orm/orm_log.go @@ -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, slene +// 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 orm import ( diff --git a/orm/orm_object.go b/orm/orm_object.go index 1a91d789..df5a6600 100644 --- a/orm/orm_object.go +++ b/orm/orm_object.go @@ -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, slene +// 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 orm import ( diff --git a/orm/orm_querym2m.go b/orm/orm_querym2m.go index c525d42e..1eaccf72 100644 --- a/orm/orm_querym2m.go +++ b/orm/orm_querym2m.go @@ -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, slene +// 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 orm import ( diff --git a/orm/orm_queryset.go b/orm/orm_queryset.go index 5c651023..4f5d5485 100644 --- a/orm/orm_queryset.go +++ b/orm/orm_queryset.go @@ -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, slene +// 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 orm import ( diff --git a/orm/orm_raw.go b/orm/orm_raw.go index 5936e590..1393d414 100644 --- a/orm/orm_raw.go +++ b/orm/orm_raw.go @@ -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, slene +// 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 orm import ( diff --git a/orm/orm_test.go b/orm/orm_test.go index d8b48ef4..e7420bcb 100644 --- a/orm/orm_test.go +++ b/orm/orm_test.go @@ -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, slene +// 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 orm import ( diff --git a/orm/types.go b/orm/types.go index f104513a..c342e1c2 100644 --- a/orm/types.go +++ b/orm/types.go @@ -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, slene +// 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 orm import ( diff --git a/orm/utils.go b/orm/utils.go index a0bb94a3..df6147c1 100644 --- a/orm/utils.go +++ b/orm/utils.go @@ -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, slene +// 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 orm import ( diff --git a/parser.go b/parser.go index 0d3f6b84..65144f5d 100644 --- a/parser.go +++ b/parser.go @@ -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 beego import ( diff --git a/plugins/auth/basic.go b/plugins/auth/basic.go index 98e4864f..ed8bc4bd 100644 --- a/plugins/auth/basic.go +++ b/plugins/auth/basic.go @@ -27,11 +27,11 @@ // // // Advanced Usage: -// func SecretAuth(username, password string) bool { -// return username == "astaxie" && password == "helloBeego" -// } -// authPlugin := auth.NewBasicAuthenticator(SecretAuth, "Authorization Required") -// beego.InsertFilter("*", beego.BeforeRouter,authPlugin) +// func SecretAuth(username, password string) bool { +// return username == "astaxie" && password == "helloBeego" +// } +// authPlugin := auth.NewBasicAuthenticator(SecretAuth, "Authorization Required") +// beego.InsertFilter("*", beego.BeforeRouter,authPlugin) package auth import ( diff --git a/plugins/cors/cors.go b/plugins/cors/cors.go index c8de8250..dce750eb 100644 --- a/plugins/cors/cors.go +++ b/plugins/cors/cors.go @@ -14,26 +14,25 @@ // Package cors provides handlers to enable CORS support. // Usage -// -// import ( -// "github.com/astaxie/beego" -// "github.com/astaxie/beego/plugins/cors" +// import ( +// "github.com/astaxie/beego" +// "github.com/astaxie/beego/plugins/cors" // ) - -//func main() { -// // CORS for https://foo.* origins, allowing: -// // - PUT and PATCH methods -// // - Origin header -// // - Credentials share -// beego.InsertFilter("*", beego.BeforeRouter,cors.Allow(&cors.Options{ -// AllowOrigins: []string{"https://*.foo.com"}, -// AllowMethods: []string{"PUT", "PATCH"}, -// AllowHeaders: []string{"Origin"}, -// ExposeHeaders: []string{"Content-Length"}, -// AllowCredentials: true, -// })) -// beego.Run() -//} +// +// func main() { +// // CORS for https://foo.* origins, allowing: +// // - PUT and PATCH methods +// // - Origin header +// // - Credentials share +// beego.InsertFilter("*", beego.BeforeRouter,cors.Allow(&cors.Options{ +// AllowOrigins: []string{"https://*.foo.com"}, +// AllowMethods: []string{"PUT", "PATCH"}, +// AllowHeaders: []string{"Origin"}, +// ExposeHeaders: []string{"Content-Length"}, +// AllowCredentials: true, +// })) +// beego.Run() +// } package cors import ( diff --git a/plugins/cors/cors_test.go b/plugins/cors/cors_test.go index 0ed468fe..5c02ab98 100644 --- a/plugins/cors/cors_test.go +++ b/plugins/cors/cors_test.go @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package cors provides handlers to enable CORS support. package cors import ( diff --git a/router.go b/router.go index a87b7aad..6f8bd769 100644 --- a/router.go +++ b/router.go @@ -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 beego import ( diff --git a/router_test.go b/router_test.go index d4d80fa0..d378589b 100644 --- a/router_test.go +++ b/router_test.go @@ -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 beego import ( diff --git a/session/couchbase/sess_couchbase.go b/session/couchbase/sess_couchbase.go index 8066e338..827d55d9 100644 --- a/session/couchbase/sess_couchbase.go +++ b/session/couchbase/sess_couchbase.go @@ -1,12 +1,35 @@ -// 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 couchbase for session provider // -// @authors astaxie +// depend on github.com/couchbaselabs/go-couchbasee +// +// go install github.com/couchbaselabs/go-couchbase +// +// Usage: +// import( +// _ "github.com/astaxie/beego/session/couchbase" +// "github.com/astaxie/beego/session" +// ) +// +// func init() { +// globalSessions, _ = session.NewManager("couchbase", ``{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"http://host:port/, Pool, Bucket"}``) +// go globalSessions.GC() +// } +// +// more docs: http://beego.me/docs/module/session.md package session import ( diff --git a/session/memcache/sess_memcache.go b/session/memcache/sess_memcache.go index 5a1dc6b9..5827a0a9 100644 --- a/session/memcache/sess_memcache.go +++ b/session/memcache/sess_memcache.go @@ -1,12 +1,35 @@ -// 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 memcache for session provider // -// @authors astaxie +// depend on github.com/bradfitz/gomemcache/memcache +// +// go install github.com/bradfitz/gomemcache/memcache +// +// Usage: +// import( +// _ "github.com/astaxie/beego/session/memcache" +// "github.com/astaxie/beego/session" +// ) +// +// func init() { +// globalSessions, _ = session.NewManager("memcache", ``{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:11211"}``) +// go globalSessions.GC() +// } +// +// more docs: http://beego.me/docs/module/session.md package session import ( @@ -65,12 +88,12 @@ func (rs *MemcacheSessionStore) Flush() error { return nil } -// get redis session id +// get memcache session id func (rs *MemcacheSessionStore) SessionID() string { return rs.sid } -// save session values to redis +// save session values to memcache func (rs *MemcacheSessionStore) SessionRelease(w http.ResponseWriter) { b, err := session.EncodeGob(rs.values) if err != nil { @@ -80,7 +103,7 @@ func (rs *MemcacheSessionStore) SessionRelease(w http.ResponseWriter) { client.Set(&item) } -// redis session provider +// memcahe session provider type MemProvider struct { maxlifetime int64 conninfo []string @@ -88,7 +111,7 @@ type MemProvider struct { password string } -// init redis session +// init memcache session // savepath like // e.g. 127.0.0.1:9090 func (rp *MemProvider) SessionInit(maxlifetime int64, savePath string) error { @@ -98,7 +121,7 @@ func (rp *MemProvider) SessionInit(maxlifetime int64, savePath string) error { return nil } -// read redis session by sid +// read memcache session by sid func (rp *MemProvider) SessionRead(sid string) (session.SessionStore, error) { if client == nil { if err := rp.connectInit(); err != nil { @@ -123,7 +146,7 @@ func (rp *MemProvider) SessionRead(sid string) (session.SessionStore, error) { return rs, nil } -// check redis session exist by sid +// check memcache session exist by sid func (rp *MemProvider) SessionExist(sid string) bool { if client == nil { if err := rp.connectInit(); err != nil { @@ -137,7 +160,7 @@ func (rp *MemProvider) SessionExist(sid string) bool { } } -// generate new sid for redis session +// generate new sid for memcache session func (rp *MemProvider) SessionRegenerate(oldsid, sid string) (session.SessionStore, error) { if client == nil { if err := rp.connectInit(); err != nil { @@ -177,7 +200,7 @@ func (rp *MemProvider) SessionRegenerate(oldsid, sid string) (session.SessionSto return rs, nil } -// delete redis session by id +// delete memcache session by id func (rp *MemProvider) SessionDestroy(sid string) error { if client == nil { if err := rp.connectInit(); err != nil { diff --git a/session/mysql/sess_mysql.go b/session/mysql/sess_mysql.go index 39f31230..0f6d3e4f 100644 --- a/session/mysql/sess_mysql.go +++ b/session/mysql/sess_mysql.go @@ -1,14 +1,23 @@ -// 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 -package session +// 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 mysql for session provider +// +// depends on github.com/go-sql-driver/mysql: +// +// go install github.com/go-sql-driver/mysql +// // mysql session support need create table as sql: // CREATE TABLE `session` ( // `session_key` char(64) NOT NULL, @@ -16,6 +25,20 @@ package session // `session_expiry` int(11) unsigned NOT NULL, // PRIMARY KEY (`session_key`) // ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +// +// Usage: +// import( +// _ "github.com/astaxie/beego/session/mysql" +// "github.com/astaxie/beego/session" +// ) +// +// func init() { +// globalSessions, _ = session.NewManager("mysql", ``{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN]"}``) +// go globalSessions.GC() +// } +// +// more docs: http://beego.me/docs/module/session.md +package session import ( "database/sql" diff --git a/session/postgres/sess_postgresql.go b/session/postgres/sess_postgresql.go index 1796da2f..ac9a1612 100644 --- a/session/postgres/sess_postgresql.go +++ b/session/postgres/sess_postgresql.go @@ -1,43 +1,55 @@ -// 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 postgresql for session provider // -// @authors astaxie +// depends on github.com/lib/pq: +// +// go install github.com/lib/pq +// +// +// needs this table in your database: +// +// CREATE TABLE session ( +// session_key char(64) NOT NULL, +// session_data bytea, +// session_expiry timestamp NOT NULL, +// CONSTRAINT session_key PRIMARY KEY(session_key) +// ); + +// will be activated with these settings in app.conf: + +// SessionOn = true +// SessionProvider = postgresql +// SessionSavePath = "user=a password=b dbname=c sslmode=disable" +// SessionName = session +// +// +// Usage: +// import( +// _ "github.com/astaxie/beego/session/postgresql" +// "github.com/astaxie/beego/session" +// ) +// +// func init() { +// globalSessions, _ = session.NewManager("postgresql", ``{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"user=pqgotest dbname=pqgotest sslmode=verify-full"}``) +// go globalSessions.GC() +// } +// +// more docs: http://beego.me/docs/module/session.md package session -/* - -beego session provider for postgresql -------------------------------------- - -depends on github.com/lib/pq: - -go install github.com/lib/pq - - -needs this table in your database: - -CREATE TABLE session ( -session_key char(64) NOT NULL, -session_data bytea, -session_expiry timestamp NOT NULL, -CONSTRAINT session_key PRIMARY KEY(session_key) -); - - -will be activated with these settings in app.conf: - -SessionOn = true -SessionProvider = postgresql -SessionSavePath = "user=a password=b dbname=c sslmode=disable" -SessionName = session - -*/ - import ( "database/sql" "net/http" diff --git a/session/redis/sess_redis.go b/session/redis/sess_redis.go index 8368dbc0..f2b0b29b 100644 --- a/session/redis/sess_redis.go +++ b/session/redis/sess_redis.go @@ -1,12 +1,35 @@ -// 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 redis for session provider // -// @authors astaxie +// depend on github.com/garyburd/redigo/redis +// +// go install github.com/garyburd/redigo/redis +// +// Usage: +// import( +// _ "github.com/astaxie/beego/session/redis" +// "github.com/astaxie/beego/session" +// ) +// +// func init() { +// globalSessions, _ = session.NewManager("redis", ``{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":"127.0.0.1:7070"}``) +// go globalSessions.GC() +// } +// +// more docs: http://beego.me/docs/module/session.md package session import ( @@ -17,7 +40,7 @@ import ( "github.com/astaxie/beego/session" - "github.com/beego/redigo/redis" + "github.com/garyburd/redigo/redis" ) var redispder = &RedisProvider{} diff --git a/session/sess_cookie.go b/session/sess_cookie.go index 08b1ce38..01dc505c 100644 --- a/session/sess_cookie.go +++ b/session/sess_cookie.go @@ -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 session import ( diff --git a/session/sess_cookie_test.go b/session/sess_cookie_test.go index 0a5831e1..4f40a7ba 100644 --- a/session/sess_cookie_test.go +++ b/session/sess_cookie_test.go @@ -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 session import ( diff --git a/session/sess_file.go b/session/sess_file.go index 0362e45a..b1084acf 100644 --- a/session/sess_file.go +++ b/session/sess_file.go @@ -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 session import ( diff --git a/session/sess_mem.go b/session/sess_mem.go index deec8190..627a3246 100644 --- a/session/sess_mem.go +++ b/session/sess_mem.go @@ -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 session import ( diff --git a/session/sess_mem_test.go b/session/sess_mem_test.go index 6bcbd157..03927c76 100644 --- a/session/sess_mem_test.go +++ b/session/sess_mem_test.go @@ -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 session import ( diff --git a/session/sess_test.go b/session/sess_test.go index ed9acd9d..5ba910f2 100644 --- a/session/sess_test.go +++ b/session/sess_test.go @@ -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 session import ( diff --git a/session/sess_utils.go b/session/sess_utils.go index 63bf3d9c..9ae74528 100644 --- a/session/sess_utils.go +++ b/session/sess_utils.go @@ -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 session import ( diff --git a/session/session.go b/session/session.go index 35d81b6e..88e94d59 100644 --- a/session/session.go +++ b/session/session.go @@ -1,12 +1,30 @@ -// 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 session provider // -// @authors astaxie +// Usage: +// import( +// "github.com/astaxie/beego/session" +// ) +// +// func init() { +// globalSessions, _ = session.NewManager("memory", `{"cookieName":"gosessionid", "enableSetCookie,omitempty": true, "gclifetime":3600, "maxLifetime": 3600, "secure": false, "sessionIDHashFunc": "sha1", "sessionIDHashKey": "", "cookieLifeTime": 3600, "providerConfig": ""}`) +// go globalSessions.GC() +// } +// +// more docs: http://beego.me/docs/module/session.md package session import ( diff --git a/staticfile.go b/staticfile.go index 1881b711..a9deabe9 100644 --- a/staticfile.go +++ b/staticfile.go @@ -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 beego import ( diff --git a/swagger/docsSpec.go b/swagger/docsSpec.go index fd054c52..6f8fe1db 100644 --- a/swagger/docsSpec.go +++ b/swagger/docsSpec.go @@ -1,12 +1,18 @@ -// 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. + +// swagger struct definition package swagger const SwaggerVersion = "1.2" diff --git a/template.go b/template.go index 69a286c2..2ca84f22 100644 --- a/template.go +++ b/template.go @@ -1,15 +1,18 @@ -// 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 -package beego +// 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. -//@todo add template funcs +package beego import ( "errors" diff --git a/template_test.go b/template_test.go index a18dc09f..b35da5ce 100644 --- a/template_test.go +++ b/template_test.go @@ -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 beego import ( diff --git a/templatefunc.go b/templatefunc.go index f72017e1..a365718d 100644 --- a/templatefunc.go +++ b/templatefunc.go @@ -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 beego import ( diff --git a/templatefunc_test.go b/templatefunc_test.go index 49807f12..44a06dec 100644 --- a/templatefunc_test.go +++ b/templatefunc_test.go @@ -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 beego import ( diff --git a/testing/assertions.go b/testing/assertions.go index 7fa4c199..96c5d4dd 100644 --- a/testing/assertions.go +++ b/testing/assertions.go @@ -1,10 +1,15 @@ -// 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 testing diff --git a/testing/client.go b/testing/client.go index 0819d508..366bda96 100644 --- a/testing/client.go +++ b/testing/client.go @@ -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 testing import ( diff --git a/toolbox/healthcheck.go b/toolbox/healthcheck.go index dc195549..4ccff785 100644 --- a/toolbox/healthcheck.go +++ b/toolbox/healthcheck.go @@ -1,26 +1,34 @@ -// 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 -package toolbox +// 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. -//type DatabaseCheck struct { -//} - -//func (dc *DatabaseCheck) Check() error { +// toolbox healthcheck +// +// type DatabaseCheck struct { +// } +// +// func (dc *DatabaseCheck) Check() error { // if dc.isConnected() { // return nil // } else { // return errors.New("can't connect database") -// } -//} - -//AddHealthCheck("database",&DatabaseCheck{}) +// } +// } +// +// AddHealthCheck("database",&DatabaseCheck{}) +// +// more docs: http://beego.me/docs/module/toolbox.md +package toolbox // health checker map var AdminCheckList map[string]HealthChecker diff --git a/toolbox/profile.go b/toolbox/profile.go index a4e4b155..b428e2ff 100644 --- a/toolbox/profile.go +++ b/toolbox/profile.go @@ -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 toolbox import ( diff --git a/toolbox/profile_test.go b/toolbox/profile_test.go index cb3135d5..07a20c4e 100644 --- a/toolbox/profile_test.go +++ b/toolbox/profile_test.go @@ -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 toolbox import ( diff --git a/toolbox/statistics.go b/toolbox/statistics.go index 0ca31473..0a5170b0 100644 --- a/toolbox/statistics.go +++ b/toolbox/statistics.go @@ -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 toolbox import ( diff --git a/toolbox/statistics_test.go b/toolbox/statistics_test.go index 1649019c..448b2af5 100644 --- a/toolbox/statistics_test.go +++ b/toolbox/statistics_test.go @@ -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 toolbox import ( diff --git a/toolbox/task.go b/toolbox/task.go index 439035a1..6931e189 100644 --- a/toolbox/task.go +++ b/toolbox/task.go @@ -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 toolbox import ( diff --git a/toolbox/task_test.go b/toolbox/task_test.go index a1e85166..596bc9c5 100644 --- a/toolbox/task_test.go +++ b/toolbox/task_test.go @@ -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 toolbox import ( diff --git a/tree.go b/tree.go index f32bed13..eebc7f85 100644 --- a/tree.go +++ b/tree.go @@ -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 beego import ( diff --git a/tree_test.go b/tree_test.go index 97c855c0..30856d29 100644 --- a/tree_test.go +++ b/tree_test.go @@ -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 beego import "testing" diff --git a/utils/caller.go b/utils/caller.go index 6684880a..de04d96e 100644 --- a/utils/caller.go +++ b/utils/caller.go @@ -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 utils import ( diff --git a/utils/caller_test.go b/utils/caller_test.go index 95262d75..0675f0aa 100644 --- a/utils/caller_test.go +++ b/utils/caller_test.go @@ -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 utils import ( diff --git a/utils/captcha/captcha.go b/utils/captcha/captcha.go index 27748f12..62adc81d 100644 --- a/utils/captcha/captcha.go +++ b/utils/captcha/captcha.go @@ -1,13 +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 -// -// @license http://github.com/astaxie/beego/blob/master/LICENSE -// -// @authors astaxie +// http://www.apache.org/licenses/LICENSE-2.0 // +// 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. + // an example for use captcha // // ``` @@ -224,7 +228,6 @@ func (c *Captcha) Verify(id string, challenge string) (success bool) { return true } - // create a new captcha.Captcha func NewCaptcha(urlPrefix string, store cache.Cache) *Captcha { cpt := &Captcha{} diff --git a/utils/captcha/image.go b/utils/captcha/image.go index cde4932a..8e9039d0 100644 --- a/utils/captcha/image.go +++ b/utils/captcha/image.go @@ -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 captcha import ( diff --git a/utils/captcha/image_test.go b/utils/captcha/image_test.go index 393262c8..5e35b7f7 100644 --- a/utils/captcha/image_test.go +++ b/utils/captcha/image_test.go @@ -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 captcha import ( diff --git a/utils/captcha/siprng.go b/utils/captcha/siprng.go index 54d6e93b..5e256cf9 100644 --- a/utils/captcha/siprng.go +++ b/utils/captcha/siprng.go @@ -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 captcha import ( diff --git a/utils/captcha/siprng_test.go b/utils/captcha/siprng_test.go index f6d31055..189d3d3c 100644 --- a/utils/captcha/siprng_test.go +++ b/utils/captcha/siprng_test.go @@ -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 captcha import "testing" diff --git a/utils/debug.go b/utils/debug.go index 972b2c5b..f9a682d3 100644 --- a/utils/debug.go +++ b/utils/debug.go @@ -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 utils import ( diff --git a/utils/debug_test.go b/utils/debug_test.go index 40598551..efb8924e 100644 --- a/utils/debug_test.go +++ b/utils/debug_test.go @@ -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 utils import ( diff --git a/utils/file.go b/utils/file.go index ad221c92..c9c3e903 100644 --- a/utils/file.go +++ b/utils/file.go @@ -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 utils import ( diff --git a/utils/file_test.go b/utils/file_test.go index 0805415a..020d7e4c 100644 --- a/utils/file_test.go +++ b/utils/file_test.go @@ -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 utils import ( diff --git a/utils/mail.go b/utils/mail.go index d0383ade..c7ab73d8 100644 --- a/utils/mail.go +++ b/utils/mail.go @@ -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 utils import ( diff --git a/utils/mail_test.go b/utils/mail_test.go index f09f5b78..c38356a2 100644 --- a/utils/mail_test.go +++ b/utils/mail_test.go @@ -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 utils import "testing" diff --git a/utils/rand.go b/utils/rand.go index 23cf3926..74bb4121 100644 --- a/utils/rand.go +++ b/utils/rand.go @@ -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 utils import ( diff --git a/utils/safemap.go b/utils/safemap.go index e99aceee..37e76eb3 100644 --- a/utils/safemap.go +++ b/utils/safemap.go @@ -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 utils import ( diff --git a/utils/safemap_test.go b/utils/safemap_test.go index 32034e91..fb271d18 100644 --- a/utils/safemap_test.go +++ b/utils/safemap_test.go @@ -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 utils import ( diff --git a/utils/slice.go b/utils/slice.go index 323c02fd..729f6594 100644 --- a/utils/slice.go +++ b/utils/slice.go @@ -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 utils import ( diff --git a/utils/slice_test.go b/utils/slice_test.go index a1c053c6..142dec96 100644 --- a/utils/slice_test.go +++ b/utils/slice_test.go @@ -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 utils import ( diff --git a/validation/util.go b/validation/util.go index 91d2a735..249462d4 100644 --- a/validation/util.go +++ b/validation/util.go @@ -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 ( diff --git a/validation/util_test.go b/validation/util_test.go index ca99a7ab..c4283c4e 100644 --- a/validation/util_test.go +++ b/validation/util_test.go @@ -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 ( diff --git a/validation/validation.go b/validation/validation.go index b86b565f..addf6b7e 100644 --- a/validation/validation.go +++ b/validation/validation.go @@ -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 ( diff --git a/validation/validation_test.go b/validation/validation_test.go index ff279b64..be63ac93 100644 --- a/validation/validation_test.go +++ b/validation/validation_test.go @@ -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 ( diff --git a/validation/validators.go b/validation/validators.go index 5a468d67..25415bdd 100644 --- a/validation/validators.go +++ b/validation/validators.go @@ -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 (