ctxkeys

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginTime

func BeginTime(ctx context.Context) (time.Time, bool)

BeginTime 读取请求开始时间

func TraceID

func TraceID(ctx context.Context) string

TraceID 读取 traceID

func User

func User(ctx context.Context) any

User 读取用户信息,调用方需自行类型断言

func WithBeginTime

func WithBeginTime(ctx context.Context, t time.Time) context.Context

WithBeginTime 注入请求开始时间

func WithTraceID

func WithTraceID(ctx context.Context, id string) context.Context

WithTraceID 注入 traceID

func WithUser

func WithUser(ctx context.Context, user any) context.Context

WithUser 注入用户信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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