MCPcopy
hub / github.com/lxc/incus / validateName

Method validateName

internal/server/network/zone/zone.go:153–165  ·  view source on GitHub ↗

validateName checks name is valid.

(name string)

Source from the content-addressed store, hash-verified

151
152// validateName checks name is valid.
153func (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.
168func (d *zone) validateConfig(info *api.NetworkZonePut) error {

Callers 1

AddRecordMethod · 0.95

Calls 1

IsAPINameFunction · 0.92

Tested by

no test coverage detected