context

package module
v0.0.0-...-20ebf41 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRequestID

func GetRequestID(ctx context.Context) string

GetRequestID retrieves the request ID from the context.

func GetUserLevel

func GetUserLevel(ctx context.Context) string

GetUserLevel retrieves the user's access level from the context.

func GetUserUsername

func GetUserUsername(ctx context.Context) string

GetUserUsername retrieves the user's username from the context.

Types

type ContextKey

type ContextKey string

ContextKey is a custom type for context keys.

var (
	CTX_REQUEST_ID    ContextKey = "requestID"
	CTX_USER_LEVEL    ContextKey = "userLevel"
	CTX_USER_USERNAME ContextKey = "userUsername"
)

Jump to

Keyboard shortcuts

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