middleware

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BugsnagMiddleware

func BugsnagMiddleware(router http.Handler, config BugsnagConfig) http.Handler

BugsnagMiddleware configures and wraps bugsnag handler around the router

func MetricCollectorMiddleware added in v0.1.8

func MetricCollectorMiddleware(handler httprouter.Handle, path string, config Config) httprouter.Handle

MetricCollectorMiddleware Creates and starts Metric Collector middlware

func MetricCollectorNoticeError added in v0.1.8

func MetricCollectorNoticeError(err error)

MetricCollectorNoticeError Send error to newrelic

Types

type BugsnagConfig

type BugsnagConfig struct {
	APIKey              string
	ReleaseStage        string
	AppType             string
	AppVersion          string
	ProjectPackages     []string
	NotifyReleaseStages []string
	ParamsFilters       []string
	PanicHandler        func()
}

BugsnagConfig bugsnag config

type Config added in v0.1.8

type Config struct {
	Enabled         bool
	Newrelic        bool
	AppName         string
	License         string
	Labels          map[string]string
	HostDisplayName string
}

Config Metric Collector config

type DataStore added in v0.1.8

type DataStore struct {
	Product            string
	Collection         string
	Operation          string
	ParameterizedQuery string
	QueryParameters    map[string]interface{}
	Host               string
	PortPathOrID       string
	DatabaseName       string
}

DataStore Metric Collector datastore

type MetricCollector added in v0.1.8

type MetricCollector struct {
	NewrelicApp newrelic.Application
}

MetricCollector Middleware with list of metric collectors to use

func GetMetricCollector added in v0.1.8

func GetMetricCollector(config Config) (MetricCollector, error)

GetMetricCollector creates and returns new metric collector

type MetricCollectorDatastoreSegment added in v0.1.8

type MetricCollectorDatastoreSegment struct {
	NewrelicDatastoreSegment *newrelic.DatastoreSegment
}

MetricCollectorDatastoreSegment Metric Collector datastore segment

func StartMetricCollectorDataStoreSegment added in v0.1.8

func StartMetricCollectorDataStoreSegment(txnID string, txnName string, datastore DataStore, w http.ResponseWriter, r *http.Request) MetricCollectorDatastoreSegment

StartMetricCollectorDataStoreSegment Starts and retuns a metric collector datastore segment for a transaction

type MetricCollectorSegment added in v0.1.8

type MetricCollectorSegment struct {
	NewrelicSegment *newrelic.Segment
}

MetricCollectorSegment Metric Collector segment

func StartMetricCollectorSegment added in v0.1.8

func StartMetricCollectorSegment(txnID string, txnName string, segmentName string, w http.ResponseWriter, r *http.Request) MetricCollectorSegment

StartMetricCollectorSegment Starts and retuns a metric collector segment for a transaction

type MetricCollectorTxn added in v0.1.8

type MetricCollectorTxn struct {
	NewrelicTxn newrelic.Transaction
}

MetricCollectorTxn Metric Collector transaction

func GetMetricCollectorTransaction added in v0.1.8

func GetMetricCollectorTransaction(txnID string, txnName string, w http.ResponseWriter, r *http.Request) MetricCollectorTxn

GetMetricCollectorTransaction returns new or existing metric collector transanction

type MiddlewareConfig

type MiddlewareConfig struct {
	Bugsnag  BugsnagConfig
	Newrelic NewrelicConfig
}

MiddlewareConfig middleware config

Jump to

Keyboard shortcuts

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