text

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	types.QBase `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

func CastToEmail(questionValue any) (*Email, error)

CastToEmail casts the given interface to an Email type.

type FreeText

type FreeText struct {
	types.QBase `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

func CastToFreeText(questionValue any) (*FreeText, error)

CastToFreeText casts the given interface to a FreeText type.

type InformationText

type InformationText struct {
	types.QBase `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 `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

func CastToTelephone(questionValue any) (*Telephone, error)

CastToTelephone casts the given interface to a Telephone type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL