newrelic

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigDefault = MiddlewareConfig{
	Next:        nil,
	NewRelicApp: &newrelic.Application{},
}

ConfigDefault is the default config

View Source
var ProviderSet = wire.NewSet(New)

Functions

func NewMiddleware

func NewMiddleware(config ...MiddlewareConfig) fiber.Handler

NewMiddleware creates a new middleware handler

Types

type App

type App struct {
	// contains filtered or unexported fields
}

func New

func New(c *config.AppConfig, zap *zap.Logger) (*App, error)

func (*App) Application

func (a *App) Application() *newrelic.Application

func (*App) NewContext

func (a *App) NewContext(ctx context.Context, nxt *newrelic.Transaction) context.Context

func (*App) StartTransaction

func (a *App) StartTransaction(name string) *newrelic.Transaction

type MiddlewareConfig

type MiddlewareConfig struct {
	// Next defines a function to skip this middleware when returned true.
	//
	// Optional. Default: nil
	Next func(c *fiber.Ctx) bool

	// NewRelicApp is newrelic.Application
	//
	// Required. Default: empty Application
	NewRelicApp *newrelic.Application
}

MiddlewareConfig defines the config for middleware.

type ResponseWriter

type ResponseWriter struct {
	// contains filtered or unexported fields
}

ResponseWriter imitates http.ResponseWriter

func (*ResponseWriter) Header

func (rw *ResponseWriter) Header() http.Header

Header implementation

func (*ResponseWriter) Write

func (rw *ResponseWriter) Write(p []byte) (int, error)

Write implementation

func (*ResponseWriter) WriteHeader

func (rw *ResponseWriter) WriteHeader(statusCode int)

WriteHeader implementation

Jump to

Keyboard shortcuts

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