easyrecord

package
v1.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextRecords

func ContextRecords(key interface{}, factory record.Factory) record.Factory

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger *zap.Logger) context.Context

func DoWithContextRecords

func DoWithContextRecords(ctx context.Context, do func(ctx context.Context) error, actionName string, field ...record.Field) error

func DoWithRecords

func DoWithRecords(ctx context.Context, do func(ctx context.Context) error, factory record.Factory, actionName string, field ...record.Field) error

help function

func EasyRecorders

func EasyRecorders(desc string) record.Factory

func ExtraFromContext

func ExtraFromContext(ctx context.Context) record.Factory

func ExtraLoggerFromContext

func ExtraLoggerFromContext(ctx context.Context) *zap.Logger

func SetToContext

func SetToContext(ctx context.Context, factory record.Factory) context.Context

Types

type Factory

type Factory struct {
	Desc          string
	PromFactory   func() *PromFactory
	TracerFactory func() *TracerFactory
	LoggerFactory func() *LoggerFactory
}

func (Factory) Create

func (factory Factory) Create() record.Factory

type LoggerFactory

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

func NewLoggerRecorderFactory

func NewLoggerRecorderFactory(logger *zap.Logger, messageDesc string) *LoggerFactory

func (*LoggerFactory) ActionRecorder

func (factory *LoggerFactory) ActionRecorder(ctx context.Context, name string, fields ...record.Field) (record.Recorder, context.Context)

type LoggerRecorder

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

func (LoggerRecorder) Commit

func (recorder LoggerRecorder) Commit(err error, fields ...record.Field)

type PromFactory

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

func NewPromRecorderFactory

func NewPromRecorderFactory(name string, fields ...string) *PromFactory

func (*PromFactory) ActionRecorder

func (factory *PromFactory) ActionRecorder(ctx context.Context, name string, fields ...record.Field) (record.Recorder, context.Context)

type PromRecorder

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

func (PromRecorder) Commit

func (recorder PromRecorder) Commit(err error, fields ...record.Field)

type TracerFactory

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

func NewTracerFactory

func NewTracerFactory(tracer opentracing.Tracer) *TracerFactory

func (*TracerFactory) ActionRecorder

func (factory *TracerFactory) ActionRecorder(ctx context.Context, name string, fields ...record.Field) (record.Recorder, context.Context)

type TracerRecorder

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

func (TracerRecorder) Commit

func (recorder TracerRecorder) Commit(err error, fields ...record.Field)

Jump to

Keyboard shortcuts

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