@Summary Serve Packages @Description If ServeInAPIMode is enabled in aptly config, @Description this api serves a specified package from storage @Tags Repos @Param storage path string true "Storage" @Param pkgPath path string true "Package Path" allowReserved=true @Produce json @Success 200 "" @Rout
(c *gin.Context)
| 51 | // @Success 200 "" |
| 52 | // @Router /repos/{storage}/{pkgPath} [get] |
| 53 | func reposServeInAPIMode(c *gin.Context) { |
| 54 | pkgpath := c.Param("pkgPath") |
| 55 | |
| 56 | storage := c.Param("storage") |
| 57 | if storage == "-" { |
| 58 | storage = "" |
| 59 | } else { |
| 60 | storage = "filesystem:" + storage |
| 61 | } |
| 62 | |
| 63 | ps, err := context.GetPublishedStorage(storage) |
| 64 | if err != nil { |
| 65 | AbortWithJSONError(c, http.StatusNotFound, err) |
| 66 | return |
| 67 | } |
| 68 | publicPath := ps.(aptly.FileSystemPublishedStorage).PublicPath() |
| 69 | c.FileFromFS(pkgpath, http.Dir(publicPath)) |
| 70 | } |
| 71 | |
| 72 | // @Summary List Repositories |
| 73 | // @Description **Get list of available repos** |
nothing calls this directly
no test coverage detected