From afebcd891ec1f3b7cb0299307f35f8dd4d760ac8 Mon Sep 17 00:00:00 2001 From: xiemengjun Date: Sat, 15 Dec 2012 23:51:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=80=81=E7=9A=84=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 0 -> 6148 bytes beego/beego.go | 58 ------------- beego/cache/memcache.go | 0 beego/core/acl.go | 0 beego/core/controller.go | 19 ---- beego/core/model.go | 0 beego/core/router.go | 144 ------------------------------- beego/core/view.go | 0 beego/helper/config.go | 28 ------ beego/helper/page.go | 0 beego/orm/activerecord.go | 0 beego/server/fcgi.go | 0 beego/server/server.go | 14 --- examples/blog/blog.go | 18 ---- examples/blog/configs/app.yaml | 6 -- examples/blog/controller/user.go | 11 --- examples/blog/model/user.go | 14 --- examples/hello/hello.go | 14 --- tools/generator.go | 0 tools/scaffolding.go | 0 20 files changed, 326 deletions(-) create mode 100644 .DS_Store delete mode 100644 beego/beego.go delete mode 100644 beego/cache/memcache.go delete mode 100644 beego/core/acl.go delete mode 100644 beego/core/controller.go delete mode 100644 beego/core/model.go delete mode 100644 beego/core/router.go delete mode 100644 beego/core/view.go delete mode 100644 beego/helper/config.go delete mode 100644 beego/helper/page.go delete mode 100644 beego/orm/activerecord.go delete mode 100644 beego/server/fcgi.go delete mode 100644 beego/server/server.go delete mode 100644 examples/blog/blog.go delete mode 100644 examples/blog/configs/app.yaml delete mode 100644 examples/blog/controller/user.go delete mode 100644 examples/blog/model/user.go delete mode 100644 examples/hello/hello.go delete mode 100644 tools/generator.go delete mode 100644 tools/scaffolding.go diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 0 { - - // make sure the extensions match too - return strings.HasSuffix(strings.ToLower(path), strings.ToLower(route.extension)) - - } else { - return match - } - - } else { - - return false - - } - - } - - // error :-( - return false - -} - -// Checks whether the context for this request matches the route -func (route *Route) DoesMatchContext(c *Context) bool { - - // by default, we match - var match bool = true - - if len(route.MatcherFuncs) > 0 { - - // there are some matcher functions, so don't automatically - // match by default - let the matchers decide - match = false - - // loop through the matcher functions - for _, f := range route.MatcherFuncs { - - // modify 'match' based on the result of the matcher function - switch f(c) { - case NoMatch: - match = false - case Match: - match = true - } - - } - - } - - // return the result - return match - -} \ No newline at end of file diff --git a/beego/core/view.go b/beego/core/view.go deleted file mode 100644 index e69de29b..00000000 diff --git a/beego/helper/config.go b/beego/helper/config.go deleted file mode 100644 index 13f315b2..00000000 --- a/beego/helper/config.go +++ /dev/null @@ -1,28 +0,0 @@ -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]; -} \ No newline at end of file diff --git a/beego/helper/page.go b/beego/helper/page.go deleted file mode 100644 index e69de29b..00000000 diff --git a/beego/orm/activerecord.go b/beego/orm/activerecord.go deleted file mode 100644 index e69de29b..00000000 diff --git a/beego/server/fcgi.go b/beego/server/fcgi.go deleted file mode 100644 index e69de29b..00000000 diff --git a/beego/server/server.go b/beego/server/server.go deleted file mode 100644 index e5fd1a2d..00000000 --- a/beego/server/server.go +++ /dev/null @@ -1,14 +0,0 @@ -package server - -import ( - "bufio" - "bytes" - "errors" - "io" - "log" - "net" - "net/url" - "runtime/debug" - "strconv" - "strings" -) \ No newline at end of file diff --git a/examples/blog/blog.go b/examples/blog/blog.go deleted file mode 100644 index 6c030ce4..00000000 --- a/examples/blog/blog.go +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2011 Google Inc. All rights reserved. -// Use of this source code is governed by the Apache 2.0 -// license that can be found in the LICENSE file. - -package guestbook - -import ( - "../../beego" -) - -func init() { - beego.C.loadconfig() -} - -func main() { - app:=beego.App - app.Run() -} \ No newline at end of file diff --git a/examples/blog/configs/app.yaml b/examples/blog/configs/app.yaml deleted file mode 100644 index 0107267a..00000000 --- a/examples/blog/configs/app.yaml +++ /dev/null @@ -1,6 +0,0 @@ -application: blog -handlers: -- url: "/user" - handlefun:"user.Index" -- url: "/blog" - handlefun:"blog.Index" \ No newline at end of file diff --git a/examples/blog/controller/user.go b/examples/blog/controller/user.go deleted file mode 100644 index 61ad5756..00000000 --- a/examples/blog/controller/user.go +++ /dev/null @@ -1,11 +0,0 @@ -package controller - -import ( - "github.com/astaxie/beego/beego" - "../model" -) - -func UserIndex(w beego.A) { - userinfo :=model.User.getAll() - beego.V.Render(w,"users/index") -} \ No newline at end of file diff --git a/examples/blog/model/user.go b/examples/blog/model/user.go deleted file mode 100644 index ad37141c..00000000 --- a/examples/blog/model/user.go +++ /dev/null @@ -1,14 +0,0 @@ -package model -import ( - "./beego" -) - -type Users struct { - username string - password string - beego.M -} - -func NewUsers() (a *Users) { - return &Users{} -} \ No newline at end of file diff --git a/examples/hello/hello.go b/examples/hello/hello.go deleted file mode 100644 index e2f83b5e..00000000 --- a/examples/hello/hello.go +++ /dev/null @@ -1,14 +0,0 @@ -package helloworld - -import ( - "fmt" - "net/http" -) - -func init() { - http.HandleFunc("/", handle) -} - -func handle(w http.ResponseWriter, r *http.Request) { - fmt.Fprint(w, "Hello, World! 세상아 안녕!") -} diff --git a/tools/generator.go b/tools/generator.go deleted file mode 100644 index e69de29b..00000000 diff --git a/tools/scaffolding.go b/tools/scaffolding.go deleted file mode 100644 index e69de29b..00000000