xcontext

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UserCtxKey    = "x-user"
	TenantCtxKey  = "tenantID"
	DefaultTenant = "default"
)

Variables

This section is empty.

Functions

func Tenant

func Tenant(ctx context.Context) (tenant string, found bool)

Tenant returns the tenant from the context if it exists.

func TenantOrDefault

func TenantOrDefault(ctx context.Context) string

TenantOrDefault returns the tenant from the context if it exists or the default value.

func User

func User(ctx context.Context) (user xuser.User, found bool)

User returns the user from the context if it exists. If the user does not exist, found will be false.

Types

This section is empty.

Jump to

Keyboard shortcuts

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