appcontext

package
v0.0.0-...-b3f093e Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnhancedJWT

func EnhancedJWT(c context.Context) *authentication.EnhancedJwt

EnhancedJWT returns the enhanced EnhancedJWT defaulting to nil if not present.

func Logger

func Logger(ctx context.Context) (*zap.Logger, bool)

Logger returns the context's logger DEPRECATED - prefer ZLogger going forward

func Principal

Principal returns the security principal, defaulting to an Anonymous user if not assigned.

func Trace

func Trace(ctx context.Context) (uuid.UUID, bool)

Trace returns the context's trace UUID

func UserAccountService

UserAccountService returns a GetUserAccountFromDBFunc that is decorating the context

func WithEnhancedJWT

func WithEnhancedJWT(c context.Context, jwt authentication.EnhancedJwt) context.Context

WithEnhancedJWT returns the context decorated with the enhanced jwt

func WithLogger

func WithLogger(ctx context.Context, logger *zap.Logger) context.Context

WithLogger returns a context with the given logger

func WithPrincipal

WithPrincipal decorates the context with the given security principal

func WithTrace

func WithTrace(ctx context.Context) (context.Context, uuid.UUID)

WithTrace returns a context with request trace

func WithUserAccountService

func WithUserAccountService(ctx context.Context, accountFunction authentication.GetUserAccountFromDBFunc) context.Context

WithUserAccountService decorates the context with a GetUserAccountFromDBFunc

func ZLogger

func ZLogger(ctx context.Context) *zap.Logger

ZLogger will always return something that functions as a zap.Logger, even if it wasn't already placed on the context

Types

This section is empty.

Jump to

Keyboard shortcuts

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