common

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 14 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCallerInfo

func GetCallerInfo(offset int) (string, string, int)

func GetGuid

func GetGuid() string

func HasElem

func HasElem(s interface{}, elem interface{}) bool

func IsEmpty

func IsEmpty(s string) bool

func MakeHttpClient

func MakeHttpClient(timeout int) *http.Client

Types

type Counter

type Counter interface {
	Inc(labelValues ...string) Counter
}

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{}) Logger
	SpanPanic(span TracerSpan, obj interface{}, args ...interface{}) Logger
	Stack(offset int) Logger
}

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{}) Logger

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{}) Logger

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) Warn

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

type Meter added in v0.0.5

type Meter interface {
	Counter(name, description string, labels []string, prefixes ...string) Counter
	Stop()
}

type Metrics

type Metrics struct {
	Meters []Meter
}

func NewMetrics

func NewMetrics() *Metrics

func (*Metrics) Counter

func (ms *Metrics) Counter(name, description string, labels []string, prefixes ...string) Counter

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) Inc

func (msc *MetricsCounter) Inc(values ...string) Counter

type Tracer

type Tracer interface {
	StartSpan() TracerSpan
	StartSpanWithTraceID(traceID uint64) 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() uint64
	GetSpanID() uint64
}

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 uint64) 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() uint64

func (TracesSpanContext) GetTraceID

func (tssc TracesSpanContext) GetTraceID() uint64

Jump to

Keyboard shortcuts

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