mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
Merge branch 'lebauce-api-version'
This commit is contained in:
+10
@@ -1,8 +1,18 @@
|
|||||||
// Package api provides implementation of aptly REST API
|
// Package api provides implementation of aptly REST API
|
||||||
package api
|
package api
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
|
"github.com/smira/aptly/aptly"
|
||||||
|
)
|
||||||
|
|
||||||
// Lock order acquisition (canonical):
|
// Lock order acquisition (canonical):
|
||||||
// 1. RemoteRepoCollection
|
// 1. RemoteRepoCollection
|
||||||
// 2. LocalRepoCollection
|
// 2. LocalRepoCollection
|
||||||
// 3. SnapshotCollection
|
// 3. SnapshotCollection
|
||||||
// 4. PublishedRepoCollection
|
// 4. PublishedRepoCollection
|
||||||
|
|
||||||
|
// GET /api/version
|
||||||
|
func apiVersion(c *gin.Context) {
|
||||||
|
c.JSON(200, gin.H{"Version": aptly.Version})
|
||||||
|
}
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ func Router(c *ctx.AptlyContext) http.Handler {
|
|||||||
router.Use(gin.ErrorLogger())
|
router.Use(gin.ErrorLogger())
|
||||||
|
|
||||||
root := router.Group("/api")
|
root := router.Group("/api")
|
||||||
|
|
||||||
|
{
|
||||||
|
root.GET("/version", apiVersion)
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
root.GET("/repos", apiReposList)
|
root.GET("/repos", apiReposList)
|
||||||
root.POST("/repos", apiReposCreate)
|
root.POST("/repos", apiReposCreate)
|
||||||
|
|||||||
@@ -5,3 +5,4 @@ Testing aptly REST API
|
|||||||
from .repos import *
|
from .repos import *
|
||||||
from .files import *
|
from .files import *
|
||||||
from .publish import *
|
from .publish import *
|
||||||
|
from .version import *
|
||||||
Reference in New Issue
Block a user