Documentation
¶
Overview ¶
Description: http://grisha.org/blog/2014/06/03/graceful-restart-in-golang/
Usage:
import(
"log" "net/http" "os" "github.com/astaxie/beego/grace"
)
func handler(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("WORLD!"))
}
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/hello", handler)
err := grace.ListenAndServe("localhost:8080", mux1)
if err != nil {
log.Println(err)
}
log.Println("Server on 8080 stopped")
os.Exit(0)
}
Index ¶
Constants ¶
View Source
const ( PRE_SIGNAL = iota POST_SIGNAL STATE_INIT STATE_RUNNING STATE_SHUTTING_DOWN STATE_TERMINATE )
Variables ¶
Functions ¶
func ListenAndServe ¶
refer http.ListenAndServe
func ListenAndServeTLS ¶
refer http.ListenAndServeTLS
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.