validateKiteKey returns a string representing the kite uniquely that is suitable to use as a key for etcd.
(k *protocol.Kite)
| 298 | // validateKiteKey returns a string representing the kite uniquely |
| 299 | // that is suitable to use as a key for etcd. |
| 300 | func validateKiteKey(k *protocol.Kite) error { |
| 301 | fields := k.Query().Fields() |
| 302 | |
| 303 | // Validate fields. |
| 304 | for k, v := range fields { |
| 305 | if v == "" { |
| 306 | return fmt.Errorf("Empty Kite field: %s", k) |
| 307 | } |
| 308 | if strings.ContainsRune(v, '/') { |
| 309 | return fmt.Errorf("Field \"%s\" must not contain '/'", k) |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | return nil |
| 314 | } |
| 315 | |
| 316 | // onlyIDQuery returns true if the query contains only a non-empty ID and all |
| 317 | // others keys are empty |
no test coverage detected