aboutsummaryrefslogtreecommitdiff
path: root/weed/filer2/postgres
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2018-06-17 13:01:57 -0700
committerChris Lu <chris.lu@gmail.com>2018-06-17 13:01:57 -0700
commiteb2acd11c229839cd8e955a70e4c0f61ead53777 (patch)
treef56f94f641b04ebc2be837e2a1137bccb974f126 /weed/filer2/postgres
parent0467195f07c80ec2da0c32206bf47d3e10772ac8 (diff)
downloadseaweedfs-eb2acd11c229839cd8e955a70e4c0f61ead53777.tar.xz
seaweedfs-eb2acd11c229839cd8e955a70e4c0f61ead53777.zip
decouple from viper for filer store
Diffstat (limited to 'weed/filer2/postgres')
-rw-r--r--weed/filer2/postgres/postgres_store.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/weed/filer2/postgres/postgres_store.go b/weed/filer2/postgres/postgres_store.go
index 3bec55def..f5904ab21 100644
--- a/weed/filer2/postgres/postgres_store.go
+++ b/weed/filer2/postgres/postgres_store.go
@@ -7,7 +7,6 @@ import (
"github.com/chrislusf/seaweedfs/weed/filer2"
"github.com/chrislusf/seaweedfs/weed/filer2/abstract_sql"
_ "github.com/lib/pq"
- "github.com/spf13/viper"
)
const (
@@ -26,16 +25,16 @@ func (store *PostgresStore) GetName() string {
return "postgres"
}
-func (store *PostgresStore) Initialize(viper *viper.Viper) (err error) {
+func (store *PostgresStore) Initialize(configuration filer2.Configuration) (err error) {
return store.initialize(
- viper.GetString("username"),
- viper.GetString("password"),
- viper.GetString("hostname"),
- viper.GetInt("port"),
- viper.GetString("database"),
- viper.GetString("sslmode"),
- viper.GetInt("connection_max_idle"),
- viper.GetInt("connection_max_open"),
+ configuration.GetString("username"),
+ configuration.GetString("password"),
+ configuration.GetString("hostname"),
+ configuration.GetInt("port"),
+ configuration.GetString("database"),
+ configuration.GetString("sslmode"),
+ configuration.GetInt("connection_max_idle"),
+ configuration.GetInt("connection_max_open"),
)
}