Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DateTime ¶ added in v2.1.0
type DateTime struct {
types.QBase `json:",inline" bson:",inline"`
// Format is the format of the date time field.
// Validations:
// - required
Format string `json:"format" bson:"format" validate:"required"`
// Type is the type of the date time field.
// Validations:
// - required
Type DateTypeFormat `json:"type" bson:"type" validate:"required"`
}
DateTime represents a date time question type. QuestionType: types.QTypeDateTime
func CastToDateTime ¶ added in v2.1.0
CastToDateTime casts the given interface to a DateTime type.
type DateTypeFormat ¶ added in v2.1.0
type DateTypeFormat string
const ( DateTypeFormatDate DateTypeFormat = "date" DateTypeFormatTime DateTypeFormat = "time" DateTypeFormatDateTime DateTypeFormat = "datetime" )
func (*DateTypeFormat) UnmarshalBSONValue ¶ added in v2.1.0
func (s *DateTypeFormat) UnmarshalBSONValue(typ bsontype.Type, raw []byte) error
func (*DateTypeFormat) UnmarshalJSON ¶ added in v2.1.0
func (s *DateTypeFormat) UnmarshalJSON(b []byte) error
type Email ¶
type Email struct {
types.QBase `json:",inline" bson:",inline"`
// AllowedDomains list of allowed domains for the email field.
// Validations:
// - optional
// - if defined, each domain must have a length of at least 1
AllowedDomains []string `json:"allowedDomains,omitempty" bson:"allowedDomains,omitempty" validate:"omitempty,dive,min=1"`
}
Email represents an email question type. QuestionType: types.QTypeEmail
func CastToEmail ¶
CastToEmail casts the given interface to an Email type.
type FreeText ¶
type FreeText struct {
types.QBase `json:",inline" bson:",inline"`
// Min is an optional minimum length for the text area field.
// Validations:
// - optional
// - if defined:
// * must be greater than or equal to 0
// * if max is defined, must be less than to max
Min *int `json:"min,omitempty" bson:"min,omitempty" validate:"omitempty,min=0,ltfield=Max"`
// Max is an optional maximum length for the text area field.
// Validations:
// - optional
// - if defined:
// * must be greater than or equal to 0
// * if min is defined, must be greater than to min
Max *int `json:"max,omitempty" bson:"max,omitempty" validate:"omitempty,min=0,gtfield=Min"`
}
FreeText represents a free text question type. Types: - types.QTypeInputText - types.QTypeTextArea
func CastToFreeText ¶
CastToFreeText casts the given interface to a FreeText type.
type IdentificationNumber ¶ added in v2.1.0
IdentificationNumber represents an identification number question type. QuestionType: types.QTypeIdentificationNumber
type InformationText ¶
type InformationText struct {
types.QBase `json:",inline" bson:",inline"`
// Text is the text to be displayed.
// Validations:
// - required
// - min length: 1
Text string `json:"text,omitempty" bson:"text,omitempty" validate:"required,min=1"`
}
InformationText represents an information text question type. Types: - types.QTypeInformation
type Telephone ¶
type Telephone struct {
types.QBase `json:",inline" bson:",inline"`
// AllowedCountryCodes list of allowed country codes for the telephone field.
// Validations:
// - optional
// - if defined, each country code must have a length of at least 1
AllowedCountryCodes []string `json:"allowedCountryCodes,omitempty" bson:"allowedCountryCodes,omitempty" validate:"omitempty,dive,min=1"`
}
Telephone represents a telephone question type. QuestionType: types.QTypeTelephone
func CastToTelephone ¶
CastToTelephone casts the given interface to a Telephone type.