atbeego

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package atbeego provides tracing and error-reporting middleware for Beego applications.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFilters

func AddFilters(handlers *beego.ControllerRegister)

AddFilters adds required filters to handlers.

This is called automatically for the default app (beego.BeeApp), so if you beego.Router, beego.RunWithMiddleware, etc., then you do not need to call AddFilters.

func Middleware

func Middleware(o ...Option) func(http.Handler) http.Handler

Middleware returns a beego.MiddleWare that traces requests and reports panics to Atatus.

Example
beego.Router("/", &testController{})
beego.Router("/thing/:id:int", &testController{}, "get:Get")
beego.RunWithMiddleWares("localhost:8080", atbeego.Middleware())
Output:

func WrapRecoverFunc

func WrapRecoverFunc(config *beego.Config)

WrapRecoverFunc updates config's RecoverFunc so that panics will be reported to Atatus for traced requests. For non-traced requests, the original RecoverFunc will be called.

WrapRecoverFunc is called automatically for the global config, beego.BConfig.

Types

type Option

type Option func(*options)

Option sets options for tracing.

func WithTracer

func WithTracer(t *atatus.Tracer) Option

WithTracer returns an Option which sets t as the tracer to use for tracing server requests.

Jump to

Keyboard shortcuts

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