kk_stage

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: BSD-3-Clause Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnableTracer = false

Functions

This section is empty.

Types

type ConfigTracer

type ConfigTracer struct {
	Enabled     bool
	GrpcTarget  string
	ServiceName string
}

func (*ConfigTracer) Check

func (c *ConfigTracer) Check()

func (*ConfigTracer) Close

func (c *ConfigTracer) Close()

func (*ConfigTracer) Init

func (c *ConfigTracer) Init()

type Stage

type Stage struct {
	Ctx    context.Context
	GinCtx *gin.Context

	Tracer      *Tracer
	TraceId     string
	ServiceName string
	DebugMode   bool
	// contains filtered or unexported fields
}

func NewStage

func NewStage(ctx context.Context, serviceName string, debugMode bool) (stage *Stage)

func (*Stage) Copy

func (stage *Stage) Copy() *Stage

Copy use this to create a new stage in a new goroutine

func (*Stage) Get

func (stage *Stage) Get(key any) (value any, exists bool)

func (*Stage) Set

func (stage *Stage) Set(key any, value any)

func (*Stage) SetGinCtx

func (stage *Stage) SetGinCtx(c *gin.Context) *Stage

func (*Stage) StartTrace

func (stage *Stage) StartTrace(spanName string) (span trace.Span)

type Tracer

type Tracer struct {
	Tracer  trace.Tracer
	Context context.Context
}

func NewTracer

func NewTracer(serviceName string, ctx context.Context) *Tracer

Jump to

Keyboard shortcuts

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