validateName checks name is valid.
(name string)
| 151 | |
| 152 | // validateName checks name is valid. |
| 153 | func (d *zone) validateName(name string) error { |
| 154 | // Allow root records. |
| 155 | if name == "@" { |
| 156 | return nil |
| 157 | } |
| 158 | |
| 159 | // Allow wildcards. |
| 160 | if strings.HasPrefix(name, "*.") { |
| 161 | return nil |
| 162 | } |
| 163 | |
| 164 | return validate.IsAPIName(name, false) |
| 165 | } |
| 166 | |
| 167 | // validateConfig checks the config and rules are valid. |
| 168 | func (d *zone) validateConfig(info *api.NetworkZonePut) error { |