record

package
v0.5.0-beta2.12 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldTypeUnknown = 0
	FieldTypeNumber  = 1
	FieldTypeString  = 2
	FieldTypeBool    = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory interface {
	ActionRecorder(ctx context.Context, name string, fields ...Field) (Recorder, context.Context)
}

func ChainFactory

func ChainFactory(factorys ...Factory) Factory

func EasyRecorders

func EasyRecorders(desc string, factory ...Factory) Factory

type FactoryWrapper

type FactoryWrapper struct {
	Wrapper
	Factory Factory
}

func (FactoryWrapper) ActionRecorder

func (mr FactoryWrapper) ActionRecorder(ctx context.Context, name string, fields ...Field) (Recorder, context.Context)

type Field

type Field struct {
	Name   string
	Type   FieldType
	Number float64
	String string
}

func BoolField

func BoolField(name string, value bool) Field

func NumberField

func NumberField(name string, number float64) Field

func StringField

func StringField(name, value string) Field

func (Field) Bool

func (f Field) Bool() bool

func (Field) StringValue

func (f Field) StringValue() string

func (Field) Value

func (f Field) Value() interface{}

type FieldType

type FieldType uint8

type LoggerFactory

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

func NewLoggerRecorderFactory

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

func (*LoggerFactory) ActionRecorder

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

type LoggerRecorder

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

func (LoggerRecorder) Commit

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

type MaxDurationWrapper

type MaxDurationWrapper struct {
	MaxDuration time.Duration
}

func (MaxDurationWrapper) WrapRecord

func (wrap MaxDurationWrapper) WrapRecord(ctx context.Context, name string, record Recorder) (Recorder, context.Context)

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 ...Field) (Recorder, context.Context)

type PromRecorder

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

func (PromRecorder) Commit

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

type Recorder

type Recorder interface {
	Commit(err error, fields ...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 ...Field) (Recorder, context.Context)

type TracerRecorder

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

func (TracerRecorder) Commit

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

type Wrapper

type Wrapper interface {
	WrapRecord(ctx context.Context, name string, record Recorder) (Recorder, context.Context)
}

Jump to

Keyboard shortcuts

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