Documentation
¶
Overview ¶
Package sessionfields validates the common configuration used by session issuance, public updates and the three relational schema generators.
Index ¶
- Constants
- func AccountNameOK(name string) bool
- func NameOK(name string) bool
- func Names(fields map[string]Field) []string
- func Normalize(fields map[string]Field) (map[string]Field, error)
- func NormalizeAccount(fields map[string]Field) (map[string]Field, error)
- func NormalizeRole(fields map[string]Field) (map[string]Field, error)
- func NormalizeUser(fields map[string]Field) (map[string]Field, error)
- func RoleNameOK(name string) bool
- func UserNameOK(name string) bool
- type ElementError
- type ElementErrors
- type Field
- type Type
Constants ¶
const MillisecondUTC = "2006-01-02T15:04:05.000Z"
Variables ¶
This section is empty.
Functions ¶
func AccountNameOK ¶
func RoleNameOK ¶
RoleNameOK reserves the stored columns and the selectors used on role updates.
func UserNameOK ¶
UserNameOK reserves core profile, authentication input and installed plugin attributes.
Types ¶
type ElementError ¶
ElementError points to an invalid element in a typed array.
type ElementErrors ¶
type ElementErrors []ElementError
func (ElementErrors) Error ¶
func (e ElementErrors) Error() string
type Field ¶
type Field struct {
Type Type
Column string
// Default accepts a scalar or a non-nil func() T returning one scalar.
Default any
Required, ServerOnly, Hidden bool
}
func (Field) CreationDefault ¶
CreationDefault obtains and validates a new value for a normalized field.
func (Field) Definition ¶
Definition returns one fresh-schema column after Normalize has validated its name.
func (Field) JSONColumn ¶
JSONColumn reports whether the logical value uses JSON storage.
func (Field) PublicValue ¶
PublicValue preserves milliseconds in the JSON representation of a date.
func (Field) StaticDefault ¶
StaticDefault returns the configured backfill value. A callback can only provide values for new records and never runs during reads or migrations.