MCPcopy Index your code
hub / github.com/koding/kite / validateKiteKey

Function validateKiteKey

kontrol/etcd.go:300–314  ·  view source on GitHub ↗

validateKiteKey returns a string representing the kite uniquely that is suitable to use as a key for etcd.

(k *protocol.Kite)

Source from the content-addressed store, hash-verified

298// validateKiteKey returns a string representing the kite uniquely
299// that is suitable to use as a key for etcd.
300func 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

Callers 2

HandleRegisterHTTPMethod · 0.85
HandleRegisterMethod · 0.85

Calls 2

FieldsMethod · 0.80
QueryMethod · 0.80

Tested by

no test coverage detected