Documentation ¶
Index ¶
Constants ¶
const ( // Boolean represents a 'boolean' form field. Boolean = "boolean" // Fixed represents a 'fixed' form field. Fixed = "fixed" // Hidden represents a 'hidden' form field. Hidden = "hidden" // JidMulti represents a 'jid-multi' form field. JidMulti = "jid-multi" // JidSingle represents a 'jid-single' form field. JidSingle = "jid-single" // ListMulti represents a 'list-multi' form field. ListMulti = "list-multi" // ListSingle represents a 'list-single' form field. ListSingle = "list-single" // TextMulti represents a 'text-multi' form field. TextMulti = "text-multi" // TextPrivate represents a 'text-private' form field. TextPrivate = "text-private" // TextSingle represents a 'text-single' form field. TextSingle = "text-single" )
const ( // Form represents a 'form' data form. Form = "form" // Submit represents a 'submit' data form. Submit = "submit" // Cancel represents a 'cancel' data form. Cancel = "cancel" // Result represents a 'result' data form. Result = "result" )
const FormNamespace = "jabber:x:data"
FormNamespace specifies XEP-0004 namespace constant value.
const FormType = "FORM_TYPE"
FormType represents form type constant value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataForm ¶
type DataForm struct { Type string Title string Instructions string Fields Fields Reported Fields Items []Fields }
DataForm represents a form that could be use for gathering data as well as for reporting data returned from a search.
func NewFormFromElement ¶
NewFormFromElement returns a new data form entity reading it from it's XMPP representation.
type Field ¶
type Field struct { Var string Required bool Type string Label string Description string Values []string Options []Option }
Field represents a field of a form. The field could be used to represent a question to complete, a completed question or a data returned from a search.
func NewFieldFromElement ¶
NewFieldFromElement returns a new form field entity reading it from it's XML representation.
type Fields ¶ added in v0.7.0
type Fields []Field
Fields represent a set of form fields
func (Fields) ValueForField ¶ added in v0.7.0
ValueForField returns the associated value for a given field name.
func (Fields) ValueForFieldOfType ¶ added in v0.7.0
ValueForFieldOfType returns the associated value for a given field name and type.
func (Fields) ValuesForField ¶ added in v0.7.0
ValuesForField returns all associated values for a given field name.
func (Fields) ValuesForFieldOfType ¶ added in v0.7.0
ValuesForFieldOfType returns all associated values for a given field name and type.