Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶ added in v0.3.0
type Column struct {
// Columns may be renamed, but their ID cannot be changed.
ID uuid.UUID `json:"id" validate:"notnil"`
Name string `json:"name" validate:"notempty"`
Type ColumnType `json:"type"`
}
Column represents a single field/column/value to be collected/stored/managed in the user data store of a tenant.
type ColumnAccessor ¶ added in v0.3.0
type ColumnAccessor struct {
ID uuid.UUID `json:"id" validate:"notnil"`
// Friendly ID, must be unique?
Name string `json:"name" validate:"notempty"`
// the columns that are accessed here
ColumnIDs []uuid.UUID `json:"column_ids" validate:"notnil"`
// makes decisions about who can access this particular view of this field
AccessPolicyID uuid.UUID `json:"access_policy_id" validate:"notnil"`
// transforms the value of this field before it is returned to the client
TransformationPolicyID uuid.UUID `json:"transformation_policy_id" validate:"notnil"`
}
ColumnAccessor represents a customer-defined view / permissions policy on a column
type ColumnAccessors ¶ added in v0.3.0
type ColumnAccessors []ColumnAccessor
ColumnAccessors is simply a slice of ColumnAccessor, and this type exists soley so that we can hang Scan() and Value() on it to make the db layer work.
type ColumnType ¶ added in v0.3.0
type ColumnType int
ColumnType is an enum for supported column types
const ( ColumnTypeInvalid ColumnType = 0 ColumnTypeString ColumnType = 100 ColumnTypeTimestamp ColumnType = 200 )
ColumnType constants (leaving gaps intentionally to allow future related types to be grouped) NOTE: keep in sync with mapColumnType defined in TenantUserStoreConfig.tsx
func (ColumnType) MarshalText ¶ added in v0.3.0
func (t ColumnType) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler (for JSON)
func (ColumnType) String ¶ added in v0.3.0
func (t ColumnType) String() string
just here for easier debugging
func (*ColumnType) UnmarshalText ¶ added in v0.3.0
func (t *ColumnType) UnmarshalText(b []byte) error
UnmarshalText implements encoding.TextMarshaler (for JSON)
func (ColumnType) Validate ¶ added in v0.3.0
func (ft ColumnType) Validate() error
Validate implements Validateable
type Record ¶
Record is a single "row" of data containing 0 or more Columns that adhere to a Schema. The key is the Column 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.