#hello
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
//"github.com/google/uuid" | |
"github.com/prometheus/client_golang/prometheus" | |
"github.com/prometheus/client_golang/prometheus/promhttp" | |
"math/rand" | |
"net/http" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[clojure.set :as set]) | |
(require '[clojure.string :as string]) | |
(def wildcard :*) | |
(defn permission-string->permission [perm-str] | |
(->> (string/split perm-str #":") | |
(mapv (fn [s] | |
(->> (string/split s #",") | |
(map keyword) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-schema [db] | |
(letfn [(attr->schema-tx [db attr] | |
(let [e (d/entity db attr) | |
em (->> e | |
(map identity) | |
(into {}))] | |
(cond | |
;; attribute | |
(:db/valueType e) | |
(merge em {:db/id (d/tempid :db.part/db) |