idecnode/pkg/api/list.go

22 lines
425 B
Go

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
}