mirror of
https://github.com/astaxie/beego.git
synced 2024-11-23 03:30:57 +00:00
Merge branch 'master' into develop
This commit is contained in:
commit
724137e605
20
README.md
20
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)
|
[![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.
|
beego is an open-source, high-performance, modularity, full-stack web framework.
|
||||||
|
|
||||||
It is a simple & powerful web framework.
|
|
||||||
|
|
||||||
More info [beego.me](http://beego.me)
|
More info [beego.me](http://beego.me)
|
||||||
|
|
||||||
@ -12,20 +10,18 @@ More info [beego.me](http://beego.me)
|
|||||||
|
|
||||||
* RESTful support
|
* RESTful support
|
||||||
* MVC architecture
|
* MVC architecture
|
||||||
* Session support (store in memory, file, Redis or MySQL)
|
* modularity
|
||||||
* Cache support (store in memory, Redis or Memcache)
|
* auto API documents
|
||||||
* Global Config
|
* annotation router
|
||||||
* Intelligent routing
|
* namespace
|
||||||
* Thread-safe map
|
* powerful develop tools
|
||||||
* Friendly displaying of errors
|
* full stack for web & API
|
||||||
* Useful template functions
|
|
||||||
|
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
[English](http://beego.me/docs/intro/)
|
[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/)
|
[中文文档](http://beego.me/docs/intro/)
|
||||||
|
|
||||||
|
17
admin.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
adminui.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
var indexTpl = `
|
var indexTpl = `
|
||||||
|
17
app.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
26
beego.go
26
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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
31
cache/cache.go
vendored
31
cache/cache.go
vendored
@ -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
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
cache/cache_test.go
vendored
17
cache/cache_test.go
vendored
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
cache/conv.go
vendored
17
cache/conv.go
vendored
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
cache/conv_test.go
vendored
17
cache/conv_test.go
vendored
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
cache/file.go
vendored
17
cache/file.go
vendored
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
30
cache/memcache/memcache.go
vendored
30
cache/memcache/memcache.go
vendored
@ -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
|
package memcache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
cache/memory.go
vendored
17
cache/memory.go
vendored
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
30
cache/redis/redis.go
vendored
30
cache/redis/redis.go
vendored
@ -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
|
package redis
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
22
cache/redis/redis_test.go
vendored
22
cache/redis/redis_test.go
vendored
@ -1,12 +1,16 @@
|
|||||||
// 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.
|
||||||
// @link http://github.com/astaxie/beego for the canonical source repository
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
// @license http://github.com/astaxie/beego/blob/master/LICENSE
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
// @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 redis
|
package redis
|
||||||
|
|
||||||
|
17
config.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
package xml
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package xml
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
package yaml
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package yaml
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
package context
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package context
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package context
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package context
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
docs.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
filter.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
// FilterRouter defines filter operation before controller handler execution.
|
// FilterRouter defines filter operation before controller handler execution.
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
flash.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
package httplib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package httplib
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
log.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
logs/conn.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package logs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package logs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package logs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package logs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
logs/file.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package logs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package logs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
33
logs/log.go
33
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
|
package logs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
logs/smtp.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package logs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package logs
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package middleware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package middleware
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
@ -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
|
package middleware
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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` (
|
// CREATE TABLE `migrations` (
|
||||||
// `id_migration` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'surrogate key',
|
// `id_migration` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'surrogate key',
|
||||||
|
17
mime.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
namespace.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -154,10 +154,5 @@ note: not recommend use this in product env.
|
|||||||
|
|
||||||
more details and examples in docs and test
|
more details and examples in docs and test
|
||||||
|
|
||||||
* [中文](http://beego.me/docs/Models_Overview?lang=zh)
|
[documents](http://beego.me/docs/mvc/model/overview.md)
|
||||||
* [English](http://beego.me/docs/Models_Overview?lang=en)
|
|
||||||
|
|
||||||
## TODO
|
|
||||||
- some unrealized api
|
|
||||||
- examples
|
|
||||||
- docs
|
|
||||||
|
17
orm/cmd.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
orm/db.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
// oracle dbBaser
|
// oracle dbBaser
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
51
orm/orm.go
51
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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
orm/types.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
orm/utils.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie, slene
|
// 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
|
package orm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
parser.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -14,13 +14,12 @@
|
|||||||
|
|
||||||
// Package cors provides handlers to enable CORS support.
|
// Package cors provides handlers to enable CORS support.
|
||||||
// Usage
|
// Usage
|
||||||
//
|
|
||||||
// import (
|
// import (
|
||||||
// "github.com/astaxie/beego"
|
// "github.com/astaxie/beego"
|
||||||
// "github.com/astaxie/beego/plugins/cors"
|
// "github.com/astaxie/beego/plugins/cors"
|
||||||
// )
|
// )
|
||||||
|
//
|
||||||
//func main() {
|
// func main() {
|
||||||
// // CORS for https://foo.* origins, allowing:
|
// // CORS for https://foo.* origins, allowing:
|
||||||
// // - PUT and PATCH methods
|
// // - PUT and PATCH methods
|
||||||
// // - Origin header
|
// // - Origin header
|
||||||
@ -33,7 +32,7 @@
|
|||||||
// AllowCredentials: true,
|
// AllowCredentials: true,
|
||||||
// }))
|
// }))
|
||||||
// beego.Run()
|
// beego.Run()
|
||||||
//}
|
// }
|
||||||
package cors
|
package cors
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
// Package cors provides handlers to enable CORS support.
|
|
||||||
package cors
|
package cors
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
17
router.go
17
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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package beego
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -65,12 +88,12 @@ func (rs *MemcacheSessionStore) Flush() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// get redis session id
|
// get memcache session id
|
||||||
func (rs *MemcacheSessionStore) SessionID() string {
|
func (rs *MemcacheSessionStore) SessionID() string {
|
||||||
return rs.sid
|
return rs.sid
|
||||||
}
|
}
|
||||||
|
|
||||||
// save session values to redis
|
// save session values to memcache
|
||||||
func (rs *MemcacheSessionStore) SessionRelease(w http.ResponseWriter) {
|
func (rs *MemcacheSessionStore) SessionRelease(w http.ResponseWriter) {
|
||||||
b, err := session.EncodeGob(rs.values)
|
b, err := session.EncodeGob(rs.values)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -80,7 +103,7 @@ func (rs *MemcacheSessionStore) SessionRelease(w http.ResponseWriter) {
|
|||||||
client.Set(&item)
|
client.Set(&item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// redis session provider
|
// memcahe session provider
|
||||||
type MemProvider struct {
|
type MemProvider struct {
|
||||||
maxlifetime int64
|
maxlifetime int64
|
||||||
conninfo []string
|
conninfo []string
|
||||||
@ -88,7 +111,7 @@ type MemProvider struct {
|
|||||||
password string
|
password string
|
||||||
}
|
}
|
||||||
|
|
||||||
// init redis session
|
// init memcache session
|
||||||
// savepath like
|
// savepath like
|
||||||
// e.g. 127.0.0.1:9090
|
// e.g. 127.0.0.1:9090
|
||||||
func (rp *MemProvider) SessionInit(maxlifetime int64, savePath string) error {
|
func (rp *MemProvider) SessionInit(maxlifetime int64, savePath string) error {
|
||||||
@ -98,7 +121,7 @@ func (rp *MemProvider) SessionInit(maxlifetime int64, savePath string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// read redis session by sid
|
// read memcache session by sid
|
||||||
func (rp *MemProvider) SessionRead(sid string) (session.SessionStore, error) {
|
func (rp *MemProvider) SessionRead(sid string) (session.SessionStore, error) {
|
||||||
if client == nil {
|
if client == nil {
|
||||||
if err := rp.connectInit(); err != nil {
|
if err := rp.connectInit(); err != nil {
|
||||||
@ -123,7 +146,7 @@ func (rp *MemProvider) SessionRead(sid string) (session.SessionStore, error) {
|
|||||||
return rs, nil
|
return rs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// check redis session exist by sid
|
// check memcache session exist by sid
|
||||||
func (rp *MemProvider) SessionExist(sid string) bool {
|
func (rp *MemProvider) SessionExist(sid string) bool {
|
||||||
if client == nil {
|
if client == nil {
|
||||||
if err := rp.connectInit(); err != 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) {
|
func (rp *MemProvider) SessionRegenerate(oldsid, sid string) (session.SessionStore, error) {
|
||||||
if client == nil {
|
if client == nil {
|
||||||
if err := rp.connectInit(); err != nil {
|
if err := rp.connectInit(); err != nil {
|
||||||
@ -177,7 +200,7 @@ func (rp *MemProvider) SessionRegenerate(oldsid, sid string) (session.SessionSto
|
|||||||
return rs, nil
|
return rs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete redis session by id
|
// delete memcache session by id
|
||||||
func (rp *MemProvider) SessionDestroy(sid string) error {
|
func (rp *MemProvider) SessionDestroy(sid string) error {
|
||||||
if client == nil {
|
if client == nil {
|
||||||
if err := rp.connectInit(); err != nil {
|
if err := rp.connectInit(); err != nil {
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
package session
|
// 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:
|
// mysql session support need create table as sql:
|
||||||
// CREATE TABLE `session` (
|
// CREATE TABLE `session` (
|
||||||
// `session_key` char(64) NOT NULL,
|
// `session_key` char(64) NOT NULL,
|
||||||
@ -16,6 +25,20 @@ package session
|
|||||||
// `session_expiry` int(11) unsigned NOT NULL,
|
// `session_expiry` int(11) unsigned NOT NULL,
|
||||||
// PRIMARY KEY (`session_key`)
|
// PRIMARY KEY (`session_key`)
|
||||||
// ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
// ) 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 (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
@ -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
|
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 (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -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
|
package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -17,7 +40,7 @@ import (
|
|||||||
|
|
||||||
"github.com/astaxie/beego/session"
|
"github.com/astaxie/beego/session"
|
||||||
|
|
||||||
"github.com/beego/redigo/redis"
|
"github.com/garyburd/redigo/redis"
|
||||||
)
|
)
|
||||||
|
|
||||||
var redispder = &RedisProvider{}
|
var redispder = &RedisProvider{}
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
//
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// @authors astaxie
|
// 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
|
package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user