Use fqdn validator for domain name
This commit is contained in:
parent
09abef8dde
commit
bb154d5385
@ -10,7 +10,7 @@ import (
|
|||||||
type Host struct {
|
type Host struct {
|
||||||
gorm.Model
|
gorm.Model
|
||||||
Hostname string `gorm:"unique_index:idx_host_domain;not null" form:"hostname" validate:"required,hostname"`
|
Hostname string `gorm:"unique_index:idx_host_domain;not null" form:"hostname" validate:"required,hostname"`
|
||||||
Domain string `gorm:"unique_index:idx_host_domain;not null" form:"domain" validate:"required,hostname"`
|
Domain string `gorm:"unique_index:idx_host_domain;not null" form:"domain" validate:"required,fqdn"`
|
||||||
Ip string `form:"ip" validate:"omitempty,ipv4|ipv6"`
|
Ip string `form:"ip" validate:"omitempty,ipv4|ipv6"`
|
||||||
Ttl int `form:"ttl" validate:"required,min=20,max=86400"`
|
Ttl int `form:"ttl" validate:"required,min=20,max=86400"`
|
||||||
LastUpdate time.Time `form:"lastupdate"`
|
LastUpdate time.Time `form:"lastupdate"`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user