🎉 Add plugable storages abstraction layer (with support for fs, s3 and db).

This commit is contained in:
Andrey Antukh 2020-12-30 14:38:00 +01:00 committed by Alonso Torres
parent 9146642947
commit 760eb926bf
16 changed files with 893 additions and 17 deletions

View file

@ -74,9 +74,10 @@
(s/def ::google-auth map?)
(s/def ::gitlab-auth map?)
(s/def ::ldap-auth fn?)
(s/def ::storage map?)
(defmethod ig/pre-init-spec ::router [_]
(s/keys :req-un [::rpc ::session ::metrics ::google-auth ::gitlab-auth]))
(s/keys :req-un [::rpc ::session ::metrics ::google-auth ::gitlab-auth ::storage]))
(defmethod ig/init-key ::router
[_ cfg]
@ -87,9 +88,10 @@
(rr/create-default-handler))))
(defn- create-router
[{:keys [session rpc google-auth gitlab-auth metrics ldap-auth] :as cfg}]
[{:keys [session rpc google-auth gitlab-auth metrics ldap-auth storage] :as cfg}]
(rr/router
[["/metrics" {:get (:handler metrics)}]
["/storage/:id" {:get (:handler storage)}]
["/api" {:middleware [[middleware/format-response-body]
[middleware/parse-request-body]
[middleware/errors errors/handle]