Documentation ¶
Index ¶
- func AcceptRequests(logger *zap.Logger, next httprouter.Handle) httprouter.Handle
- func CORS(next httprouter.Handle) httprouter.Handle
- func Chain(handler httprouter.Handle, ...) httprouter.Handle
- func PanicRecovery(logger *zap.Logger, next httprouter.Handle) httprouter.Handle
- func PrivacyPolicy(uri string, next httprouter.Handle) httprouter.Handle
- func SecureHeader(next httprouter.Handle) httprouter.Handle
- func UserAgent(logger *zap.Logger, next httprouter.Handle) httprouter.Handle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptRequests ¶
func AcceptRequests(logger *zap.Logger, next httprouter.Handle) httprouter.Handle
AcceptRequests returns a 405 Method Not Allowed if the request method is not GET, HEAD, or OPTIONS.
func CORS ¶
func CORS(next httprouter.Handle) httprouter.Handle
CORS adds CORS headers to the response.
func Chain ¶
func Chain(handler httprouter.Handle, middlewares ...func(httprouter.Handle) httprouter.Handle) httprouter.Handle
Chain wraps a given http.Handler with middlewares.
func PanicRecovery ¶
func PanicRecovery(logger *zap.Logger, next httprouter.Handle) httprouter.Handle
PanicRecovery tries to recover from panics and returns a 500 error if there was one.
func PrivacyPolicy ¶
func PrivacyPolicy(uri string, next httprouter.Handle) httprouter.Handle
PrivacyPolicy adds a privacy policy header to the response.
func SecureHeader ¶
func SecureHeader(next httprouter.Handle) httprouter.Handle
SecureHeader adds basic security headers to the response.
func UserAgent ¶
func UserAgent(logger *zap.Logger, next httprouter.Handle) httprouter.Handle
UserAgent ensures that the request has a valid user agent.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.