Ductモジュール⼊⾨Ductモジュール⼊⾨Clojureフレームワーク"Duct"の拡張⽅法を理解しようClojureフレームワーク"Duct"の拡張⽅法を理解しよう
lagénorhynquelagénorhynque
(defprofile lagénorhynque
:id @lagenorhynque
:reading "/laʒenɔʁɛ̃k/"
:aliases ["カマイルカ🐬 "]
:languages [Clojure Haskell English français]
:interests [programming language-learning law mathematics]
:commits ["github.com/lagenorhynque/duct.module.pedestal"
"github.com/lagenorhynque/duct.module.cambium"]
:contributes ["github.com/japan-clojurians/clojure-site-ja"])
1. Integrantの基本
2. Ductの基本
3. Ductモジュールの作り⽅
Integrantの基本Integrantの基本
とはとは
依存関係に従ってライフサイクル管理を⾏う仕組み
cf. , ,
IntegrantIntegrant
Component mount Clip
ライフサイクルフックとしてのマルチメソッドライフサイクルフックとしてのマルチメソッド
デフォルト: 何もしない
デフォルト: 何もしない
デフォルト: init-key と同じ
デフォルト: halt-key! と同じ
integrant.core/prep-key
integrant.core/init-key
integrant.core/halt-key!
integrant.core/resume-key
integrant.core/supend-key!
Ductの基本Ductの基本
とはとは
Integrantに対する便利な拡張
DuctDuct
LeiningenテンプレートLeiningenテンプレートductduct
# API関連、ルーティングライブラリAtaraxy、サンプルコード付き
$ lein new duct <project name> +api +ataraxy +example
コア機能コア機能duct/coreduct/core
duct.core/load-hierarchy
duct.core/read-config
duct.core/prep-config
標準モジュール標準モジュール
duct/module.web
duct/module.ataraxy
duct/module.sql
duct/module.cljs
duct/module.logging
Ductモジュールの作り⽅Ductモジュールの作り⽅
実装⽅法実装⽅法
ClojureサーバサイドフレームワークDuctガイド>
Ductの「モジュール」とは
実例1:実例1:
API/サービス開発ライブラリ を組み込む
モジュール
標準モジュール の代替
duct.module.pedestalduct.module.pedestal
Pedestal
duct/module.web
実例2:実例2:
JSON形式でのログ出⼒を可能にするライブラリ
を組み込むモジュール
標準モジュール の代替
duct.module.cambiumduct.module.cambium
Cambium
duct/module.logging
Further ReadingFurther Reading
第3章: Clojureによるデータ指向DSLを駆使
したREST API開発
Clojure/ClojureScript関連リンク集> Webサーバ
サイド(Clojure)
ClojureサーバサイドフレームワークDuctガイド
『3つのLisp 3つの世界』
ClojureのDuctでWeb API開発してみた

Ductモジュール入門