base

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenTracingSampled      = "X-B3-Sampled"
	OpenTracingSpanId       = "X-B3-SpanId"
	OpenTracingSpanPosition = "X-B3-SpanPosition"
	OpenTracingTraceId      = "X-B3-TraceId"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter string

Adapter 日志适配, 定义日志输出到哪里, 内置支持下列几种类型.

const (
	AdapterTerm    Adapter = "term"    // 1. 在终端打印
	AdapterFile    Adapter = "file"    // 2. 写入到本地文件中
	AdapterElastic Adapter = "elastic" // 3. 发送到 Elasticsearch (https://www.elastic.co/cn/elasticsearch)
	AdapterKafka   Adapter = "kafka"   // 4. 发送到 Kafka (https://kafka.apache.org/)
)

func (Adapter) Defaulter

func (o Adapter) Defaulter() Adapter

Defaulter 计算默认值.

func (Adapter) String

func (o Adapter) String() string

String 转成字符串.

type Level

type Level string

Level 日志级别, 定义日志收集等级.

const (
	LevelDebug Level = "DEBUG"
	LevelInfo  Level = "INFO"
	LevelWarn  Level = "WARN"
	LevelError Level = "ERROR"
	LevelFatal Level = "FATAL"
)

func (Level) DebugOn

func (o Level) DebugOn() bool

func (Level) Defaulter

func (o Level) Defaulter() Level

Defaulter 计算默认值.

func (Level) ErrorOn

func (o Level) ErrorOn() bool

func (Level) FatalOn

func (o Level) FatalOn() bool

func (Level) InfoOn

func (o Level) InfoOn() bool

func (Level) IsError added in v1.1.1

func (o Level) IsError() bool

IsError 是否 ERROR 级日志.

func (Level) IsFatal

func (o Level) IsFatal() bool

IsFatal 是否 FATAL 级日志.

func (Level) String

func (o Level) String() string

String 转成字符串.

func (Level) WarnOn

func (o Level) WarnOn() bool

type TimeFormat

type TimeFormat string

TimeFormat 时间格式.

const (
	DefaultTimeFormat TimeFormat = "2006-01-02T15:04:05.999999999Z07:00"
)

func (TimeFormat) Defaulter

func (o TimeFormat) Defaulter() TimeFormat

Defaulter 计算默认值.

func (TimeFormat) String

func (o TimeFormat) String() string

String 转成字符串.

type Tracer

type Tracer string

Tracer 链路适配, 定义链路追踪数据上报到哪里, 内置支持下列类型.

const (
	TracerNone   Tracer = ""       // 1. 不上报
	TracerJaeger Tracer = "jaeger" // 2. 上报到Jaeger (https://www.jaegertracing.io/)
	TracerZipkin Tracer = "zipkin" // 3. 上报到Zipkin (https://zipkin.io/)
)

func (Tracer) Defaulter

func (o Tracer) Defaulter() Tracer

Defaulter 计算默认值.

func (Tracer) IsNone

func (o Tracer) IsNone() bool

IsNone 是否未定义.

func (Tracer) String

func (o Tracer) String() string

String 转成字符串.

Jump to

Keyboard shortcuts

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