MCPcopy Index your code
hub / github.com/aptly-dev/aptly / apiReposPackagesShow

Function apiReposPackagesShow

api/repos.go:389–406  ·  view source on GitHub ↗

@Summary List Repo Packages @Description **Return a list of packages present in the repo** @Description @Description If `q` query parameter is missing, return all packages, otherwise return packages that match q @Description @Description **Example:** @Description ``` @Description $ curl http://local

(c *gin.Context)

Source from the content-addressed store, hash-verified

387// @Failure 404 {object} Error "Internal Server Error"
388// @Router /api/repos/{name}/packages [get]
389func apiReposPackagesShow(c *gin.Context) {
390 collectionFactory := context.NewCollectionFactory()
391 collection := collectionFactory.LocalRepoCollection()
392
393 repo, err := collection.ByName(c.Params.ByName("name"))
394 if err != nil {
395 AbortWithJSONError(c, 404, err)
396 return
397 }
398
399 err = collection.LoadComplete(repo)
400 if err != nil {
401 AbortWithJSONError(c, 500, err)
402 return
403 }
404
405 showPackages(c, repo.RefList(), collectionFactory)
406}
407
408type reposPackagesAddDeleteParams struct {
409 // Package Refs

Callers

nothing calls this directly

Calls 7

LocalRepoCollectionMethod · 0.95
AbortWithJSONErrorFunction · 0.85
showPackagesFunction · 0.85
NewCollectionFactoryMethod · 0.80
ByNameMethod · 0.45
LoadCompleteMethod · 0.45
RefListMethod · 0.45

Tested by

no test coverage detected