Documentation ¶
Index ¶
- type CreateCategoryForm
- type CreateCommentForm
- type CreateCommentReplyForm
- type CreatePageForm
- type CreatePostForm
- type CreateUserForm
- type PasswordConfirmForm
- type SignInForm
- type UpdateCategoryForm
- type UpdateMeForm
- type UpdateMePasswordForm
- type UpdatePageForm
- type UpdatePostForm
- func (form *UpdatePostForm) ToPostModel(post *models.PostModel, postContent *models.PostContentModel) (updatedPost *models.PostModel, updatedPostContent *models.PostContentModel, ...)
- func (form *UpdatePostForm) Validate(svc *service.Service, ctx context.Context, target *models.PostModel) (err error)
- type UpdateUserForm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateCategoryForm ¶
type CreateCategoryForm struct { Slug string `json:"slug" binding:"required,alphanum,max=100"` Name string `json:"name" binding:"required,max=100"` }
func (*CreateCategoryForm) ToCategoryModel ¶
func (form *CreateCategoryForm) ToCategoryModel() (model *models.CategoryModel)
type CreateCommentForm ¶
type CreateCommentForm struct { PostUid string `json:"postUid" binding:"required,alphanum,len=24"` Email string `json:"email" binding:"required,email"` Name string `json:"name" binding:"required,max=50"` Content string `json:"content" bindinng:"required,max=255"` // contains filtered or unexported fields }
func (*CreateCommentForm) ToCommentModel ¶
func (form *CreateCommentForm) ToCommentModel() (model *models.CommentModel, err error)
type CreateCommentReplyForm ¶
type CreateCommentReplyForm struct { ParentCommentUid string `json:"commentUid" binding:"required,len=24"` Email string `json:"email" binding:"required,email"` Name string `json:"name" binding:"required,max=50"` Content string `json:"content" binding:"required,max=255"` // contains filtered or unexported fields }
func (*CreateCommentReplyForm) ToCommentReplyModel ¶
func (form *CreateCommentReplyForm) ToCommentReplyModel() (model *models.CommentModel, err error)
func (*CreateCommentReplyForm) Validate ¶
func (form *CreateCommentReplyForm) Validate( svc *service.Service, ctx context.Context, ) (parentComment *models.CommentModel, err error)
type CreatePageForm ¶
type CreatePageForm struct { Slug string `json:"slug" binding:"required,max=100"` Title string `json:"title" binding:"required,max=100"` Content string `json:"content" binding:"required"` PublishNow bool `json:"publishNow" binding:"omitempty"` }
func (*CreatePageForm) ToPageModel ¶
func (form *CreatePageForm) ToPageModel(author *models.UserModel) ( page *models.PageModel, content *models.PageContentModel, err error, )
type CreatePostForm ¶
type CreatePostForm struct { Slug string `json:"slug" binding:"required,alphanum,max=100"` Title string `json:"title" binding:"required,max=100"` Description string `json:"description" binding:"omitempty,max=255"` FeaturingImagePath string `json:"featuringImagePath" binding:"omitempty,url"` Categories []string `json:"categories" binding:"required,dive,len=24"` Tags []string `json:"tags" binding:"omitempty,dive,alphanum,max=32"` Content string `json:"content" binding:"required"` PublishNow bool `json:"publishNow" binding:"omitempty"` // contains filtered or unexported fields }
func (*CreatePostForm) ToPostModel ¶
func (form *CreatePostForm) ToPostModel(author *models.UserModel) ( post *models.PostModel, content *models.PostContentModel, err error, )
type CreateUserForm ¶
type CreateUserForm struct { FirstName string `json:"firstName" binding:"max=50"` LastName string `json:"lastName" binding:"max=50"` Username string `json:"username" binding:"required,alphanum,min=5,max=16"` Email string `json:"email" binding:"required,email"` Password string `json:"password" binding:"required,min=8,max=32"` PasswordConfirm string `json:"passwordConfirm" binding:"required,min=8,max=32"` Roles []int `json:"roles" binding:"omitempty,dive,number"` }
func (*CreateUserForm) ToUserModel ¶
func (form *CreateUserForm) ToUserModel() (user *models.UserModel, err error)
type PasswordConfirmForm ¶
type PasswordConfirmForm struct {
Password string `json:"password" binding:"required"`
}
type SignInForm ¶
type UpdateCategoryForm ¶
type UpdateCategoryForm struct { Slug string `json:"slug" binding:"omitempty,max=100"` Name string `json:"name" binding:"omitempty,max=100"` }
func (*UpdateCategoryForm) ToCategoryModel ¶
func (form *UpdateCategoryForm) ToCategoryModel( category *models.CategoryModel, ) (updatedCategory *models.CategoryModel)
func (*UpdateCategoryForm) Validate ¶
func (form *UpdateCategoryForm) Validate( svc *service.Service, ctx context.Context, target *models.CategoryModel, ) (err error)
type UpdateMeForm ¶
type UpdateMeForm struct { FirstName string `json:"firstname" binding:"omitempty,max=50"` LastName string `json:"lastname" binding:"omitempty,max=50"` Username string `json:"username" binding:"omitempty,min=5,max=16"` Email string `json:"email" binding:"omitempty,email"` }
func (*UpdateMeForm) ToUserModel ¶
func (form *UpdateMeForm) ToUserModel( me *models.UserModel, ) (updatedMe *models.UserModel)
type UpdateMePasswordForm ¶
type UpdateMePasswordForm struct { NewPassword string `json:"newpassword" bind:"required,min=8,max=32"` NewPasswordConfirm string `json:"newpasswordconfirm" bind:"required,min=8,max=32"` }
func (*UpdateMePasswordForm) ToUserModel ¶
type UpdatePageForm ¶
type UpdatePageForm struct { Slug string `json:"slug" binding:"omitempty,max=100"` Title string `json:"title" binding:"omitempty,max=100"` Content string `json:"content" binding:"omitempty"` PublishNow bool `json:"publishNow" binding:"omitempty"` }
func (*UpdatePageForm) ToPageModel ¶
func (form *UpdatePageForm) ToPageModel( page *models.PageModel, pageContent *models.PageContentModel, ) ( updatedPage *models.PageModel, updatedPageContent *models.PageContentModel, err error, )
type UpdatePostForm ¶
type UpdatePostForm struct { Slug string `json:"slug" binding:"omitempty,alphanum,max=100"` Title string `json:"title" binding:"omitempty,max=100"` Description string `json:"description" binding:"omitempty,max=255"` FeaturingImagePath string `json:"featuringImagePath" binding:"omitempty,url"` Categories []string `json:"categories" binding:"omitempty,dive,len=24"` Tags []string `json:"tags" binding:"omitempty,dive,max=32"` Content string `json:"content" binding:"omitempty"` PublishNow bool `json:"publishNow" binding:"omitempty"` // contains filtered or unexported fields }
func (*UpdatePostForm) ToPostModel ¶
func (form *UpdatePostForm) ToPostModel( post *models.PostModel, postContent *models.PostContentModel, ) ( updatedPost *models.PostModel, updatedPostContent *models.PostContentModel, err error, )
type UpdateUserForm ¶
type UpdateUserForm struct { FirstName string `json:"firstName" binding:"omitempty,max=50"` LastName string `json:"lastName" binding:"omitempty,max=50"` Username string `json:"username" binding:"omitempty,alphanum,min=5,max=16"` Email string `json:"email" binding:"omitempty,email"` Password string `json:"password" binding:"omitempty,min=8,max=32"` PasswordConfirm string `json:"passwordConfirm" binding:"omitempty,min=8,max=32"` Roles []int `json:"roles" binding:"omitempty,dive,number"` }
func (*UpdateUserForm) ToUserModel ¶
Click to show internal directories.
Click to hide internal directories.