common

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 10 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGuid

func GetGuid() string

func NewSpanID added in v0.0.14

func NewSpanID() string

func NewTraceID added in v0.0.14

func NewTraceID() string

func SpanIDBytesToHex added in v0.0.7

func SpanIDBytesToHex(bytes [8]byte) string

func SpanIDHexToUint64 added in v0.0.7

func SpanIDHexToUint64(hex string) uint64

func SpanIDUint64ToHex added in v0.0.7

func SpanIDUint64ToHex(n uint64) string

func TraceIDBytesToHex added in v0.0.7

func TraceIDBytesToHex(bytes [16]byte) string

func TraceIDHexToUint64 added in v0.0.7

func TraceIDHexToUint64(hex string) uint64

func TraceIDUint64ToHex added in v0.0.7

func TraceIDUint64ToHex(n uint64) string

Types

type Counter

type Counter interface {
	Inc() Counter
	Add(value int) Counter
}

type Eventer added in v0.0.15

type Eventer interface {
	Now(name string, attributes map[string]string) error
	At(name string, attributes map[string]string, when time.Time) error
	Interval(name string, attributes map[string]string, begin, end time.Time) error
	Stop()
}

type Events added in v0.0.15

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

func NewEvents added in v0.0.15

func NewEvents() *Events

func (*Events) At added in v0.0.15

func (es *Events) At(name string, attributes map[string]string, when time.Time) error

func (*Events) Interval added in v0.0.15

func (es *Events) Interval(name string, attributes map[string]string, begin, end time.Time) error

func (*Events) Now added in v0.0.15

func (es *Events) Now(name string, attributes map[string]string) error

func (*Events) Register added in v0.0.15

func (es *Events) Register(e Eventer)

func (*Events) Stop added in v0.0.15

func (es *Events) Stop()

type Gauge added in v0.2.1

type Gauge interface {
	Set(value float64) Gauge
}

type Group added in v0.5.0

type Group interface {
	Clear()
}

type Labels added in v0.2.4

type Labels = map[string]string

type Logger

type Logger interface {
	Info(obj interface{}, args ...interface{}) Logger
	SpanInfo(span TracerSpan, obj interface{}, args ...interface{}) Logger
	Warn(obj interface{}, args ...interface{}) Logger
	SpanWarn(span TracerSpan, obj interface{}, args ...interface{}) Logger
	Error(obj interface{}, args ...interface{}) Logger
	SpanError(span TracerSpan, obj interface{}, args ...interface{}) Logger
	Debug(obj interface{}, args ...interface{}) Logger
	SpanDebug(span TracerSpan, obj interface{}, args ...interface{}) Logger
	Panic(obj interface{}, args ...interface{})
	SpanPanic(span TracerSpan, obj interface{}, args ...interface{})
	Stack(offset int) Logger
	Stop()
}

type Logs

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

func NewLogs

func NewLogs() *Logs

func (*Logs) Debug

func (ls *Logs) Debug(obj interface{}, args ...interface{}) Logger

func (*Logs) Error

func (ls *Logs) Error(obj interface{}, args ...interface{}) Logger

func (*Logs) Info

func (ls *Logs) Info(obj interface{}, args ...interface{}) Logger

func (*Logs) Panic

func (ls *Logs) Panic(obj interface{}, args ...interface{})

func (*Logs) Register

func (ls *Logs) Register(l Logger)

func (*Logs) SpanDebug

func (ls *Logs) SpanDebug(span TracerSpan, obj interface{}, args ...interface{}) Logger

func (*Logs) SpanError

func (ls *Logs) SpanError(span TracerSpan, obj interface{}, args ...interface{}) Logger

func (*Logs) SpanInfo

func (ls *Logs) SpanInfo(span TracerSpan, obj interface{}, args ...interface{}) Logger

func (*Logs) SpanPanic

func (ls *Logs) SpanPanic(span TracerSpan, obj interface{}, args ...interface{})

func (*Logs) SpanWarn

func (ls *Logs) SpanWarn(span TracerSpan, obj interface{}, args ...interface{}) Logger

func (*Logs) Stack

func (ls *Logs) Stack(offset int) Logger

