You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

30 lines
1.4 KiB

  1. // Package handlers define reusable handler components that focus on offering
  2. // a single well-defined feature. Note that any http.Handler implementation
  3. // can be used with Ghost's chainable or wrappable handlers design.
  4. //
  5. // Go's standard library provides a number of such useful handlers in net/http:
  6. //
  7. // - FileServer(http.FileSystem)
  8. // - NotFoundHandler()
  9. // - RedirectHandler(string, int)
  10. // - StripPrefix(string, http.Handler)
  11. // - TimeoutHandler(http.Handler, time.Duration, string)
  12. //
  13. // This package adds the following list of handlers:
  14. //
  15. // - BasicAuthHandler(http.Handler, func(string, string) (interface{}, bool), string)
  16. // a Basic Authentication handler.
  17. // - ContextHandler(http.Handler, int) : a volatile storage map valid only
  18. // for the duration of the request, with no locking required.
  19. // - FaviconHandler(http.Handler, string, time.Duration) : an efficient favicon
  20. // handler.
  21. // - GZIPHandler(http.Handler) : compress the content of the body if the client
  22. // accepts gzip compression.
  23. // - LogHandler(http.Handler, *LogOptions) : customizable request logger.
  24. // - PanicHandler(http.Handler) : handle panics gracefully so that the client
  25. // receives a response (status code 500).
  26. // - SessionHandler(http.Handler, *SessionOptions) : a cookie-based, store-agnostic
  27. // persistent session handler.
  28. // - StaticFileHandler(string) : serve the contents of a specific file.
  29. package handlers