atrestful

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 atrestful provides a tracing and panic/exception reporting filter for for the go-restful framework.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(o ...Option) restful.FilterFunction

Filter returns a new restful.Filter for tracing requests and recovering and reporting panics to Atatus.

By default, the filter will use atatus.DefaultTracer. Use WithTracer to specify an alternative tracer.

Example
package main

import (
	restful "github.com/emicklei/go-restful"

	"go.atatus.com/agent/module/atrestful"
)

func main() {
	// Install the filter into the default/global Container.
	restful.Filter(atrestful.Filter())
}
Output:

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