Documentation
¶
Overview ¶
Package server provides an http server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option provides options for configuring the creation of a http server.
func WithLogger ¶
WithServerLogger provides a logger to the server.
func WithShutdownTimeout ¶
WithShutdownTimeout sets the timout for shutting down the server.
type ResponseError ¶
type ResponseError struct {
// Status is the http status code applicable to this problem.
Status int `json:"status"`
// Detail is a human-readable explanation specific to this occurrence of
// the problem.
Detail string `json:"detail,omitempty"`
}
ResponseError provides additional information about problems encounted while performing an operation. See: https://jsonapi.org/format/#error-objects
swagger:response ResponseError
func (ResponseError) Error ¶
func (e ResponseError) Error() string
Error translates the error to a string.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an HTTP server.
func (*Server) Middleware ¶
func (s *Server) Middleware(mw ...mux.MiddlewareFunc)
Middleware installs the given middleware with the router.
type Service ¶
type Service interface {
// Register will register this service with the given router.
Register(router *mux.Router)
// Name provides the name of the service.
Name() string
// Shutdown allows the service to stop any long running background processes it
// may have.
Shutdown()
}
Service defines the methods required by the Server to register with the service with the router.
Click to show internal directories.
Click to hide internal directories.