func (*Logs) Stop added in v0.0.14

func (ls *Logs) Stop()

func (*Logs) Warn

func (ls *Logs) Warn(obj interface{}, args ...interface{}) Logger

type Meter added in v0.0.5

type Meter interface {
	Group(name string) Group
	Counter(group, name, description string, labels Labels, prefixes ...string) Counter
	Gauge(group, name, description string, labels Labels, prefixes ...string) Gauge
	Stop()
}

type Metrics

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

func NewMetrics

func NewMetrics() *Metrics

func (*Metrics) Counter

func (ms *Metrics) Counter(group, name, description string, labels Labels, prefixes ...string) Counter

func (*Metrics) Gauge added in v0.2.2

func (ms *Metrics) Gauge(group, name, description string, labels Labels, prefixes ...string) Gauge

func (*Metrics) Group added in v0.5.0

func (ms *Metrics) Group(group string) Group

func (*Metrics) Register

func (ms *Metrics) Register(m Meter)

func (*Metrics) Stop added in v0.0.5

func (ms *Metrics) Stop()

type MetricsCounter

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

func (*MetricsCounter) Add added in v0.3.0

func (msc *MetricsCounter) Add(value int) Counter

func (*MetricsCounter) Inc

func (msc *MetricsCounter) Inc() Counter

type MetricsGauge added in v0.2.2

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

func (*MetricsGauge) Set added in v0.2.2

func (msg *MetricsGauge) Set(value float64) Gauge

type MetricsGroup added in v0.5.0

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

func (*MetricsGroup) Clear added in v0.5.0

func (mg *MetricsGroup) Clear()

type Tracer

type Tracer interface {
	StartSpan() TracerSpan
	StartSpanWithTraceID(traceID, spanID string) TracerSpan
	StartChildSpan(object interface{}) TracerSpan
	StartFollowSpan(object interface{}) TracerSpan
	Stop()
}

type TracerSpan

type TracerSpan interface {
	GetContext() TracerSpanContext
	SetCarrier(object interface{}) TracerSpan
	SetName(name string) TracerSpan
	SetTag(key string, value interface{}) TracerSpan
	Error(err error) TracerSpan
	SetBaggageItem(restrictedKey, value string) TracerSpan
	Finish()
}

type TracerSpanContext

type TracerSpanContext interface {
	GetTraceID() string
	GetSpanID() string
}

type Traces

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

func NewTraces

func NewTraces() *Traces

func (*Traces) Register

func (ts *Traces) Register(t Tracer)

func (*Traces) StartChildSpan

func (ts *Traces) StartChildSpan(object interface{}) TracerSpan

func (*Traces) StartFollowSpan

func (ts *Traces) StartFollowSpan(object interface{}) TracerSpan

func (*Traces) StartSpan

func (ts *Traces) StartSpan() TracerSpan

func (*Traces) StartSpanWithTraceID

func (ts *Traces) StartSpanWithTraceID(traceID, spanID string) TracerSpan

func (*Traces) Stop added in v0.0.5

func (ts *Traces) Stop()

type TracesSpan

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

func (*TracesSpan) Error

func (tss *TracesSpan) Error(err error) TracerSpan

func (*TracesSpan) Finish

func (tss *TracesSpan) Finish()

func (*TracesSpan) GetContext

func (tss *TracesSpan) GetContext() TracerSpanContext

func (*TracesSpan) SetBaggageItem

func (tss *TracesSpan) SetBaggageItem(restrictedKey, value string) TracerSpan

func (*TracesSpan) SetCarrier

func (tss *TracesSpan) SetCarrier(object interface{}) TracerSpan

func (*TracesSpan) SetName

func (tss *TracesSpan) SetName(name string) TracerSpan

func (*TracesSpan) SetTag

func (tss *TracesSpan) SetTag(key string, value interface{}) TracerSpan

type TracesSpanContext

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

func (TracesSpanContext) GetSpanID

func (tssc TracesSpanContext) GetSpanID() string

func (TracesSpanContext) GetTraceID

func (tssc TracesSpanContext) GetTraceID() string

Jump to

Keyboard shortcuts

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