Documentation ¶
Index ¶
- type Handler
- type HandlerOption
- func OptHandlerBind(b string) HandlerOption
- func OptHandlerCloseTimeout(d time.Duration) HandlerOption
- func OptHandlerComputer(handler http.Handler) HandlerOption
- func OptHandlerController(c *controller.Controller) HandlerOption
- func OptHandlerListener(ln net.Listener, url string) HandlerOption
- func OptHandlerLogger(l logger.Logger) HandlerOption
- func OptHandlerQueryer(q *queryer.Queryer) HandlerOption
- func OptHandlerSnapshotter(s *snapshotter.Snapshotter) HandlerOption
- func OptHandlerWritelogger(w *writelogger.Writelogger) HandlerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
Handler represents an HTTP handler.
func NewHandler ¶
func NewHandler(router http.Handler, opts ...HandlerOption) (*Handler, error)
NewHandler returns a new instance of Handler with a default logger.
type HandlerOption ¶
HandlerOption is a functional option type for Handler
func OptHandlerBind ¶
func OptHandlerBind(b string) HandlerOption
func OptHandlerCloseTimeout ¶
func OptHandlerCloseTimeout(d time.Duration) HandlerOption
OptHandlerCloseTimeout controls how long to wait for the http Server to shutdown cleanly before forcibly destroying it. Default is 30 seconds.
func OptHandlerComputer ¶
func OptHandlerComputer(handler http.Handler) HandlerOption
func OptHandlerController ¶ added in v3.30.0
func OptHandlerController(c *controller.Controller) HandlerOption
func OptHandlerListener ¶
func OptHandlerListener(ln net.Listener, url string) HandlerOption
OptHandlerListener set the listener that will be used by the HTTP server. Url must be the advertised URL. It will be used to show a log to the user about where the Web UI is. This option is mandatory.
func OptHandlerLogger ¶
func OptHandlerLogger(l logger.Logger) HandlerOption
func OptHandlerQueryer ¶
func OptHandlerQueryer(q *queryer.Queryer) HandlerOption
func OptHandlerSnapshotter ¶
func OptHandlerSnapshotter(s *snapshotter.Snapshotter) HandlerOption
func OptHandlerWritelogger ¶ added in v3.29.0
func OptHandlerWritelogger(w *writelogger.Writelogger) HandlerOption
Click to show internal directories.
Click to hide internal directories.