Added specs to functions
This commit is contained in:
parent
0fc7bc5f2e
commit
668f2d7e2a
1 changed files with 17 additions and 14 deletions
|
@ -43,35 +43,38 @@
|
||||||
; TODO: Review jem 2022/10/26: move default to core/default
|
; TODO: Review jem 2022/10/26: move default to core/default
|
||||||
(def volume-size 3)
|
(def volume-size 3)
|
||||||
|
|
||||||
; TODO: Review jem 2022/10/26: spec the following funktions?
|
(defn-spec replace-dots-by-minus string?
|
||||||
(defn replace-dots-by-minus
|
[fqdn pred/fqdn-string?]
|
||||||
[fqdn]
|
|
||||||
(str/replace fqdn #"\." "-"))
|
(str/replace fqdn #"\." "-"))
|
||||||
|
|
||||||
(defn generate-service-name
|
(defn-spec generate-service-name string?
|
||||||
[unique-name]
|
[unique-name pred/fqdn-string?]
|
||||||
(str (replace-dots-by-minus unique-name) "-service"))
|
(str (replace-dots-by-minus unique-name) "-service"))
|
||||||
|
|
||||||
(defn generate-cert-name
|
(defn-spec generate-cert-name string?
|
||||||
[unique-name]
|
[unique-name pred/fqdn-string?]
|
||||||
(str (replace-dots-by-minus unique-name) "-cert"))
|
(str (replace-dots-by-minus unique-name) "-cert"))
|
||||||
|
|
||||||
(defn generate-http-ingress-name
|
(defn-spec generate-http-ingress-name string?
|
||||||
[unique-name]
|
[unique-name pred/fqdn-string?]
|
||||||
(str (replace-dots-by-minus unique-name) "-http-ingress"))
|
(str (replace-dots-by-minus unique-name) "-http-ingress"))
|
||||||
|
|
||||||
(defn generate-https-ingress-name
|
(defn-spec generate-https-ingress-name string?
|
||||||
[unique-name]
|
[unique-name pred/fqdn-string?]
|
||||||
(str (replace-dots-by-minus unique-name) "-https-ingress"))
|
(str (replace-dots-by-minus unique-name) "-https-ingress"))
|
||||||
|
|
||||||
; https://your.gitea.host/api/v1/repos/<owner>/<repo>/archive/main.zip
|
; https://your.gitea.host/api/v1/repos/<owner>/<repo>/archive/main.zip
|
||||||
(defn make-gitrepourl
|
(defn-spec make-gitrepourl string?
|
||||||
[host repo user branch]
|
[host pred/fqdn-string?
|
||||||
|
repo string?
|
||||||
|
user string?
|
||||||
|
branch string?]
|
||||||
(str "https://" host "/api/v1/repos/" user "/" repo "/archive/" branch ".zip"))
|
(str "https://" host "/api/v1/repos/" user "/" repo "/archive/" branch ".zip"))
|
||||||
|
|
||||||
; ToDo: Move to common?
|
; ToDo: Move to common?
|
||||||
|
; ToDo richtig spec-en
|
||||||
(defn replace-all-matching-subvalues-in-string-start
|
(defn replace-all-matching-subvalues-in-string-start
|
||||||
[col ;ToDo richtig spec-en
|
[col
|
||||||
value-to-partly-match
|
value-to-partly-match
|
||||||
value-to-inplace]
|
value-to-inplace]
|
||||||
(clojure.walk/postwalk #(if (and (= (type value-to-partly-match) (type %))
|
(clojure.walk/postwalk #(if (and (= (type value-to-partly-match) (type %))
|
||||||
|
|
Loading…
Reference in a new issue