Documentation ¶
Index ¶
- Variables
- func HealthHandler(w http.ResponseWriter, _ *http.Request)
- type HTTPServer
- func (s *HTTPServer) Address() string
- func (s *HTTPServer) Running() bool
- func (s *HTTPServer) SetupHandler(path string, handler http.Handler)
- func (s *HTTPServer) Shutdown() error
- func (s *HTTPServer) Start() error
- func (s *HTTPServer) StartAndAnnounce(name string) error
- func (s *HTTPServer) Stopped() bool
- type SSLConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Host is a default bind address for HTTP servers Host string = "localhost" // SSL is a default configuration for HTTP servers SSL *SSLConfig // MaxConn is a default configuration for maximum connections MaxConn int )
Functions ¶
func HealthHandler ¶ added in v1.0.1
func HealthHandler(w http.ResponseWriter, _ *http.Request)
HealthHandler always reponds with 200 status
Types ¶
type HTTPServer ¶
type HTTPServer struct {
// contains filtered or unexported fields
}
HTTPServer is wrapper over http.Server
func ForPort ¶ added in v1.0.1
func ForPort(port string) (*HTTPServer, error)
ForPort creates new or returns the existing server for the specified port
func (*HTTPServer) Address ¶
func (s *HTTPServer) Address() string
Address returns server scheme://host:port
func (*HTTPServer) Running ¶ added in v1.0.1
func (s *HTTPServer) Running() bool
Running returns true if server has been started
func (*HTTPServer) SetupHandler ¶ added in v1.3.0
func (s *HTTPServer) SetupHandler(path string, handler http.Handler)
SetupHandler adds new handler to mux
func (*HTTPServer) Shutdown ¶ added in v1.1.0
func (s *HTTPServer) Shutdown() error
Shutdown shuts down server gracefully.
func (*HTTPServer) StartAndAnnounce ¶ added in v1.0.1
func (s *HTTPServer) StartAndAnnounce(name string) error
StartAndAnnounce prints server info and starts server
func (*HTTPServer) Stopped ¶
func (s *HTTPServer) Stopped() bool
Stopped return true iff server has been stopped by user
type SSLConfig ¶ added in v1.0.1
SSLConfig contains SSL parameters
func NewSSLConfig ¶ added in v1.0.1
func NewSSLConfig() SSLConfig
NewSSLConfig build a new SSLConfig struct
Click to show internal directories.
Click to hide internal directories.