mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-30 09:27:57 +00:00
c63324756b
Make sure pathCache is properly locked for concurrent access. Add RWMutex to the PublishedStorage struct: - Cache initialization Read-lock to test for nil, then write-lock with a second nil check before populating - Cache reads RLock/RUnlock, allowing concurrent readers - Cache writes / deletes Lock/Unlock
23 lines
461 B
Go
23 lines
461 B
Go
package api
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// @Summary S3 buckets
|
|
// @Description **Get list of S3 buckets**
|
|
// @Description
|
|
// @Description List configured S3 buckets.
|
|
// @Tags Status
|
|
// @Produce json
|
|
// @Success 200 {array} string "List of S3 buckets"
|
|
// @Router /api/s3 [get]
|
|
func apiS3List(c *gin.Context) {
|
|
keys := []string{}
|
|
s3Roots := context.Config().S3PublishRoots
|
|
for k := range s3Roots {
|
|
keys = append(keys, k)
|
|
}
|
|
c.JSON(200, keys)
|
|
}
|