Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateBlog ¶
type CreateBlog struct { Title string `json:"title" validate:"required,min=3,max=500"` Description string `json:"description" validate:"required,min=3,max=2000"` DraftText string `json:"draftText" validate:"required,max=50000"` Slug string `json:"slug" validate:"required,min=3,max=200"` ImgURL string `json:"imgUrl" validate:"required,uri,max=200"` Tags []string `json:"tags" validate:"required,min=1,dive,uppercase"` }
func EmptyCreateBlog ¶
func EmptyCreateBlog() *CreateBlog
func (*CreateBlog) GetValue ¶
func (d *CreateBlog) GetValue() *CreateBlog
func (*CreateBlog) ValidateErrors ¶
func (b *CreateBlog) ValidateErrors(errs validator.ValidationErrors) ([]string, error)
type InfoAuthor ¶
type InfoAuthor struct { ID primitive.ObjectID `json:"_id" binding:"required" validate:"required"` Name string `json:"name" binding:"required" validate:"required"` ProfilePicURL *string `json:"profilePicUrl,omitempty" validate:"omitempty,url"` }
func NewInfoPrivateUser ¶
func NewInfoPrivateUser(user *model.User) *InfoAuthor
func (*InfoAuthor) GetValue ¶
func (d *InfoAuthor) GetValue() *InfoAuthor
func (*InfoAuthor) ValidateErrors ¶
func (d *InfoAuthor) ValidateErrors(errs validator.ValidationErrors) ([]string, error)
type InfoBlog ¶
type InfoBlog struct { ID primitive.ObjectID `json:"_id" binding:"required" validate:"required"` Title string `json:"title" validate:"required,min=3,max=500"` Description string `json:"description" validate:"required,min=3,max=2000"` Slug string `json:"slug" validate:"required,min=3,max=200"` ImgURL *string `json:"imgUrl,omitempty" validate:"omitempty,uri,max=200"` Score float64 `json:"score," validate:"required,min=0,max=1"` Tags []string `json:"tags" validate:"required,dive,uppercase"` }
func EmptyInfoBlog ¶
func EmptyInfoBlog() *InfoBlog
func (*InfoBlog) ValidateErrors ¶
type PrivateBlog ¶
type PrivateBlog struct { ID primitive.ObjectID `json:"_id" binding:"required" validate:"required"` Title string `json:"title" validate:"required,min=3,max=500"` Description string `json:"description" validate:"required,min=3,max=2000"` Text *string `json:"text,omitempty" validate:"omitempty,max=50000"` DraftText string `json:"draftText" validate:"required"` Slug string `json:"slug" validate:"required,min=3,max=200"` Author *InfoAuthor `json:"author,omitempty" validate:"required,omitempty"` ImgURL *string `json:"imgUrl,omitempty" validate:"omitempty,uri,max=200"` Score *float64 `json:"score,omitempty" validate:"omitempty,min=0,max=1"` Tags *[]string `json:"tags,omitempty" validate:"omitempty,dive,uppercase"` Submitted bool `json:"submitted" validate:"required"` Drafted bool `json:"drafted" validate:"required"` Published bool `json:"published" validate:"required"` PublishedAt *time.Time `json:"publishedAt,omitempty"` CreatedAt time.Time `json:"createdAt" validate:"required"` UpdatedAt time.Time `json:"updatedAt" validate:"required"` }
func EmptyInfoPrivateBlog ¶
func EmptyInfoPrivateBlog() *PrivateBlog
func NewPrivateBlog ¶
func (*PrivateBlog) GetValue ¶
func (d *PrivateBlog) GetValue() *PrivateBlog
func (*PrivateBlog) ValidateErrors ¶
func (b *PrivateBlog) ValidateErrors(errs validator.ValidationErrors) ([]string, error)
type PublicBlog ¶
type PublicBlog struct { ID primitive.ObjectID `json:"_id" binding:"required" validate:"required"` Title string `json:"title" validate:"required,min=3,max=500"` Description string `json:"description" validate:"required,min=3,max=2000"` Text string `json:"text" validate:"required,max=50000"` Slug string `json:"slug" validate:"required,min=3,max=200"` Author *InfoAuthor `json:"author,omitempty" validate:"required,omitempty"` ImgURL *string `json:"imgUrl,omitempty" validate:"omitempty,uri,max=200"` Score *float64 `json:"score,omitempty" validate:"omitempty,min=0,max=1"` Tags *[]string `json:"tags,omitempty" validate:"omitempty,dive,uppercase"` PublishedAt *time.Time `json:"publishedAt,omitempty"` }
func EmptyInfoPublicBlog ¶
func EmptyInfoPublicBlog() *PublicBlog
func NewPublicBlog ¶
func (*PublicBlog) GetValue ¶
func (d *PublicBlog) GetValue() *PublicBlog
func (*PublicBlog) ValidateErrors ¶
func (b *PublicBlog) ValidateErrors(errs validator.ValidationErrors) ([]string, error)
type UpdateBlog ¶
type UpdateBlog struct { ID primitive.ObjectID `json:"_id" binding:"required" validate:"required"` Title *string `json:"title" validate:"omitempty,min=3,max=500"` Description *string `json:"description" validate:"omitempty,min=3,max=2000"` DraftText *string `json:"draftText" validate:"omitempty,max=50000"` Slug *string `json:"slug" validate:"omitempty,min=3,max=200"` ImgURL *string `json:"imgUrl" validate:"omitempty,uri,max=200"` Tags *[]string `json:"tags" validate:"omitempty,min=1,dive,uppercase"` }
func EmptyUpdateBlog ¶
func EmptyUpdateBlog() *UpdateBlog
func (*UpdateBlog) GetValue ¶
func (d *UpdateBlog) GetValue() *UpdateBlog
func (*UpdateBlog) ValidateErrors ¶
func (b *UpdateBlog) ValidateErrors(errs validator.ValidationErrors) ([]string, error)
Click to show internal directories.
Click to hide internal directories.