Documentation
¶
Index ¶
- Constants
- func DB(ctx context.Context, fallbacks ...orm.DB) orm.DB
- func DataPermApplier(ctx context.Context) security.DataPermissionApplier
- func Logger(ctx context.Context, fallbacks ...logx.Logger) logx.Logger
- func Principal(ctx context.Context) *security.Principal
- func RequestID(ctx context.Context) string
- func RequestIP(ctx context.Context) string
- func RequestMethod(ctx context.Context) string
- func RequestPath(ctx context.Context) string
- func SetDB(ctx context.Context, db orm.DB) context.Context
- func SetDataPermApplier(ctx context.Context, applier security.DataPermissionApplier) context.Context
- func SetLogger(ctx context.Context, logger logx.Logger) context.Context
- func SetPrincipal(ctx context.Context, principal *security.Principal) context.Context
- func SetRequestID(ctx context.Context, requestID string) context.Context
- func SetRequestIP(ctx context.Context, ip string) context.Context
- func SetRequestMethod(ctx context.Context, method string) context.Context
- func SetRequestPath(ctx context.Context, path string) context.Context
Constants ¶
View Source
const ( KeyRequest contextKey = iota KeyRequestID KeyRequestIP KeyPrincipal KeyLogger KeyDB KeyDataPermApplier KeyRequestMethod KeyRequestPath )
Variables ¶
This section is empty.
Functions ¶
func DataPermApplier ¶
func DataPermApplier(ctx context.Context) security.DataPermissionApplier
func RequestMethod ¶ added in v0.28.0
RequestMethod returns the HTTP method of the current request, if the auth middleware recorded it. Used by signature auth to bind the method.
func RequestPath ¶ added in v0.28.0
RequestPath returns the request path of the current request, if the auth middleware recorded it. Used by signature auth to bind the path.
func SetDataPermApplier ¶
func SetPrincipal ¶
func SetRequestMethod ¶ added in v0.28.0
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.