(k *protocol.Kite, c version.Constraints, keyRest string)
| 43 | } |
| 44 | |
| 45 | func 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 | } |
no outgoing calls
no test coverage detected