Commit 9adf36df authored by Sietse Ringers's avatar Sietse Ringers
Browse files

refactor: make keyshare and myirma server db type constants typed

parent 4e2b9d64
......@@ -44,7 +44,7 @@ func init() {
flags.StringSlice("cors-allowed-origins", nil, "CORS allowed origins")
flags.Lookup("port").Header = `Server address and port to listen on`
flags.String("db-type", myirmaserver.DBTypePostgres, "Type of database to connect keyshare server to")
flags.String("db-type", string(myirmaserver.DBTypePostgres), "Type of database to connect keyshare server to")
flags.String("db", "", "Database server connection string")
flags.Lookup("db-type").Header = `Database configuration`
......
......@@ -41,7 +41,7 @@ func init() {
flags.StringP("listen-addr", "l", "", "address at which to listen (default 0.0.0.0)")
flags.Lookup("port").Header = `Server address and port to listen on`
flags.String("db-type", keyshareserver.DBTypePostgres, "Type of database to connect keyshare server to")
flags.String("db-type", string(keyshareserver.DBTypePostgres), "Type of database to connect keyshare server to")
flags.String("db", "", "Database server connection string")
flags.Lookup("db-type").Header = `Database configuration`
......
......@@ -21,8 +21,8 @@ type DBType string
var errUnknownDBType = errors.New("Unknown database type")
const (
DBTypeMemory = "memory"
DBTypePostgres = "postgres"
DBTypeMemory DBType = "memory"
DBTypePostgres DBType = "postgres"
)
// Configuration contains configuration for the irmaserver library and irmad.
......
......@@ -17,8 +17,8 @@ type DBType string
var errUnknownDBType = errors.New("Unknown database type")
const (
DBTypeMemory = "memory"
DBTypePostgres = "postgres"
DBTypeMemory DBType = "memory"
DBTypePostgres DBType = "postgres"
SessionLifetimeDefault = 15 * 60 // seconds
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment