From 49746fe2fb55fea219d4cbc000e0cfc0cf1ae81a Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Mon, 20 Aug 2018 11:26:08 +0300 Subject: [PATCH] Add fscache reader handler --- pkg/api/configs.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pkg/api/configs.go diff --git a/pkg/api/configs.go b/pkg/api/configs.go new file mode 100644 index 0000000..b26a3ee --- /dev/null +++ b/pkg/api/configs.go @@ -0,0 +1,15 @@ +package api + +import "net/http" + +func (s *Server) configReadHandler(w http.ResponseWriter, r *http.Request) { + files := make(map[string]string) + if watcher != nil { + watcher.Cache.Range(func(key interface{}, value interface{}) bool { + files[key.(string)] = value.(string) + return true + }) + } + + s.JSONResponse(w, r, files) +}