Documentation ¶
Index ¶
- func AddAppIDToCtx(ctx context.Context, value string) context.Context
- func AddServiceNameToCtx(ctx context.Context, value string) context.Context
- func AddUserIDToCtx(ctx context.Context, userID string) context.Context
- func AddUserRoleToCtx(ctx context.Context, value string) context.Context
- func GetAppID(ctx context.Context) string
- func GetAppPlatform(ctx context.Context) string
- func GetAppVersion(ctx context.Context) string
- func GetIdentity(ctx context.Context) (string, string, error)
- func GetServiceName(ctx context.Context) string
- func GetTraceID(ctx context.Context) string
- func GetUserID(ctx context.Context) (string, error)
- func GetUserRole(ctx context.Context) (string, error)
- func IsAdmin(ctx context.Context) bool
- func IsBanned(ctx context.Context) bool
- func IsGuest(ctx context.Context) bool
- func ToAdminCtx(ctx context.Context) context.Context
- func ToBannedCtx(ctx context.Context) context.Context
- func ToGuestCtx(ctx context.Context) context.Context
- func WithAppPlatform(ctx context.Context, platform string) context.Context
- func WithAppVersion(ctx context.Context, platform string) context.Context
- func WithTraceID(ctx context.Context, traceID string) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAppIDToCtx ¶
AddAppIDToCtx store authenticated user id to context
func AddServiceNameToCtx ¶
AddServiceNameToCtx store authenticated user id to context
func AddUserIDToCtx ¶
AddUserIDToCtx store authenticated user id to context
func AddUserRoleToCtx ¶ added in v0.6.5
AddUserRoleToCtx adds user role to context
func GetAppPlatform ¶ added in v0.6.12
GetAppPlatform returns application platform of the context.
func GetAppVersion ¶ added in v0.6.12
GetAppVersion returns application version of the context.
func GetIdentity ¶ added in v0.6.6
GetIdentity returns the app and user IDs and an error in case both are empty
func GetServiceName ¶
GetServiceName gets authenticated service name from context
func GetTraceID ¶ added in v0.6.17
GetTraceID returns the trace iD of the context.
func GetUserRole ¶ added in v0.6.5
GetUserRole gets user role from context
func ToAdminCtx ¶
ToAdminCtx upgrades the context with admin privileges
func ToBannedCtx ¶ added in v0.6.3
ToBannedCtx upgrades the context with banned flag
func ToGuestCtx ¶ added in v0.6.13
ToGuestCtx adds guest to context
func WithAppPlatform ¶ added in v0.6.12
WithAppPlatform returns context containing application platform.
func WithAppVersion ¶ added in v0.6.12
WithAppVersion returns context containing application version.
Types ¶
This section is empty.