cache.go 458 B

1234567891011121314151617181920212223
  1. package clashapi
  2. import (
  3. "net/http"
  4. "github.com/go-chi/chi/v5"
  5. "github.com/go-chi/render"
  6. )
  7. func cacheRouter() http.Handler {
  8. r := chi.NewRouter()
  9. r.Post("/fakeip/flush", flushFakeip)
  10. return r
  11. }
  12. func flushFakeip(w http.ResponseWriter, r *http.Request) {
  13. /*if err := cachefile.Cache().FlushFakeip(); err != nil {
  14. render.Status(r, http.StatusInternalServerError)
  15. render.JSON(w, r, newError(err.Error()))
  16. return
  17. }*/
  18. render.NoContent(w, r)
  19. }