Documentation ¶
Index ¶
- Constants
- func CNAME(tenants storage.Tenant, cname string) []string
- func Email(email string) []string
- func ImageUpload(upload *models.ImageUpload, opts ImageUploadOpts) ([]string, error)
- func MultiImageUpload(currentAttachments []string, uploads []*models.ImageUpload, ...) ([]string, error)
- func Subdomain(tenants storage.Tenant, subdomain string) ([]string, error)
- func URL(rawurl string) []string
- type ErrorItem
- type ImageUploadOpts
- type MultiImageUploadOpts
- type Result
- type Validatable
Constants ¶
View Source
const MaxDimensionSize = 1500
MaxDimensionSize is the max width/height of an image. If image is bigger than this, it'll be resized.
Variables ¶
This section is empty.
Functions ¶
func ImageUpload ¶ added in v0.15.0
func ImageUpload(upload *models.ImageUpload, opts ImageUploadOpts) ([]string, error)
ImageUpload validates given image upload
func MultiImageUpload ¶ added in v0.18.0
func MultiImageUpload(currentAttachments []string, uploads []*models.ImageUpload, opts MultiImageUploadOpts) ([]string, error)
MultiImageUpload validates multiple image uploads
Types ¶
type ImageUploadOpts ¶ added in v0.18.0
type ImageUploadOpts struct { IsRequired bool MinWidth int MinHeight int ExactRatio bool MaxKilobytes int }
ImageUploadOpts arguments to validate given upload
type MultiImageUploadOpts ¶ added in v0.18.0
type MultiImageUploadOpts struct { MaxUploads int IsRequired bool MinWidth int MinHeight int ExactRatio bool MaxKilobytes int }
MultiImageUploadOpts arguments to validate mulitple image upload process
type Result ¶
Result is returned after each validation
func Unauthorized ¶
func Unauthorized() *Result
Unauthorized returns an unauthorized validation result
func (*Result) AddFieldFailure ¶
AddFieldFailure add failure message to specific field
Click to show internal directories.
Click to hide internal directories.