diff --git a/main.go b/main.go index f239d4f..29e7747 100644 --- a/main.go +++ b/main.go @@ -17,15 +17,25 @@ type Link struct { Title string `json:"title"` } +// Healthcheck route +// +// Confirms that the app is alive without guarantees +// about it being fully-functional. func healthcheck(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) } +// About page +// +// Static content for the about page. func about(w http.ResponseWriter, r *http.Request) { tmpl, _ := template.New("about.html.tmpl").ParseFiles("templates/about.html.tmpl") tmpl.Execute(w, nil) } +// Feeds list +// +// Lists all feed elements in store. func listContent(w http.ResponseWriter, r *http.Request) { links := []Link{} for _, feed := range SharedCache.List("feeds") { @@ -38,6 +48,10 @@ func listContent(w http.ResponseWriter, r *http.Request) { tmpl.Execute(w, links) } +// Manage content +// +// Interface to add new feed subscriptions and get a list +// of current subs. func manageContent(w http.ResponseWriter, r *http.Request) { if r.Method == "POST" { r.ParseForm()