http: use Gin web framework to reduce API boilerplate

This commit is contained in:
Vincent Bernat
2022-04-10 22:12:01 +02:00
parent 991f42da93
commit 50ca1987b2
21 changed files with 237 additions and 152 deletions

View File

@@ -21,7 +21,7 @@ func TestServeDocs(t *testing.T) {
Path string
Expect string
}{
{"usage", `<a href=\"configuration\">configuration section</a>`},
{"usage", `\u003ca href=\"configuration\"\u003econfiguration section\u003c/a\u003e`},
{"intro", `data:image/svg`},
}
for _, tc := range cases {
@@ -49,6 +49,7 @@ func TestServeDocs(t *testing.T) {
}
body, _ := ioutil.ReadAll(resp.Body)
if !strings.Contains(string(body), tc.Expect) {
t.Logf("Body:\n%s", string(body))
t.Errorf("GET /api/v0/docs/%s: does not contain %q",
tc.Path, tc.Expect)
}