idecnode/pkg/api/list.go

23 lines
425 B
Go
Raw Normal View History

2024-10-20 03:39:07 +03:00
package api
import (
"fmt"
"net/http"
)
func (a *API) getListHandler(w http.ResponseWriter, r *http.Request) {
echos, err := a.idec.GetEchos()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
for _, e := range echos {
fmt.Fprintf(w, "%s:%d:%s\n", e.Name, e.Count, e.Description)
}
}
func (a *API) getBlacklistTxtHandler(w http.ResponseWriter, r *http.Request) {
// TODO
}