Documentation ¶
Overview ¶
Package httpserver implements an HTTP server and utility routines to manage its lifecycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer is the object wrapper for FSM's HTTP server class
func NewHTTPServer ¶
func NewHTTPServer(port uint16) *HTTPServer
NewHTTPServer creates a new API server
func (*HTTPServer) AddHandler ¶
func (s *HTTPServer) AddHandler(url string, handler http.Handler)
AddHandler adds an HTTP handlers for the given path on the HTTPServer For changes to be effective, server requires restart
func (*HTTPServer) AddHandlers ¶
func (s *HTTPServer) AddHandlers(handlers map[string]http.Handler)
AddHandlers convenience, multi-value AddHandler
func (*HTTPServer) Start ¶
func (s *HTTPServer) Start() error
Start starts ListenAndServe on the http server. If already started, does nothing
func (*HTTPServer) Stop ¶
func (s *HTTPServer) Stop() error
Stop halts and resets the http server If server is already stopped, does nothing
Click to show internal directories.
Click to hide internal directories.