mirror of
https://github.com/astaxie/beego.git
synced 2025-06-13 11:10:40 +00:00
modify struc
This commit is contained in:
@ -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()
|
||||
}
|
Reference in New Issue
Block a user