diff options
author | Niall Sheridan <nsheridan@gmail.com> | 2018-08-06 00:21:11 +0100 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-08-07 15:43:39 +0100 |
commit | 4f2385db4b3d4171fff841594f8c591703e84b0f (patch) | |
tree | 0a28668961e727881add7753fc7e8daa0ef0d998 /server/store/store.go | |
parent | 162efe8828ce1c2828206e5050a2c0c175265d70 (diff) |
Unexport store implementations
Return an error if the store isn't known, instead of defaulting to a mem store
Diffstat (limited to 'server/store/store.go')
-rw-r--r-- | server/store/store.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/store/store.go b/server/store/store.go index 4edb446..4863ff0 100644 --- a/server/store/store.go +++ b/server/store/store.go @@ -2,6 +2,7 @@ package store import ( "encoding/json" + "fmt" "time" "golang.org/x/crypto/ssh" @@ -15,11 +16,11 @@ import ( func New(c config.Database) (CertStorer, error) { switch c["type"] { case "mysql", "sqlite": - return NewSQLStore(c) + return newSQLStore(c) case "mem": - return NewMemoryStore(), nil + return newMemoryStore(), nil } - return NewMemoryStore(), nil + return nil, fmt.Errorf("unable to create store with driver %s", c["type"]) } // CertStorer records issued certs in a persistent store for audit and |