martini handler to help paginate from query string
Go
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
example.go
paginate.go

README.md

martini-paginate
  pagination helper for martini

example:
  m := martini.Classic()
  m := Get("/test", Paginator, TestHandler)

  func TestHandler(paging *Paginate, r *http.Request, w http.ResponseWriter) (int, string) {
        return http.StatusOK, string("page: " + strconv.Itoa(paging.Page()) + ", per_page: " + strconv.Itoa(paging.Limit()) + ", skip: " + strconv.Itoa(paging.Skip()))
  }

  curl http://localhost:3000/test?page=1&per_page=40