http

package
v5.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Notifier *gobrake.Notifier
}

A Handler is an HTTP middleware that provides integration with Airbrake.

func New

func New(notifier *gobrake.Notifier) *Handler

New returns a new Handler. Use the Handler and HandleFunc methods to wrap existing HTTP handlers.

func (*Handler) Handle

func (h *Handler) Handle(handler http.Handler) http.Handler

Handle works as a middleware that wraps an existing http.Handler and sends route performance stats

func (*Handler) HandleFunc

func (h *Handler) HandleFunc(handler http.HandlerFunc) http.HandlerFunc

HandleFunc is like Handler, but with a handler function parameter for cases where that is convenient. In particular, use it to wrap a handler function literal.

http.Handle(pattern, h.HandleFunc(func (w http.ResponseWriter, r *http.Request) {
    // handler code here
}))

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL