Documentation
¶
Overview ¶
Package tenant defines the tenant identifier: the token that selects a settings folder, and with it the tables, policies, and pipes a request or an event belongs to (#583). It imports nothing from the rest of the repository, so every package can name a tenant without a cycle.
Index ¶
Constants ¶
const ( // Default is the reserved tenant every request without a tenant header // resolves to, and the only tenant of a flat settings directory. Default ID = "0" // Header carries the tenant id on a request. Absent means Default. Header = "X-Tenant-ID" // MaxLen caps an id's length in bytes. MaxLen = 64 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID string
ID is a validated tenant identifier. It is a string, never a number: ids issued upstream can be 19 digits long, which already round as a float64.
func Parse ¶
Parse validates s against the one grammar an id must satisfy to be safe both as a folder name and as a message-queue subject token: ASCII letters, digits, '_' and '-', at most MaxLen bytes. Dots, slashes, spaces, and wildcards are rejected because each means something to one of the two.