mirror of
https://github.com/speatzle/nfsense.git
synced 2025-09-13 15:19:08 +00:00
Remove old, broken Validation
This commit is contained in:
parent
e12a1fe16f
commit
f67ec52fae
13 changed files with 39 additions and 64 deletions
|
@ -6,10 +6,10 @@ import (
|
|||
)
|
||||
|
||||
type Interface struct {
|
||||
Alias string `json:"alias,omitempty" validate:"min=0,max=3"`
|
||||
Type InterfaceType `json:"type" validate:"min=0,max=3"`
|
||||
AddressingMode InterfaceAddressingMode `json:"addressing_mode" validate:"min=0,max=2"`
|
||||
Address *netip.Prefix `json:"address,omitempty" validate:"excluded_unless=AddressingMode 1"`
|
||||
Alias string `json:"alias,omitempty"`
|
||||
Type InterfaceType `json:"type"`
|
||||
AddressingMode InterfaceAddressingMode `json:"addressing_mode"`
|
||||
Address *netip.Prefix `json:"address,omitempty"`
|
||||
HardwareDevice *string `json:"hardware_device,omitempty"`
|
||||
// TODO fix Validator for int pointers with min=0,max=4094
|
||||
VlanID *uint `json:"vlan_id,omitempty"`
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package network
|
||||
|
||||
type Network struct {
|
||||
Interfaces map[string]Interface `json:"interfaces" validate:"required,dive"`
|
||||
StaticRoutes []StaticRoute `json:"static_routes" validate:"required,dive"`
|
||||
Interfaces map[string]Interface `json:"interfaces"`
|
||||
StaticRoutes []StaticRoute `json:"static_routes"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue