Documentation ¶
Index ¶
- Constants
- type HTTPServer
- func (s *HTTPServer) IsRunning() bool
- func (s *HTTPServer) PidFile() string
- func (s *HTTPServer) ProcessID() int
- func (s *HTTPServer) RealAddr() string
- func (s *HTTPServer) SetPidFile(pidFile string)
- func (s *HTTPServer) Shutdown(timeout int) error
- func (s *HTTPServer) Start() error
- func (s *HTTPServer) Stop(timeout int) error
Constants ¶
View Source
const ( OnBeforeRoute = "app.route.before" OnAfterRoute = "app.route.after" OnServerStart = "app.server.start" OnServerClose = "app.server.close" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer an HTTP web server
func NewHTTPServer ¶
func NewHTTPServer(address ...string) *HTTPServer
NewHTTPServer create new HTTPServer. Usage:
srv := NewHTTPServer("127.0.0.1") srv := NewHTTPServer("127.0.0.1:8090") srv := NewHTTPServer("127.0.0.1", "8090")
func (*HTTPServer) IsRunning ¶
func (s *HTTPServer) IsRunning() bool
IsRunning get server is running
func (*HTTPServer) RealAddr ¶
func (s *HTTPServer) RealAddr() string
RealAddr get resolved read addr
func (*HTTPServer) SetPidFile ¶
func (s *HTTPServer) SetPidFile(pidFile string)
SetPidFile set pid file path
func (*HTTPServer) Shutdown ¶
func (s *HTTPServer) Shutdown(timeout int) error
Shutdown from internal
func (*HTTPServer) Start ¶
func (s *HTTPServer) Start() error
Start server, begin handle HTTP request
func (*HTTPServer) Stop ¶
func (s *HTTPServer) Stop(timeout int) error
Stop by send signal to exists process
Click to show internal directories.
Click to hide internal directories.