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

modify struc

This commit is contained in:
xiemengjun
2012-03-30 23:48:36 +08:00
parent 446daaea37
commit 2121c4dd88
5 changed files with 70 additions and 89 deletions

View File

@ -1,7 +1,13 @@
package beego
import "./core"
import {
"net"
"net/http"
"net/http/fcgi"
"log"
"strconv"
"./core"
}
type C struct {
core.Content
}
@ -24,4 +30,29 @@ type A struct{
type V struct{
core.View
}
type BeegoApp struct{
Port int
}
func (app *BeegoApp) BeeListen(port int) {
app.Port = port
err := http.ListenAndServe(":"+strconv.Itoa(app.Port), nil)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}
func (app *BeegoApp) BeeListenFcgi(port int) {
app.Port = port
l, err := net.Listen("tcp", "127.0.0.1:"+strconv.Itoa(port))
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
fcgi.Serve(l, app.Handler)
}
func Run() {
rootPath, _ := os.Getwd()
}