Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct {
// Fields may be renamed, but their ID cannot be changed.
ID uuid.UUID `json:"id" validate:"notnil"`
Name string `json:"name" validate:"notempty"`
Type FieldType `json:"type"`
}
Field represents a single field/column/value to be collected/stored/managed in the user data store of a tenant.
type FieldType ¶
type FieldType int
FieldType is an enum for supported field types
const ( FieldTypeInvalid FieldType = 0 FieldTypeString FieldType = 100 FieldTypeTimestamp FieldType = 200 )
FieldType constants (leaving gaps intentionally to allow future related types to be grouped) NOTE: keep in sync with mapFieldType defined in TenantUserStoreConfig.tsx
func (FieldType) MarshalText ¶
MarshalText implements encoding.TextMarshaler (for JSON)
func (*FieldType) UnmarshalText ¶
UnmarshalText implements encoding.TextMarshaler (for JSON)
type Record ¶
Record is a single "row" of data containing 0 or more Fields that adhere to a Schema. The key is the Field UUID, since names can change but IDs are stable.
func (Record) FixupAndValidate ¶
FixupAndValidate validates a record against a schema, and fixes up types in the record to match the schema when possible (e.g. since JSON and other serde formats don't preserve Go types, this attempts to parse rich types from strings as needed). This method should be called whenever a Record is deserialized.