Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateArticle ¶
func ValidateArticle(article *ArticleForm) error
ValidateArticle takes an article form as parameter and check if its properties are valid
func ValidateCustomer ¶
func ValidateCustomer(customer *CustomerForm) error
ValidateCustomer takes a customer form as parameter and check if its properties are valid
Types ¶
type Article ¶
type Article struct { AuthorID uint64 Title string Content string CreatedAt time.Time AggregateID string }
Article model.
type ArticleForm ¶
ArticleForm represents the informations needed to create an article
type Customer ¶
type Customer struct { ID uint64 `gorm:"primary_key"` Name string `gorm:"size:255"` Email string `gorm:"size:255; unique"` HashedPassword string }
Customer is our struct for users
type CustomerForm ¶
type CustomerForm struct { Name string `gorm:"size:255"` Email string `gorm:"size:255" valid:"email~Invalid email address"` Password string `gorm:"size:255"` }
CustomerForm is our struct to handle new users requests
type CustomerJSON ¶
CustomerJSON is the struct to return user without the hash password
Click to show internal directories.
Click to hide internal directories.