Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertGenerator ¶
type CertGenerator struct {
Hosts []string
Organization string
NotBefore time.Time
NotAfter time.Time
CACertFile string
CAKeyFile string
ServerCertFile string
ServerKeyFile string
}
CertGenerator generates CA and server certificates for serving HTTPS.
func (*CertGenerator) Generate ¶
func (g *CertGenerator) Generate() error
Generate creates the certificate files.
type Server ¶
type Server struct {
// Binding address for serving HTTP.
Addr string
// Binding address for serving HTTPS.
AddrTLS string
// Certificate file for HTTPS
CertFile string
// Private key file for HTTPS
KeyFile string
// When an error happens while serving (e.g. binding of port fails), this
// error is sent to the channel ServeErr.
ServeErr chan<- error
// Default logger is "http-server", if not specified
Log logging.Logger
// contains filtered or unexported fields
}
Server is a plain http.Server with some usefull additions. The http.DefaultServeMux is used for the handlers.
type SingleAuthHandler ¶
type SingleAuthHandler struct {
http.Handler
User string
Password string
// Realm must only contain valid characters for an HTTP header value and no
// double quotes.
Realm string
}
SingleAuthHandler wraps another http.Handler and forces the specified authentication from the HTTP client.
func (*SingleAuthHandler) ServeHTTP ¶
func (h *SingleAuthHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.