Added webapp Dashboard + logic to interact with server.
[src/xds/xds-agent.git] / lib / agent / apiv1-browse.go
diff --git a/lib/agent/apiv1-browse.go b/lib/agent/apiv1-browse.go
new file mode 100644 (file)
index 0000000..1701a2e
--- /dev/null
@@ -0,0 +1,28 @@
+package agent
+
+import (
+       "net/http"
+
+       "github.com/gin-gonic/gin"
+)
+
+type directory struct {
+       Name     string `json:"name"`
+       Fullpath string `json:"fullpath"`
+}
+
+type apiDirectory struct {
+       Dir []directory `json:"dir"`
+}
+
+// browseFS used to browse local file system
+func (s *APIService) browseFS(c *gin.Context) {
+
+       response := apiDirectory{
+               Dir: []directory{
+                       directory{Name: "TODO SEB"},
+               },
+       }
+
+       c.JSON(http.StatusOK, response)
+}