Documentation ¶
Index ¶
- Constants
- func KeyOrDefault(key string) string
- func Middleware(ts saas.TenantStore, options ...Option) func(next http.Handler) http.Handler
- type CookieTenantResolveContrib
- type DomainTenantResolveContrib
- type ErrorFormatter
- type FormTenantResolveContrib
- type HeaderTenantResolveContrib
- type Option
- type QueryTenantResolveContrib
- type WebMultiTenancyOption
Constants ¶
View Source
const DefaultKey = "__tenant"
Variables ¶
This section is empty.
Functions ¶
func KeyOrDefault ¶
func Middleware ¶
Types ¶
type CookieTenantResolveContrib ¶
type CookieTenantResolveContrib struct {
// contains filtered or unexported fields
}
func NewCookieTenantResolveContrib ¶
func NewCookieTenantResolveContrib(key string, r *http.Request) *CookieTenantResolveContrib
func (*CookieTenantResolveContrib) Name ¶
func (h *CookieTenantResolveContrib) Name() string
type DomainTenantResolveContrib ¶
type DomainTenantResolveContrib struct {
// contains filtered or unexported fields
}
func NewDomainTenantResolveContrib ¶
func NewDomainTenantResolveContrib(f string, r *http.Request) *DomainTenantResolveContrib
func (*DomainTenantResolveContrib) Name ¶
func (h *DomainTenantResolveContrib) Name() string
type ErrorFormatter ¶
type ErrorFormatter func(w http.ResponseWriter, err error)
var ( DefaultErrorFormatter ErrorFormatter = func(w http.ResponseWriter, err error) { if err == saas.ErrTenantNotFound { http.Error(w, "Not Found", 404) } else { http.Error(w, err.Error(), 500) } } )
type FormTenantResolveContrib ¶
type FormTenantResolveContrib struct {
// contains filtered or unexported fields
}
func NewFormTenantResolveContrib ¶
func NewFormTenantResolveContrib(key string, r *http.Request) *FormTenantResolveContrib
func (*FormTenantResolveContrib) Name ¶
func (h *FormTenantResolveContrib) Name() string
type HeaderTenantResolveContrib ¶
type HeaderTenantResolveContrib struct {
// contains filtered or unexported fields
}
func NewHeaderTenantResolveContrib ¶
func NewHeaderTenantResolveContrib(key string, r *http.Request) *HeaderTenantResolveContrib
func (*HeaderTenantResolveContrib) Name ¶
func (h *HeaderTenantResolveContrib) Name() string
type Option ¶
type Option func(*option)
func WithErrorFormatter ¶
func WithErrorFormatter(e ErrorFormatter) Option
func WithMultiTenancyOption ¶
func WithMultiTenancyOption(opt *WebMultiTenancyOption) Option
func WithResolveOption ¶
func WithResolveOption(opt ...saas.ResolveOption) Option
type QueryTenantResolveContrib ¶
type QueryTenantResolveContrib struct {
// contains filtered or unexported fields
}
func NewQueryTenantResolveContrib ¶
func NewQueryTenantResolveContrib(key string, r *http.Request) *QueryTenantResolveContrib
func (*QueryTenantResolveContrib) Name ¶
func (h *QueryTenantResolveContrib) Name() string
type WebMultiTenancyOption ¶
func NewDefaultWebMultiTenancyOption ¶
func NewDefaultWebMultiTenancyOption() *WebMultiTenancyOption
func NewWebMultiTenancyOption ¶
func NewWebMultiTenancyOption(key string, domainFormat string) *WebMultiTenancyOption
Click to show internal directories.
Click to hide internal directories.