contextx

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyRequest contextKey = iota
	KeyRequestId
	KeyPrincipal
	KeyLogger
	KeyDb
	KeyTransformer
	KeyDataPermApplier
)

Variables

This section is empty.

Functions

func APIRequest

func APIRequest(ctx context.Context) *api.Request

APIRequest returns the api.APIRequest from fiber context.

func DataPermApplier

func DataPermApplier(ctx context.Context) security.DataPermissionApplier

DataPermApplier returns the security.DataPermissionApplier from fiber context.

func Db

func Db(ctx context.Context) orm.Db

Db returns the orm.Db from fiber context.

func Logger

func Logger(ctx context.Context) log.Logger

Logger returns the log.Logger from fiber context.

func Principal

func Principal(ctx context.Context) *security.Principal

Principal returns the security.Principal from fiber context.

func RequestId

func RequestId(ctx context.Context) string

RequestId returns the request id from fiber context.

func SetAPIRequest

func SetAPIRequest(ctx context.Context, request *api.Request) context.Context

SetAPIRequest stores the api.Request into fiber context.

func SetDataPermApplier

func SetDataPermApplier(ctx context.Context, applier security.DataPermissionApplier) context.Context

SetDataPermApplier stores the security.DataPermissionApplier into fiber context.

func SetDb

func SetDb(ctx context.Context, db orm.Db) context.Context

SetDb stores the orm.Db into fiber context.

func SetLogger

func SetLogger(ctx context.Context, logger log.Logger) context.Context

SetLogger stores the log.Logger into fiber context.

func SetPrincipal

func SetPrincipal(ctx context.Context, principal *security.Principal) context.Context

SetPrincipal stores the security.Principal into fiber context.

func SetRequestId

func SetRequestId(ctx context.Context, requestId string) context.Context

SetRequestId stores the request id into fiber context.

func SetTransformer

func SetTransformer(ctx context.Context, transformer mold.Transformer) context.Context

SetTransformer stores the mold.Transformer into fiber context.

func Transformer

func Transformer(ctx context.Context) mold.Transformer

Transformer returns the mold.Transformer from fiber context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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