Documentation
¶
Index ¶
- func SplitHostPort(addr string) (host string, port int, err error)
- type Server
- func (s *Server) Fatalf(f string, args ...interface{})
- func (s *Server) GetHandler() http.Handler
- func (s *Server) HTTPListener() (net.Listener, error)
- func (s *Server) Listen() error
- func (s *Server) Logf(f string, args ...interface{})
- func (s *Server) Serve() (err error)
- func (s *Server) SetHandler(handler http.Handler)
- func (s *Server) Shutdown() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct {
EnabledListeners []string //the listeners to enable
CleanupTimeout time.Duration //grace period for which to wait before shutting down the server
MaxHeaderSize int //controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line
SocketPath string //the unix socket to listen on" default:"/var/run/server.sock"
Host string //the IP to listen on" default:"localhost" env:"HOST"
Port int //the port to listen on for insecure connections, defaults to a random value" env:"PORT"
KeepAlive time.Duration //sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections
ReadTimeout time.Duration //maximum duration before timing out read of the request"
WriteTimeout time.Duration //maximum duration before timing out write of the response"
Logger func(string, ...interface{})
// contains filtered or unexported fields
}
Options taken from swagger docs
func (*Server) Fatalf ¶
Fatalf logs message either via defined user logger or via system one if no user logger is defined. Exits with non-zero status after printing
func (*Server) GetHandler ¶
GetHandler returns a handler useful for testing
func (*Server) HTTPListener ¶
HTTPListener returns the http listener
func (*Server) Logf ¶
Logf logs message either via defined user logger or via system one if no user logger is defined.
func (*Server) SetHandler ¶
SetHandler allows for setting a http handler on this server
Click to show internal directories.
Click to hide internal directories.