Documentation ¶
Index ¶
- Variables
- func AddResolver(name string, h ResolveTenantFunc)
- func DisableMultiTenantFilter(ctx context.Context) context.Context
- func IsEnableMultiTenantFilter(ctx context.Context) bool
- func WithTenant(ctx context.Context, tenant *TenantInfo) context.Context
- type ResolveTenantFunc
- type TenantInfo
- type TenantOptions
- type TenantResolveContext
- type TenantResolver
- type TenantService
Constants ¶
This section is empty.
Variables ¶
View Source
var TenantFilterKey = "TenantFilter"
View Source
var TenantKey = "Tenant"
Functions ¶
func AddResolver ¶
func AddResolver(name string, h ResolveTenantFunc)
func WithTenant ¶
func WithTenant(ctx context.Context, tenant *TenantInfo) context.Context
Types ¶
type ResolveTenantFunc ¶
type ResolveTenantFunc func(ctx *TenantResolveContext) error
type TenantInfo ¶
func CurrentTenant ¶
func CurrentTenant(ctx context.Context) *TenantInfo
func (*TenantInfo) IsHost ¶
func (t *TenantInfo) IsHost() bool
type TenantOptions ¶
type TenantOptions struct {
Resolvers []TenantResolver
}
func NewTenantOptions ¶
func NewTenantOptions() *TenantOptions
type TenantResolveContext ¶
func NewTenantResolveContext ¶
func NewTenantResolveContext(ctx context.Context) *TenantResolveContext
func (*TenantResolveContext) HasResolved ¶
func (c *TenantResolveContext) HasResolved() bool
type TenantResolver ¶
type TenantResolver struct { // Name of resolver Name string // ResolveFunc tenant ResolveFunc ResolveTenantFunc }
type TenantService ¶
type TenantService struct {
// contains filtered or unexported fields
}
func NewTenantService ¶
func NewTenantService() *TenantService
func (*TenantService) ResolveTenant ¶
func (t *TenantService) ResolveTenant(ctx context.Context) (*TenantInfo, error)
Click to show internal directories.
Click to hide internal directories.