Documentation
¶
Index ¶
- Constants
- Variables
- func DomainIDFromContext(ctx context.Context) (id int, err error)
- func DomainIDLoadFromContext(ctx context.Context) (id int, ok bool)
- func TenantIDFromContext(ctx context.Context) (id int, err error)
- func TenantIDLoadFromContext(ctx context.Context) (id int, ok bool)
- func UserIDFromContext(ctx context.Context) (int, error)
- func UserIDFromContextAsInt(ctx context.Context) (int, error)
- func WithDomainID(parent context.Context, id int) context.Context
- func WithTenantID(parent context.Context, id int) context.Context
Constants ¶
View Source
const ( TenantContextKey = "_woocoos/knockout/tenant_id" DomainContextKey = "_woocoos/knockout/domain_id" TenantHeaderKey = "X-Tenant-ID" UserHeaderKey = "X-User-ID" DomainHeaderKey = "X-Domain-ID" )
Variables ¶
Functions ¶
func DomainIDFromContext ¶ added in v0.4.0
DomainIDFromContext returns the domain id from context.
func DomainIDLoadFromContext ¶ added in v0.4.0
DomainIDLoadFromContext returns the domain id from context. domain id has set by int format, this function simply returns the value.
func TenantIDFromContext ¶
TenantIDFromContext returns the tenant id from context.
func TenantIDLoadFromContext ¶
TenantIDLoadFromContext returns the tenant id from context. tenant id has set by int format, this function simply returns the value.
func UserIDFromContext ¶
UserIDFromContext returns the user id from context.
func UserIDFromContextAsInt ¶
UserIDFromContextAsInt returns the user id from context, the context don't save Int UserID in context, we need transfer it from string to int
func WithDomainID ¶ added in v0.4.0
WithDomainID returns a new context with domain id
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.