MCPcopy Index your code
hub / github.com/writefreely/writefreely / viewLocalTimelineAPI

Function viewLocalTimelineAPI

read.go:132–143  ·  view source on GitHub ↗
(app *App, w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

130}
131
132func viewLocalTimelineAPI(app *App, w http.ResponseWriter, r *http.Request) error {
133 updateTimelineCache(app.timeline, false)
134
135 skip, _ := strconv.Atoi(r.FormValue("skip"))
136
137 posts := []PublicPost{}
138 for i := skip; i < skip+tlAPIPageLimit && i < len(*app.timeline.posts); i++ {
139 posts = append(posts, (*app.timeline.posts)[i])
140 }
141
142 return impart.WriteSuccess(w, posts, http.StatusOK)
143}
144
145func viewLocalTimeline(app *App, w http.ResponseWriter, r *http.Request) error {
146 if !app.cfg.App.LocalTimeline {

Callers

nothing calls this directly

Calls 1

updateTimelineCacheFunction · 0.85

Tested by

no test coverage detected