aboutsummaryrefslogtreecommitdiff
path: root/cmd/cashierd
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-10-08 00:57:10 -0500
committerNiall Sheridan <nsheridan@gmail.com>2016-10-11 16:54:47 -0500
commitd6d54ed0bcf3b583fe681db790740cef137401d3 (patch)
tree2da8de7005c14706f83edc8a58360fa435425c92 /cmd/cashierd
parentbaf7141d1dd0f99d561a2197a909c66dd389809d (diff)
Replace the 'datastore' option with a 'database' option
The 'datastore' string option is deprecated and will be removed in a future version. The new 'database' map option is preferred.
Diffstat (limited to 'cmd/cashierd')
-rw-r--r--cmd/cashierd/main.go19
1 files changed, 1 insertions, 18 deletions
diff --git a/cmd/cashierd/main.go b/cmd/cashierd/main.go
index de8b45f..7df85e6 100644
--- a/cmd/cashierd/main.go
+++ b/cmd/cashierd/main.go
@@ -297,23 +297,6 @@ func readConfig(filename string) (*config.Config, error) {
return config.ReadConfig(f)
}
-func certStore(config string) (store.CertStorer, error) {
- var cstore store.CertStorer
- var err error
- engine := strings.Split(config, ":")[0]
- switch engine {
- case "mysql", "sqlite":
- cstore, err = store.NewSQLStore(config)
- case "mongo":
- cstore, err = store.NewMongoStore(config)
- case "mem":
- cstore = store.NewMemoryStore()
- default:
- cstore = store.NewMemoryStore()
- }
- return cstore, err
-}
-
func loadCerts(certFile, keyFile string) (tls.Certificate, error) {
key, err := wkfs.ReadFile(keyFile)
if err != nil {
@@ -388,7 +371,7 @@ func main() {
log.Fatal(err)
}
- certstore, err := certStore(config.Server.Datastore)
+ certstore, err := store.New(config.Server.Database)
if err != nil {
log.Fatal(err)
}