mirror of
https://github.com/andatoshiki/shikigrid.git
synced 2026-06-05 19:56:27 +00:00
22 lines
362 B
Go
22 lines
362 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func (api *API) PeerListUnits(w http.ResponseWriter, r *http.Request) {
|
|
page, err := pageNum(r)
|
|
if err != nil {
|
|
ERROR(w, http.StatusUnprocessableEntity, err)
|
|
return
|
|
}
|
|
|
|
obj, err := api.Client.PagedUnits(page)
|
|
if err != nil {
|
|
ERROR(w, http.StatusUnprocessableEntity, err)
|
|
return
|
|
}
|
|
|
|
JSON(w, http.StatusOK, obj)
|
|
}
|