@Summary Serve HTML Listing @Description If ServeInAPIMode is enabled in aptly config, @Description this endpoint is enabled which returns an HTML listing of each repo that can be browsed @Tags Repos @Produce html @Success 200 {object} string "HTML" @Router /repos [get]
(localRepos map[string]utils.FileSystemPublishRoot)
| 26 | // @Success 200 {object} string "HTML" |
| 27 | // @Router /repos [get] |
| 28 | func reposListInAPIMode(localRepos map[string]utils.FileSystemPublishRoot) gin.HandlerFunc { |
| 29 | return func(c *gin.Context) { |
| 30 | c.Writer.Header().Set("Content-Type", "text/html; charset=utf-8") |
| 31 | c.Writer.Flush() |
| 32 | _, _ = c.Writer.WriteString("<pre>\n") |
| 33 | if len(localRepos) == 0 { |
| 34 | _, _ = c.Writer.WriteString("<a href=\"-/\">default</a>\n") |
| 35 | } |
| 36 | for publishPrefix := range localRepos { |
| 37 | _, _ = c.Writer.WriteString(fmt.Sprintf("<a href=\"%[1]s/\">%[1]s</a>\n", publishPrefix)) |
| 38 | } |
| 39 | _, _ = c.Writer.WriteString("</pre>") |
| 40 | c.Writer.Flush() |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | // @Summary Serve Packages |
| 45 | // @Description If ServeInAPIMode is enabled in aptly config, |
no test coverage detected