Documentation ¶
Index ¶
- Constants
- func CNAME(ctx context.Context, cname string) []string
- func Email(ctx context.Context, email string) []string
- func ImageUpload(ctx context.Context, upload *dto.ImageUpload, opts ImageUploadOpts) ([]string, error)
- func MultiImageUpload(ctx context.Context, currentAttachments []string, uploads []*dto.ImageUpload, ...) ([]string, error)
- func Subdomain(ctx context.Context, subdomain string) ([]string, error)
- func URL(ctx context.Context, 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 ¶
func ImageUpload(ctx context.Context, upload *dto.ImageUpload, opts ImageUploadOpts) ([]string, error)
ImageUpload validates given image upload
func MultiImageUpload ¶
func MultiImageUpload(ctx context.Context, currentAttachments []string, uploads []*dto.ImageUpload, opts MultiImageUploadOpts) ([]string, error)
MultiImageUpload validates multiple image uploads
Types ¶
type ImageUploadOpts ¶
type ImageUploadOpts struct { IsRequired bool MinWidth int MinHeight int ExactRatio bool MaxKilobytes int }
ImageUploadOpts arguments to validate given upload
type MultiImageUploadOpts ¶
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.