Documentation ¶
Index ¶
- func ValidateCustomer(customerForm *CustomerForm) error
- func ValidateForm(formType *FormType) error
- func ValidateMultiChoiceForm(multipleChoiceForm *MultiChoiceForm) error
- func ValidateQuestionForm(questionFrom *QuestionForm) error
- func ValidateSliderForm(sliderForm *SliderForm) error
- type Customer
- type CustomerForm
- type Form
- type FormType
- type MultiChoice
- type MultiChoiceForm
- type Question
- type QuestionForm
- type Slider
- type SliderForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateCustomer ¶
func ValidateCustomer(customerForm *CustomerForm) error
ValidateCustomer takes a user as parameter and check if its properties are valid
func ValidateForm ¶
ValidateForm check if its properties are valid
func ValidateMultiChoiceForm ¶
func ValidateMultiChoiceForm(multipleChoiceForm *MultiChoiceForm) error
ValidateMultiChoiceForm check if its properties are valid
func ValidateQuestionForm ¶
func ValidateQuestionForm(questionFrom *QuestionForm) error
ValidateQuestionForm check if its properties are valid
func ValidateSliderForm ¶
func ValidateSliderForm(sliderForm *SliderForm) error
ValidateSliderForm check if its properties are valid
Types ¶
type Customer ¶
type Customer struct { ID uint64 `gorm:"primary_key"` Name string `gorm:"size:255"` Email string `gorm:"size:255; unique"` HashedPassword string Role string `gorm:"size:255"` }
Customer type is the structure of the users that we will store in the database
type CustomerForm ¶
type CustomerForm struct { Name string `gorm:"size:255"` Email string `gorm:"size:255"` Password string `gorm:"size:255"` Role string `gorm:"size:255"` }
CustomerForm is the struct used to login or register
type Form ¶
type Form struct { ID uint64 `gorm:"primary_key"` CustomerID uint64 Customer Customer Name string `gorm:"size:255"` }
Form is the struct send on database
type FormType ¶
type FormType struct {
Name string `gorm:"size:255"`
}
FormType is the struct send by customer for use form
type MultiChoice ¶
type MultiChoice struct { ID uint64 `gorm:"primary_key"` QuestionID uint64 Question Question Name string `gorm:"size:255"` }
MultiChoice is the struct send on database
type MultiChoiceForm ¶
type MultiChoiceForm struct {
Name string `gorm:"size:255"`
}
MultiChoiceForm is the struct send by customer for use form
type Question ¶
type Question struct { ID uint64 `gorm:"primary_key"` FormID uint64 Form Form Name string `gorm:"size:255"` Type string `gorm:"size:255"` }
Question is the struct send on database
type QuestionForm ¶
type QuestionForm struct { FormID uint64 Name string `gorm:"size:255"` Type string `gorm:"size:255"` MultiChoiceForm []MultiChoiceForm SliderForm SliderForm }
QuestionForm is the struct send by customer for use form
type Slider ¶
type Slider struct { ID uint64 `gorm:"primary_key"` QuestionID uint64 Question Question Name string `gorm:"size:255"` Min int Max int }
Slider is the struct send on database
type SliderForm ¶
SliderForm is the struct send by customer for use form