File: packages.go

package info (click to toggle)
aptly 1.4.0%2Bds1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 48,064 kB
  • sloc: python: 7,045; sh: 790; makefile: 77
file content (16 lines) | stat: -rw-r--r-- 292 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package api

import (
	"github.com/gin-gonic/gin"
)

// GET /api/packages/:key
func apiPackagesShow(c *gin.Context) {
	p, err := context.CollectionFactory().PackageCollection().ByKey([]byte(c.Params.ByName("key")))
	if err != nil {
		c.AbortWithError(404, err)
		return
	}

	c.JSON(200, p)
}