Skip to content
/ kosmos Public

library to build a system of components in clojure

License

Notifications You must be signed in to change notification settings

pupcus/kosmos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kosmos

kosmos -- greek for 'ordered system'

This library is a recreation of Semperos' liftoff library. It is built on top of Stuart Sierra's component library. The purpose is to bring an ordered system into existence based on a simple declarative configuration map and to be able to reference the assembled components and dependencies at runtime.

Clojars Project

Usage

Kosmos uses a simple map to describe configure components. More information about how to configure components can be found in the respective component projects' README/docs. Here is a quick example of how to configure a db component, a web server, and a repl component.

{
 :pool
 {
  :auto-commit         true
  :maximum-pool-size   10
  :pool-name           "application-db-pool"
  }

 :db
 {
  :kosmos/init     :kosmos.db/DbComponent
  :kosmos/requires [:pool]
  :classname       "com.mysql.jdbc.Driver"
  :subprotocol     "mysql"
  :host            "db.server.com"
  :port            3306
  :database        "important_database"
  :user            "username"
  :password        "password"
  }

 :server
 {
  :kosmos/init  :kosmos.web/RingJettyComponent
  :kosmos/requires [:db]
  :ring-app     :application.server/app
  :configurator :application.server/configurator
  :port         8081
  :join?        false
 }

 :nrepl
 {
  :kosmos/init :kosmos.nrepl/NreplComponent
  :port 9001
  }
}

For more information on these specific components see:

Clojars Project
Clojars Project
Clojars Project

License

Kosmos is distributed under the Eclipse Public License, the same as Clojure.

About

library to build a system of components in clojure

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •