func ListBuckets(r render.Render, db database.Database) {
	if buckets, err := db.ListBuckets(); err != nil {
		JsonErrorf(r, http.StatusBadRequest, err.Error())
	} else {
		r.JSON(http.StatusOK, buckets)
	}
}
예제 #2
0
func ListBuckets(ctx context.Context, r render.Render, db database.Database) {
	if buckets, err := db.ListBuckets(); err != nil {
		LogAndRespondWithError(ctx, r, http.StatusBadRequest, err)
	} else {
		r.JSON(http.StatusOK, buckets)
	}
}