feat(database): initial commit

This commit is contained in:
ssbkang
2019-07-22 23:33:47 +12:00
parent cc487ae68a
commit 3e0ec6a379
8 changed files with 136 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
package database
import (
"net/http"
"github.com/gorilla/mux"
httperror "github.com/portainer/libhttp/error"
portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/http/security"
)
// Handler is the HTTP handler used to handle webhook operations.
type Handler struct {
*mux.Router
DatabaseService portainer.DatabaseService
FileService portainer.FileService
}
// NewHandler creates a handler to manage settings operations.
func NewHandler(bouncer *security.RequestBouncer) *Handler {
h := &Handler{
Router: mux.NewRouter(),
}
h.Handle("/database",
//bouncer.RestrictedAccess(httperror.LoggerHandler(h.databaseExport))).Methods(http.MethodGet)
bouncer.PublicAccess(httperror.LoggerHandler(h.databaseExport))).Methods(http.MethodGet)
return h
}