MCPcopy Create free account
hub / github.com/aptly-dev/aptly / apiReady

Function apiReady

api/api.go:66–76  ·  view source on GitHub ↗

@Summary Get Ready State @Description **Get aptly ready state** @Description @Description Return aptly ready state: @Description - `Aptly is ready` (HTTP 200) @Description - `Aptly is unavailable` (HTTP 503) @Tags Status @Produce json @Success 200 {object} aptlyStatus "Aptly is ready" @Failure 503 {

(isReady *atomic.Value)

Source from the content-addressed store, hash-verified

64// @Failure 503 {object} aptlyStatus "Aptly is unavailable"
65// @Router /api/ready [get]
66func apiReady(isReady *atomic.Value) func(*gin.Context) {
67 return func(c *gin.Context) {
68 if isReady == nil || !isReady.Load().(bool) {
69 c.JSON(503, gin.H{"Status": "Aptly is unavailable"})
70 return
71 }
72
73 status := aptlyStatus{Status: "Aptly is ready"}
74 c.JSON(200, status)
75 }
76}
77
78// @Summary Get Health State
79// @Description **Get aptly health state**

Callers 2

SetUpTestMethod · 0.85
RouterFunction · 0.85

Calls

no outgoing calls

Tested by 1

SetUpTestMethod · 0.68