summaryrefslogtreecommitdiff
path: root/pkg/api/list.go
blob: 812bb0fa87cd15be275a5d9a2cb32799938bf8a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
}