mirror of
https://github.com/astaxie/beego.git
synced 2025-06-13 11:00:41 +00:00
modify struct
This commit is contained in:
7
beego/beego.go
Normal file
7
beego/beego.go
Normal file
@ -0,0 +1,7 @@
|
||||
package beego
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main(){
|
||||
fmt.Printf("hello world")
|
||||
}
|
0
beego/cache/memcache.go
vendored
Normal file
0
beego/cache/memcache.go
vendored
Normal file
0
beego/core/acl.go
Normal file
0
beego/core/acl.go
Normal file
0
beego/core/controller.go
Normal file
0
beego/core/controller.go
Normal file
0
beego/core/model.go
Normal file
0
beego/core/model.go
Normal file
0
beego/core/router.go
Normal file
0
beego/core/router.go
Normal file
0
beego/core/view.go
Normal file
0
beego/core/view.go
Normal file
28
beego/helper/config.go
Normal file
28
beego/helper/config.go
Normal file
@ -0,0 +1,28 @@
|
||||
package helper
|
||||
|
||||
import (
|
||||
"json"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
)
|
||||
|
||||
var config map[string]string
|
||||
|
||||
func ReadConfig(filename string) {
|
||||
contents, err := ioutil.ReadFile(filename)
|
||||
if err != nil {
|
||||
log.Exitf("Impossible to read %s", filename, err)
|
||||
}
|
||||
data, err := json.Decode(string(contents))
|
||||
if err != nil {
|
||||
log.Exitf("Can't parse %s as JSON", filename, err)
|
||||
}
|
||||
config = map[string]string{ }
|
||||
for key, value := range data.(map[string]interface{ }) {
|
||||
config[key] = value.(string)
|
||||
}
|
||||
}
|
||||
|
||||
func GetConfig(key string) string {
|
||||
return config[key];
|
||||
}
|
0
beego/helper/page.go
Normal file
0
beego/helper/page.go
Normal file
BIN
beego/orm/.DS_Store
vendored
Normal file
BIN
beego/orm/.DS_Store
vendored
Normal file
Binary file not shown.
0
beego/orm/activerecord.go
Normal file
0
beego/orm/activerecord.go
Normal file
0
beego/server/fcgi.go
Normal file
0
beego/server/fcgi.go
Normal file
Reference in New Issue
Block a user