mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Add some documentation to packages (#21648)
In #21637 it was mentioned that the purpose of the API routes for the packages is unclear. This PR adds some documentation. Fix #21637 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
		| @@ -40,7 +40,9 @@ func reqPackageAccess(accessMode perm.AccessMode) func(ctx *context.Context) { | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func Routes(ctx gocontext.Context) *web.Route { | ||||
| // CommonRoutes provide endpoints for most package managers (except containers - see below) | ||||
| // These are mounted on `/api/packages` (not `/api/v1/packages`) | ||||
| func CommonRoutes(ctx gocontext.Context) *web.Route { | ||||
| 	r := web.NewRoute() | ||||
|  | ||||
| 	r.Use(context.PackageContexter(ctx)) | ||||
| @@ -301,6 +303,9 @@ func Routes(ctx gocontext.Context) *web.Route { | ||||
| 	return r | ||||
| } | ||||
|  | ||||
| // ContainerRoutes provides endpoints that implement the OCI API to serve containers | ||||
| // These have to be mounted on `/v2/...` to comply with the OCI spec: | ||||
| // https://github.com/opencontainers/distribution-spec/blob/main/spec.md | ||||
| func ContainerRoutes(ctx gocontext.Context) *web.Route { | ||||
| 	r := web.NewRoute() | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user