Documentation
¶
Index ¶
- Constants
- func AccessToken(ctx context.Context) (string, bool)
- func BuildContext(ctx context.Context, opts ...WithContextFunc) context.Context
- func Logger(ctx context.Context) *slog.Logger
- func TraceId(ctx context.Context, generate bool) string
- func UserConfig(ctx context.Context) (endpoints.Endpoint, error)
- func UserInfo(ctx context.Context) (jwtutil.UserInfo, error)
- type WithContextFunc
Constants ¶
View Source
const ( Trace uint = 1 << iota // 1 << 0 = 1 Debug // 1 << 1 = 2 )
View Source
const (
LabelKrateoTraceId = "X-Krateo-TraceId"
)
Variables ¶
This section is empty.
Functions ¶
func BuildContext ¶
func BuildContext(ctx context.Context, opts ...WithContextFunc) context.Context
Types ¶
type WithContextFunc ¶
func WithAccessToken ¶
func WithAccessToken(tok string) WithContextFunc
func WithLogger ¶
func WithLogger(root *slog.Logger) WithContextFunc
func WithTraceId ¶
func WithTraceId(traceId string) WithContextFunc
func WithUserConfig ¶
func WithUserConfig(ep endpoints.Endpoint) WithContextFunc
func WithUserInfo ¶
func WithUserInfo(ui jwtutil.UserInfo) WithContextFunc
Click to show internal directories.
Click to hide internal directories.