Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(w http.ResponseWriter, logger errorLogger, err error, code int)
Error writes error response.
func InternalError ¶
func InternalError(w http.ResponseWriter, logger errorLogger)
InternalError responsds with unknown internal error.
func JSON ¶
func JSON(w http.ResponseWriter, logger errorLogger, response interface{}, code int)
JSON marshals objet as json and writes it to the response body.
Types ¶
type Config ¶
type Config struct { Addr string `yaml:"addr"` TLS *tlsConfig `yaml:"tls"` }
Config contains http server configuration values.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an HTTP server.
func NewServer ¶
NewServer creates a new HTTP server.
The handler can be nil, in which case http.DefaultServeMux is used.
Click to show internal directories.
Click to hide internal directories.