SearchHelp returns JSON of an array of predicate names and descriptions.
()
| 89 | |
| 90 | // SearchHelp returns JSON of an array of predicate names and descriptions. |
| 91 | func SearchHelp() string { |
| 92 | type help struct{ Name, Description string } |
| 93 | h := []help{} |
| 94 | for _, p := range keywords { |
| 95 | h = append(h, help{p.Name(), p.Description()}) |
| 96 | } |
| 97 | b, err := json.MarshalIndent(h, "", " ") |
| 98 | if err != nil { |
| 99 | return "Error marshalling" |
| 100 | } |
| 101 | return string(b) |
| 102 | } |
| 103 | |
| 104 | func init() { |
| 105 | // Core predicates |