core

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: MIT Imports: 1 Imported by: 13

README

core

core for all frame

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICtxLogger

type ICtxLogger interface {
	DebugCtxf(ctx context.Context, format string, args ...interface{})
	InfoCtxf(ctx context.Context, format string, args ...interface{})
	WarnCtxf(ctx context.Context, format string, args ...interface{})
	ErrorCtxf(ctx context.Context, format string, args ...interface{})
}

type ILogger

type ILogger interface {
	DebugCtx(ctx context.Context, msg string, kv map[string]string)
	InfoCtx(ctx context.Context, msg string, kv map[string]string)
	WarnCtx(ctx context.Context, msg string, kv map[string]string)
	ErrorCtx(ctx context.Context, msg string, kv map[string]string)
}

type MetaData

type MetaData string
const (
	TraceID      MetaData = "traceId"      // distributed trace, link system
	ParentID     MetaData = "parentId"     // parent id
	SessionID    MetaData = "sessionId"    // app trace, link function
	SessionBirth MetaData = "sessionBirth" // session birth
	SpanID       MetaData = "spanId"       // span id

	Action MetaData = "action"
	Step   MetaData = "step"
	XKey   MetaData = "x_key" // x_key keyword for business search

	Error    MetaData = "error"
	Duration MetaData = "duration"

	Category      MetaData = "category"
	Datetime      MetaData = "datetime"
	Caller        MetaData = "caller"
	LevelKey      MetaData = "level"
	Message       MetaData = "message"
	NameKey       MetaData = "logger"
	StacktraceKey MetaData = "stacktrace"
	LineEnding    MetaData = "\n"
	FunctionKey   MetaData = ""
)

func (MetaData) Get

func (key MetaData) Get(ctx context.Context) interface{}

func (MetaData) GetString

func (key MetaData) GetString(ctx context.Context) string

func (MetaData) Set

func (key MetaData) Set(ctx context.Context, v interface{}) context.Context

func (MetaData) SetString

func (key MetaData) SetString(ctx context.Context, v string) context.Context

func (MetaData) String

func (key MetaData) String() string

Jump to

Keyboard shortcuts

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