Awesome
Pod registry
The central place to register babashka pods for easy usage with babashka.
Loading and using a pod
Registered pods can be loaded using a qualified symbol and a version string:
(require '[babashka.pods :as pods])
(pods/load-pod 'org.babashka/buddy "0.1.0")
From then on, a pod exposes namespaces which can be called like regular Clojure:
(require '[pod.babashka.buddy.core.hash :as hash])
(hash/md5 "foo")
Registered pods
Registering a pod
To register a pod, create a nested directory in manifests
with the following structure:
<org>/<pod-name>/<version>
and add a manifest.edn
file like the following example:
{:pod/name tzzh/mail
:pod/description "Send emails"
:pod/version "0.0.2"
:pod/license ""
:pod/example "https://raw.githubusercontent.com/babashka/pod-registry/master/examples/tzzh_mail.clj"
:pod/language "go"
:pod/artifacts
[{:os/name "Linux.*"
:os/arch "amd64"
:artifact/url "https://github.com/tzzh/pod-tzzh-mail/releases/download/v0.0.2/pod-tzzh-mail_0.0.2_Linux_x86_64.zip"
:artifact/executable "pod-tzzh-mail"}
{:os/name "Mac.*"
:os/arch "x86_64"
:artifact/url "https://github.com/tzzh/pod-tzzh-mail/releases/download/v0.0.2/pod-tzzh-mail_0.0.2_Darwin_x86_64.zip"
:artifact/executable "pod-tzzh-mail"}
{:os/name "Windows.*"
:os/arch "amd64"
:artifact/url "https://github.com/tzzh/pod-tzzh-mail/releases/download/v0.0.2/pod-tzzh-mail_0.0.2_Windows_x86_64.zip"
:artifact/executable "pod-tzzh-mail.exe"}]}
The required fields are :pod/name
, :pod/version
and :pod/artifacts
. For the sake of programmatical integrity you can populate :pod/description
, :pod/example
(with a link) and :pod/language
fields as well.
You can then load the pod in your babashka script as follows:
(require '[babashka.pods :as pods])
(pods/load-pod 'tzzh/mail "0.0.2")
(require '[pod.tzzh.mail :as m])
(m/send-mail ...)
The :pod/artifacts
vector will be matched in order on operating system and
architecture. For the first match, the :artifact/url
, a zip file, will be
downloaded and extracted. After extraction there should be a file with the same
name as :artifact/executable
which will be made executable and invoked as the
pod.