Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MaxTenantID = MakeTenantID(math.MaxUint64)
MaxTenantID is the maximum ID of a (non-system) tenant in a multi-tenant cluster.
var MinTenantID = MakeTenantID(2)
MinTenantID is the minimum ID of a (non-system) tenant in a multi-tenant cluster.
var SystemTenantID = MakeTenantID(1)
SystemTenantID is the ID associated with the system's internal tenant in a multi-tenant cluster and the only tenant in a single-tenant cluster.
The system tenant differs from all other tenants in four important ways: 1. the system tenant's keyspace is not prefixed with a tenant specifier. 2. the system tenant is created by default during cluster initialization. 3. the system tenant is always present and can never be destroyed. 4. the system tenant has the ability to create and destroy other tenants.
Functions ¶
func BytesNext ¶
BytesNext returns the next possible byte slice, using the extra capacity of the provided slice if possible, and if not, appending an \x00.
func IsSystemTenantID ¶
IsSystemTenantID returns whether the provided ID corresponds to that of the system tenant.
Types ¶
type Key ¶
type Key []byte
Key is a custom type for a byte string in proto messages which refer to Cockroach keys.
type TenantID ¶
type TenantID struct {
// contains filtered or unexported fields
}
A TenantID is a unique ID associated with a tenant in a multi-tenant cluster. Each tenant is granted exclusive access to a portion of the keyspace and a collection of SQL tables in that keyspace which comprise a "logical" cluster.
The type is intentionally opaque to require deliberate use.
func MakeTenantID ¶
MakeTenantID constructs a new TenantID from the provided uint64.
func TenantFromContext ¶
TenantFromContext returns the tenant information in ctx if it exists.