eyre.core
gather
(gather exec)Gathers all system facts from the host reachable via exec and returns them as a single map. This is the library’s main entry point.
Arguments
exec- an executor function that runs a script string on the target host and returns{:exit int :out string :err string}. Any transport works: local shell, SSH, containers, etc.
Returns
A map containing:
:shell- shell detection result fromeyre.shell/gather-shell:os- OS detection result fromeyre.os/gather-os:hardware- hardware facts fromeyre.hardware/gather-hardware:users- user facts fromeyre.users/gather-users:filesystem- filesystem facts fromeyre.filesystem/gather-filesystem:network- network facts fromeyre.network/gather-network:paths- available binary paths fromeyre.bins/gather-paths
The shell is detected first; its result is used to select the appropriate embedded collection script for each module. The scripts from all modules are concatenated and executed once, and the parsed output is passed to each module’s processor function.
Example
(require '[babashka.process :as process]
'[eyre.core :as eyre])
(defn local-exec [script]
(process/shell {:cmd "bash" :in script
:out :string :err :string}))
(eyre/gather local-exec)
;; => {:shell {:type :bash ...} :os {:family :linux ...} ...}