red

package
v0.0.0-...-ff1b721 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultErrorInterpreter

func DefaultErrorInterpreter(err error) (string, bool)

func GRPCErrorInterpreter

func GRPCErrorInterpreter(err error) (string, bool)

func HTTPErrorInterpreter

func HTTPErrorInterpreter(err error) (string, bool)

Types

type ConfigFunc

type ConfigFunc func(r *config)

func WithLogger

func WithLogger(logger base.Logger) ConfigFunc

func WithPrefixConfig

func WithPrefixConfig(prefix string, prefixConfig *PrefixConfig) ConfigFunc

func WithPrefixConfigs

func WithPrefixConfigs(prefixConfigs map[string]*PrefixConfig) ConfigFunc

type ErrorInterpreter

type ErrorInterpreter func(err error) (string, bool)

func NewMultiErrorInterpreter

func NewMultiErrorInterpreter(interpreters ...ErrorInterpreter) ErrorInterpreter

type HTTPStatusError

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

func NewHTTPStatusError

func NewHTTPStatusError(code int, message string, args ...interface{}) *HTTPStatusError

func (*HTTPStatusError) Code

func (e *HTTPStatusError) Code() int

func (*HTTPStatusError) Error

func (e *HTTPStatusError) Error() string

type PrefixConfig

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

func NewPrefixConfig

func NewPrefixConfig(configs ...PrefixConfigFunc) *PrefixConfig

type PrefixConfigFunc

type PrefixConfigFunc func(r *PrefixConfig)

func WithPrefixBuckets

func WithPrefixBuckets(buckets []float64) PrefixConfigFunc

func WithPrefixErrorInterpreter

func WithPrefixErrorInterpreter(errorInterpreter ErrorInterpreter) PrefixConfigFunc

func WithPrefixReportConfigs

func WithPrefixReportConfigs(configs ...base.ConfigFunc) PrefixConfigFunc

type Reporter

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

func NewReporter

func NewReporter(reporter base.Reporter, configs ...ConfigFunc) *Reporter

func (*Reporter) Register

func (r *Reporter) Register()

func (*Reporter) ReportDuration

func (r *Reporter) ReportDuration(prefix string, duration float64, configs ...base.ConfigFunc)

func (*Reporter) ReportError

func (r *Reporter) ReportError(prefix string, err error, configs ...base.ConfigFunc)

func (*Reporter) ReportRequest

func (r *Reporter) ReportRequest(prefix string, configs ...base.ConfigFunc)

Jump to

Keyboard shortcuts

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