()
| 79 | } |
| 80 | |
| 81 | func (k *Kite) Validate() error { |
| 82 | s := k.String() |
| 83 | if strings.Contains(s, "//") { |
| 84 | return errors.New("empty field") |
| 85 | } |
| 86 | if strings.Count(s, "/") != 7 { |
| 87 | return errors.New(`fields cannot contain "/"`) |
| 88 | } |
| 89 | return nil |
| 90 | } |
| 91 | |
| 92 | // KiteFromString returns a new Kite string from the given string |
| 93 | // representation in the form of "/username/environment/...". It's the inverse |