this repo has no description
13
fork

Configure Feed

Select the types of activity you want to include in your feed.

another simpler query template

+39 -4
+8 -4
cmd/glot/lex_new.go
··· 16 16 //go:embed lexicon-templates/record.json 17 17 var tmplRecord string 18 18 19 + //go:embed lexicon-templates/query.json 20 + var tmplQuery string 21 + 19 22 //go:embed lexicon-templates/query-view.json 20 23 var tmplQueryView string 21 24 ··· 60 63 fmt.Println("Available schema templates:") 61 64 fmt.Println("") 62 65 fmt.Println(" record") 66 + fmt.Println(" query") 63 67 fmt.Println(" query-view") 64 68 fmt.Println(" query-list") 65 69 fmt.Println(" procedure") 70 + fmt.Println("") 66 71 return nil 67 72 } 68 73 ··· 81 86 switch schemaType { 82 87 case "record": 83 88 orig = []byte(tmplRecord) 89 + case "query": 90 + orig = []byte(tmplQuery) 84 91 case "query-view": 85 92 orig = []byte(tmplQueryView) 86 93 case "query-list": ··· 93 100 94 101 d, err := atdata.UnmarshalJSON(orig) 95 102 if err != nil { 96 - fmt.Println(orig) 97 - fmt.Println(tmplRecord) 98 - return fmt.Errorf("XXX") 99 - //return err 103 + return err 100 104 } 101 105 d["id"] = nsid.String() 102 106
+31
cmd/glot/lexicon-templates/query.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.example.getNumber", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "TODO: basic API endpoint", 8 + "parameters": { 9 + "type": "params", 10 + "properties": { 11 + "maximum": { 12 + "type": "integer", 13 + "description": "maximum size of response" 14 + } 15 + } 16 + }, 17 + "output": { 18 + "encoding": "application/json", 19 + "schema": { 20 + "type": "object", 21 + "required": ["number"], 22 + "properties": { 23 + "number": { 24 + "type": "integer" 25 + } 26 + } 27 + } 28 + } 29 + } 30 + } 31 + }