Check lengths

This commit is contained in:
rxdn 2022-07-12 22:38:20 +01:00
parent f44912eca9
commit 5c617fd293

View File

@ -9,11 +9,11 @@ import (
type CustomEmbed struct { type CustomEmbed struct {
Title *string `json:"title" validate:"omitempty,min=1,max=255"` Title *string `json:"title" validate:"omitempty,min=1,max=255"`
Description *string `json:"description" validate:"omitempty,min=1,max=4096"` Description *string `json:"description" validate:"omitempty,min=1,max=4096"`
Url *string `json:"url" validate:"omitempty,url"` Url *string `json:"url" validate:"omitempty,url,max=255"`
Colour Colour `json:"colour" validate:"required,gte=0,lte=16777215"` Colour Colour `json:"colour" validate:"required,gte=0,lte=16777215"`
Author Author `json:"author" validate:"dive"` Author Author `json:"author" validate:"dive"`
ImageUrl *string `json:"image_url" validate:"omitempty,url"` ImageUrl *string `json:"image_url" validate:"omitempty,url,max=255"`
ThumbnailUrl *string `json:"thumbnail_url" validate:"omitempty,url"` ThumbnailUrl *string `json:"thumbnail_url" validate:"omitempty,url,max=255"`
Footer Footer `json:"footer" validate:"dive"` Footer Footer `json:"footer" validate:"dive"`
Timestamp *DateTimeLocal `json:"timestamp" validate:"omitempty"` Timestamp *DateTimeLocal `json:"timestamp" validate:"omitempty"`
Fields []Field `json:"fields" validate:"dive,max=25"` Fields []Field `json:"fields" validate:"dive,max=25"`
@ -21,13 +21,13 @@ type CustomEmbed struct {
type Author struct { type Author struct {
Name *string `json:"name" validate:"omitempty,min=1,max=255"` Name *string `json:"name" validate:"omitempty,min=1,max=255"`
IconUrl *string `json:"icon_url" validate:"omitempty,url"` IconUrl *string `json:"icon_url" validate:"omitempty,url,max=255"`
Url *string `json:"url" validate:"omitempty,url"` Url *string `json:"url" validate:"omitempty,url,max=255"`
} }
type Footer struct { type Footer struct {
Text *string `json:"text" validate:"omitempty,min=1,max=2048"` Text *string `json:"text" validate:"omitempty,min=1,max=2048"`
IconUrl *string `json:"icon_url" validate:"omitempty,url"` IconUrl *string `json:"icon_url" validate:"omitempty,url,max=255"`
} }
type Field struct { type Field struct {