forms

package
v0.0.0-...-fa656b6 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateFullName

func ValidateFullName(fl validator.FieldLevel) bool

ValidateFullName implements validator.Func

Types

type ArticleForm

type ArticleForm struct{}

ArticleForm ...

func (ArticleForm) Content

func (f ArticleForm) Content(tag string, errMsg ...string) (message string)

Content ...

func (ArticleForm) Create

func (f ArticleForm) Create(err error) string

Create ...

func (ArticleForm) Title

func (f ArticleForm) Title(tag string, errMsg ...string) (message string)

Title ...

func (ArticleForm) Update

func (f ArticleForm) Update(err error) string

Update ...

type CreateArticleForm

type CreateArticleForm struct {
	Title   string `form:"title" json:"title" binding:"required,min=3,max=100"`
	Content string `form:"content" json:"content" binding:"required,min=3,max=1000"`
}

CreateArticleForm ...

type DefaultValidator

type DefaultValidator struct {
	// contains filtered or unexported fields
}

DefaultValidator ...

func (*DefaultValidator) Engine

func (v *DefaultValidator) Engine() interface{}

Engine ...

func (*DefaultValidator) ValidateStruct

func (v *DefaultValidator) ValidateStruct(obj interface{}) error

ValidateStruct ...

type LoginForm

type LoginForm struct {
	Email    string `form:"email" json:"email" binding:"required,email"`
	Password string `form:"password" json:"password" binding:"required,min=3,max=50"`
}

LoginForm ...

type RegisterForm

type RegisterForm struct {
	Name     string `form:"name" json:"name" binding:"required,min=3,max=20,fullName"` //fullName rule is in validator.go
	Email    string `form:"email" json:"email" binding:"required,email"`
	Password string `form:"password" json:"password" binding:"required,min=3,max=50"`
}

RegisterForm ...

type Token

type Token struct {
	RefreshToken string `form:"refresh_token" json:"refresh_token" binding:"required"`
}

Token ...

type UserForm

type UserForm struct{}

UserForm ...

func (UserForm) Email

func (f UserForm) Email(tag string, errMsg ...string) (message string)

Email ...

func (UserForm) Login

func (f UserForm) Login(err error) string

Signin ...

func (UserForm) Name

func (f UserForm) Name(tag string, errMsg ...string) (message string)

Name ...

func (UserForm) Password

func (f UserForm) Password(tag string) (message string)

Password ...

func (UserForm) Register

func (f UserForm) Register(err error) string

Register ...

Jump to

Keyboard shortcuts

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