Liking cljdoc? Tell your friends :D

lambdaisland.config.munge

Logic for how to turn a config key and possibly an app prefix into various things we can look up.

Env vars:

  • uppercased
  • dashes and slashes become underscores
  • prefix is separated from key with __
  • special characters are munged see ([[clojure.core/munge]])
  • e.g. prefix: "my-app", key: :service/api-key -> MY_APP__SERVICE_API_KEY

File names:

  • slashes become dashes
  • prefix is separated from key with -
  • characters *?<>! are stripped
  • e.g. prefix: "my-app", key: :service/api-key! -> my-app-service-api-key
Logic for how to turn a config key and possibly an app prefix into various
things we can look up.

Env vars:
- uppercased
- dashes and slashes become underscores
- prefix is separated from key with `__`
- special characters are munged see ([[clojure.core/munge]])
- e.g. prefix: "my-app", key: `:service/api-key` -> MY_APP__SERVICE_API_KEY

File names:
- slashes become dashes
- prefix is separated from key with `-`
- characters `*?<>!` are stripped
- e.g. prefix: "my-app", key: `:service/api-key!` -> my-app-service-api-key
raw docstring

env-caseclj

(env-case s)
source

file-nameclj

(file-name prefix k)
source

key->env-varclj

(key->env-var prefix k)

Take the key used to identify a setting or secret, and turn it into a string suitable for use as an environment variable.

  • if the key is already a string it is left untouched
  • otherwise it is assumed to be an ident (symbol or keyword)
  • identifiers are uppercased and munged, as per [[munge]]
  • dashes become underscores
  • if the ident is qualified (has a namespace), two underscores are used to separate name and namespace
Take the key used to identify a setting or secret, and turn it into a string
suitable for use as an environment variable.

- if the key is already a string it is left untouched
- otherwise it is assumed to be an ident (symbol or keyword)
- identifiers are uppercased and munged, as per [[munge]]
- dashes become underscores
- if the ident is qualified (has a namespace), two underscores are used to
  separate name and namespace
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close