Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyTenantID reports an empty tenant identifier. ErrEmptyTenantID = errors.New("gotenancy/types: empty tenant id") // ErrInvalidTenantID reports a tenant identifier that does not match the configured strategy. ErrInvalidTenantID = errors.New("gotenancy/types: invalid tenant id") )
Functions ¶
This section is empty.
Types ¶
type MultiTenancySide ¶
type MultiTenancySide string
MultiTenancySide identifies whether an operation runs as host infrastructure or inside a tenant boundary.
const ( MultiTenancySideHost MultiTenancySide = "host" MultiTenancySideTenant MultiTenancySide = "tenant" )
type Tenant ¶
type Tenant struct {
ID TenantID
Name string
Status TenantStatus
PlanID string
Config map[string]string
}
Tenant is the shared metadata shape used by the core abstractions.
type TenantID ¶
type TenantID string
TenantID is the default public tenant identifier type.
func NewTenantIDFromInt ¶
NewTenantIDFromInt creates a tenant identifier from an int64 value.
func ParseTenantID ¶
func ParseTenantID(raw string, strategy TenantIDStrategy) (TenantID, error)
ParseTenantID validates raw with the configured strategy and returns a TenantID.
type TenantIDStrategy ¶
type TenantIDStrategy string
TenantIDStrategy describes how incoming tenant identifiers should be validated before they are accepted by resolver and store implementations.
const ( // TenantIDStrategyString accepts any non-empty string. TenantIDStrategyString TenantIDStrategy = "string" // TenantIDStrategyInt accepts base-10 integer identifiers. TenantIDStrategyInt TenantIDStrategy = "int" // TenantIDStrategyUUID accepts canonical UUID strings. TenantIDStrategyUUID TenantIDStrategy = "uuid" )
type TenantStatus ¶
type TenantStatus string
TenantStatus describes the lifecycle state of a tenant.
const ( TenantStatusPending TenantStatus = "pending" TenantStatusActive TenantStatus = "active" TenantStatusSuspended TenantStatus = "suspended" TenantStatusSoftDeleted TenantStatus = "soft_deleted" TenantStatusHardDeleted TenantStatus = "hard_deleted" )
Click to show internal directories.
Click to hide internal directories.