middleware

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseLogger

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

BaseLogger middleware for logging

func NewLog

func NewLog(logger log.Logger) BaseLogger

NewLog constructor

func (BaseLogger) GetStFunc

func (mw BaseLogger) GetStFunc(err error) LogFunc

GetStFunc get a logger structured function function from base logger

type BaseMetrics

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

BaseMetrics middleware for logging

func NewMetrics

func NewMetrics(component string, sampleRate float64, client metrics.Client) BaseMetrics

NewMetrics constructor for base metrics middleware

func (BaseMetrics) GenerateMetrics

func (mw BaseMetrics) GenerateMetrics(begin time.Time, module, method, action string, err error)

GenerateMetrics API to automatically generate metrics for a given endpoint

type LogFunc

type LogFunc func(message string, fields loggo.Fields)

LogFunc defined type

func GetStFunc

func GetStFunc(err error, logger log.Logger) LogFunc

GetStFunc open function to get a logger function based on the error

Jump to

Keyboard shortcuts

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