Documentation ¶
Index ¶
- Constants
- func PasswordLoginOrder(in []string) []string
- func SortByGroups(orderByGroups []Group) func(*sortOptions)
- func SortBySchema(schemaRef string) func(*sortOptions)
- func SortUpdateOrder(f func([]string) []string) func(*sortOptions)
- func SortUseOrder(keysInOrder []string) func(*sortOptions)
- func WithInputAttributes(f func(a *InputAttributes)) func(a *InputAttributes)
- func WithRequiredInputAttribute(a *InputAttributes)
- type AnchorAttributes
- type Attributes
- type Group
- type ImageAttributes
- type InputAttributeType
- type InputAttributes
- type InputAttributesModifier
- type InputAttributesModifiers
- type Meta
- type Node
- func NewCSRFNode(token string) *Node
- func NewInputField(name string, value interface{}, group Group, inputType InputAttributeType, ...) *Node
- func NewInputFieldFromJSON(name string, value interface{}, group Group, opts ...InputAttributesModifier) *Node
- func NewInputFieldFromSchema(name string, group Group, p jsonschemax.Path, opts ...InputAttributesModifier) *Node
- type Nodes
- func (n *Nodes) Append(node *Node)
- func (n Nodes) Find(id string) *Node
- func (n *Nodes) Remove(ids ...string)
- func (n Nodes) Reset(exclude ...string)
- func (n Nodes) ResetNodes(reset ...string)
- func (n Nodes) ResetNodesWithPrefix(prefix string)
- func (n *Nodes) SetValueAttribute(id string, value interface{}) bool
- func (n Nodes) SortBySchema(opts ...SortOption) error
- func (n *Nodes) Upsert(node *Node)
- type SortOption
- type TextAttributes
- type Type
Constants ¶
const ( DefaultGroup Group = "default" PasswordGroup Group = "password" OpenIDConnectGroup Group = "oidc" ProfileGroup Group = "profile" RecoveryLinkGroup Group = "link" VerificationLinkGroup Group = "link" Text Type = "text" Input Type = "input" Image Type = "img" Anchor Type = "a" )
const DisableFormField = "disableFormField"
Variables ¶
This section is empty.
Functions ¶
func PasswordLoginOrder ¶
func SortByGroups ¶
func SortByGroups(orderByGroups []Group) func(*sortOptions)
func SortBySchema ¶
func SortBySchema(schemaRef string) func(*sortOptions)
func SortUpdateOrder ¶
func SortUseOrder ¶
func SortUseOrder(keysInOrder []string) func(*sortOptions)
func WithInputAttributes ¶
func WithInputAttributes(f func(a *InputAttributes)) func(a *InputAttributes)
func WithRequiredInputAttribute ¶
func WithRequiredInputAttribute(a *InputAttributes)
Types ¶
type AnchorAttributes ¶
type AnchorAttributes struct { // The link's href (destination) URL. // // format: uri // required: true HREF string `json:"href"` // The link's title. // // required: true Title *text.Message `json:"title"` }
AnchorAttributes represents the attributes of an anchor node.
swagger:model uiNodeAnchorAttributes
func (*AnchorAttributes) GetValue ¶
func (a *AnchorAttributes) GetValue() interface{}
func (*AnchorAttributes) ID ¶
func (a *AnchorAttributes) ID() string
func (*AnchorAttributes) Reset ¶
func (a *AnchorAttributes) Reset()
func (*AnchorAttributes) SetValue ¶
func (a *AnchorAttributes) SetValue(value interface{})
type Attributes ¶
type Attributes interface { // swagger:ignore ID() string // swagger:ignore Reset() // swagger:ignore SetValue(value interface{}) // swagger:ignore GetValue() interface{} }
Attributes represents a list of attributes (e.g. `href="foo"` for links).
swagger:model uiNodeAttributes
type ImageAttributes ¶
type ImageAttributes struct { // The image's source URL. // // format: uri // required: true Source string `json:"src"` }
ImageAttributes represents the attributes of an image node.
swagger:model uiNodeImageAttributes
func (*ImageAttributes) GetValue ¶
func (a *ImageAttributes) GetValue() interface{}
func (*ImageAttributes) ID ¶
func (a *ImageAttributes) ID() string
func (*ImageAttributes) Reset ¶
func (a *ImageAttributes) Reset()
func (*ImageAttributes) SetValue ¶
func (a *ImageAttributes) SetValue(value interface{})
type InputAttributeType ¶
type InputAttributeType string
swagger:model uiNodeInputAttributeType
const ( InputAttributeTypeText InputAttributeType = "text" InputAttributeTypePassword InputAttributeType = "password" InputAttributeTypeNumber InputAttributeType = "number" InputAttributeTypeCheckbox InputAttributeType = "checkbox" InputAttributeTypeHidden InputAttributeType = "hidden" InputAttributeTypeEmail InputAttributeType = "email" InputAttributeTypeSubmit InputAttributeType = "submit" InputAttributeTypeDateTimeLocal InputAttributeType = "datetime-local" InputAttributeTypeDate InputAttributeType = "date" InputAttributeTypeURI InputAttributeType = "url" )
type InputAttributes ¶
type InputAttributes struct { // The input's element name. // // required: true Name string `json:"name"` // The input's element type. // // required: true Type InputAttributeType `json:"type" faker:"-"` // The input's value. FieldValue interface{} `json:"value,omitempty" faker:"string"` // Mark this input field as required. Required bool `json:"required,omitempty"` // The input's label text. Label *text.Message `json:"label,omitempty"` // The input's pattern. Pattern string `json:"pattern,omitempty"` // Sets the input's disabled field to true or false. // // required: true Disabled bool `json:"disabled"` }
InputAttributes represents the attributes of an input node
swagger:model uiNodeInputAttributes
func (*InputAttributes) GetValue ¶
func (a *InputAttributes) GetValue() interface{}
func (*InputAttributes) ID ¶
func (a *InputAttributes) ID() string
func (*InputAttributes) Reset ¶
func (a *InputAttributes) Reset()
func (*InputAttributes) SetValue ¶
func (a *InputAttributes) SetValue(value interface{})
type InputAttributesModifier ¶
type InputAttributesModifier func(attributes *InputAttributes)
type InputAttributesModifiers ¶
type InputAttributesModifiers []InputAttributesModifier
type Meta ¶
type Meta struct { // Label represents the node's label. // // Keep in mind that these values are autogenerated and can not be changed. // If you wish to use other titles or labels implement that directly in // your UI. Label *text.Message `json:"label,omitempty"` }
A Node's Meta Information
This might include a label and other information that can optionally be used to render UIs.
type Node ¶
type Node struct { // The node's type // // Can be one of: text, input, img, a // // required: true Type Type `json:"type" faker:"-"` // Group specifies which group (e.g. password authenticator) this node belongs to. // // required: true Group Group `json:"group"` // The node's attributes. // // required: true // swagger:type uiNodeAttributes Attributes Attributes `json:"attributes" faker:"ui_node_attributes"` // The node's messages // // Contains error, validation, or other messages relevant to this node. // // required: true Messages text.Messages `json:"messages"` // Meta contains a node meta information // // This might include a label and other information that can optionally // be used to render UIs. // // required: true Meta *Meta `json:"meta"` }
Node represents a flow's nodes
Nodes are represented as HTML elements or their native UI equivalents. For example, a node can be an `<img>` tag, or an `<input element>` but also `some plain text`.
swagger:model uiNode
func NewCSRFNode ¶
func NewInputField ¶
func NewInputField(name string, value interface{}, group Group, inputType InputAttributeType, opts ...InputAttributesModifier) *Node
func NewInputFieldFromJSON ¶
func NewInputFieldFromJSON(name string, value interface{}, group Group, opts ...InputAttributesModifier) *Node
func NewInputFieldFromSchema ¶
func NewInputFieldFromSchema(name string, group Group, p jsonschemax.Path, opts ...InputAttributesModifier) *Node
func (*Node) MarshalJSON ¶
func (*Node) UnmarshalJSON ¶
type Nodes ¶
type Nodes []*Node
swagger:model uiNodes
func (Nodes) ResetNodes ¶
func (Nodes) ResetNodesWithPrefix ¶
func (*Nodes) SetValueAttribute ¶
SetValueAttribute sets a node's attribute's value or returns false if no node is found.
func (Nodes) SortBySchema ¶
func (n Nodes) SortBySchema(opts ...SortOption) error
type SortOption ¶
type SortOption func(*sortOptions)
type TextAttributes ¶
type TextAttributes struct { // The text of the text node. // // required: true Text *text.Message `json:"text"` }
TextAttributes represents the attributes of a text node.
swagger:model uiNodeTextAttributes
func (*TextAttributes) GetValue ¶
func (a *TextAttributes) GetValue() interface{}
func (*TextAttributes) ID ¶
func (a *TextAttributes) ID() string
func (*TextAttributes) Reset ¶
func (a *TextAttributes) Reset()
func (*TextAttributes) SetValue ¶
func (a *TextAttributes) SetValue(value interface{})