summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/main.go b/main.go
index 2a1a46b..0026fda 100644
--- a/main.go
+++ b/main.go
@@ -23,14 +23,23 @@ func main() {
confLoad()
- // TODO: support more backends
- instance = filesystem.New(config.System.Store, config.System.Verbose)
+ var doSuccess func()
+ switch config.System.Backend {
+ case "filesystem":
+ instance = filesystem.New(config.System.Store, config.System.Verbose)
+ doSuccess = func() {
+ log.Printf("store path %s revision %v compat %v",
+ config.System.Store, instance.(*filesystem.Store).Revision, instance.(*filesystem.Store).Compat)
+ }
+ default:
+ log.Fatalf("store backend %s does not exist", config.System.Backend)
+ }
+
if err := instance.Open(); err != nil {
log.Printf("error opening store: %s", err)
return
} else {
- log.Printf("store path %s revision %v compat %v",
- config.System.Store, instance.(*filesystem.Store).Revision, instance.(*filesystem.Store).Compat)
+ doSuccess()
}
if info, err := instance.User(instance.UserInitial()); err == nil {