Documentation ¶
Index ¶
- type ResponseWriterProxy
- func (p *ResponseWriterProxy) Flush()
- func (p *ResponseWriterProxy) Header() http.Header
- func (p *ResponseWriterProxy) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (p *ResponseWriterProxy) Response() *http.Response
- func (p *ResponseWriterProxy) Write(buf []byte) (int, error)
- func (p *ResponseWriterProxy) WriteHeader(code int)
- type Server
- type ServerCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResponseWriterProxy ¶
type ResponseWriterProxy struct {
// contains filtered or unexported fields
}
ResponseWriterProxy records the written response
func NewWriterProxy ¶
func NewWriterProxy(w http.ResponseWriter) *ResponseWriterProxy
NewWriterProxy returns a proxy
func (*ResponseWriterProxy) Flush ¶
func (p *ResponseWriterProxy) Flush()
Flush inmplements http.Flusher
func (*ResponseWriterProxy) Header ¶
func (p *ResponseWriterProxy) Header() http.Header
Header implements http.ResponseWriter
func (*ResponseWriterProxy) Hijack ¶
func (p *ResponseWriterProxy) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack is a wrapper of http.Hijacker underearth if any, otherwise it just returns an error. from https://github.com/mholt/caddy/pull/134
func (*ResponseWriterProxy) Response ¶
func (p *ResponseWriterProxy) Response() *http.Response
Response returns the writer as a http.Response
func (*ResponseWriterProxy) Write ¶
func (p *ResponseWriterProxy) Write(buf []byte) (int, error)
Write implements http.ResponseWriter
func (*ResponseWriterProxy) WriteHeader ¶
func (p *ResponseWriterProxy) WriteHeader(code int)
WriteHeader implements http.ResponseWriter
type Server ¶
type Server struct { DocumentRoot string Callback ServerCallback Port int PreferredPort int PKCS12 string AllowHTTP bool Logger zerolog.Logger Appversion string UseGzip bool TlsKeyLogFile string // contains filtered or unexported fields }
Server represents a server
func (*Server) Handler ¶
func (s *Server) Handler(w http.ResponseWriter, r *http.Request)
Handler handles HTTP requests
func (*Server) ProxyHandler ¶
func (s *Server) ProxyHandler(w http.ResponseWriter, r *http.Request)
ProxyHandler wraps the regular handler to log the HTTP messages
type ServerCallback ¶
ServerCallback serves non-static HTTP resources
Click to show internal directories.
Click to hide internal directories.