mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-08-19 04:06:27 +00:00
Add fscache reader handler
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user