auto-file-store constructor for auto-detecting store type based on config keys
parent
a3feeb6454
commit
155bd3d36a
@ -1,12 +1,9 @@
|
||||
{:components
|
||||
{:file-store #var asciinema.component.local-file-store/local-file-store
|
||||
:exp-set #var asciinema.component.mem-expiring-set/mem-expiring-set}
|
||||
{:exp-set #var asciinema.component.mem-expiring-set/mem-expiring-set}
|
||||
:config
|
||||
{:http
|
||||
{:port 4000}
|
||||
:db
|
||||
{:uri "jdbc:postgresql://localhost:15432/asciinema_development?user=vagrant"}
|
||||
:file-store
|
||||
{:path "uploads/"}
|
||||
:png-gen
|
||||
{:bin-path "a2png/a2png.sh"}}}
|
||||
|
@ -0,0 +1,8 @@
|
||||
(ns asciinema.component.auto-file-store
|
||||
(:require [asciinema.component.local-file-store :refer [local-file-store]]
|
||||
[asciinema.component.s3-file-store :refer [s3-file-store]]))
|
||||
|
||||
(defn auto-file-store [config]
|
||||
(if (:s3-bucket config)
|
||||
(s3-file-store config)
|
||||
(local-file-store config)))
|
Loading…
Reference in New Issue