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

Function isValid

kontrol/kites.go:45–59  ·  view source on GitHub ↗
(k *protocol.Kite, c version.Constraints, keyRest string)

Source from the content-addressed store, hash-verified

43}
44
45func isValid(k *protocol.Kite, c version.Constraints, keyRest string) bool {
46 // Check the version constraint.
47 v, _ := version.NewVersion(k.Version)
48 if !c.Check(v) {
49 return false
50 }
51
52 // Check the fields after version field.
53 kiteKeyAfterVersion := "/" + strings.TrimRight(k.Region+"/"+k.Hostname+"/"+k.ID, "/")
54 if !strings.HasPrefix(kiteKeyAfterVersion, keyRest) {
55 return false
56 }
57
58 return true
59}

Callers 2

FilterMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected