Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinTenantIDs ¶
func TenantID ¶
TenantID returns exactly a single tenant ID from the context. It should be used when a certain endpoint should only support exactly a single tenant ID. It returns an error user.ErrNoOrgID if there is no tenant ID supplied or user.ErrTooManyOrgIDs if there are multiple tenant IDs present.
ignore stutter warning
Types ¶
type Resolver ¶
type Resolver interface { // TenantID returns exactly a single tenant ID from the context. It should be // used when a certain endpoint should only support exactly a single // tenant ID. It returns an error user.ErrNoOrgID if there is no tenant ID // supplied or user.ErrTooManyOrgIDs if there are multiple tenant IDs present. TenantID(context.Context) (string, error) // TenantIDs returns all tenant IDs from the context. It should return // normalized list of ordered and distinct tenant IDs (as produced by // NormalizeTenantIDs). TenantIDs(context.Context) ([]string, error) }
type SingleResolver ¶
type SingleResolver struct { }
func NewSingleResolver ¶
func NewSingleResolver() *SingleResolver
NewSingleResolver creates a tenant resolver, which restricts all requests to be using a single tenant only. This allows a wider set of characters to be used within the tenant ID and should not impose a breaking change.
Click to show internal directories.
Click to hide internal directories.