Skip to content

Commit

Permalink
config dirValue
Browse files Browse the repository at this point in the history
  • Loading branch information
soyking committed Nov 4, 2016
1 parent 398c07b commit d8d4e38
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions conf/config.default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ auth=false

[etcd]
root_key=e3w_test
dir_value=
addr=127.0.0.1:2379,127.0.0.1:22379,127.0.0.1:32379
username=
password=
2 changes: 2 additions & 0 deletions conf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type Config struct {
Port string
Auth bool
EtcdRootKey string
DirValue string
EtcdEndPoints []string
EtcdUsername string
EtcdPassword string
Expand All @@ -27,6 +28,7 @@ func Init(filepath string) (*Config, error) {

etcdSec := cfg.Section("etcd")
c.EtcdRootKey = etcdSec.Key("root_key").Value()
c.DirValue = etcdSec.Key("dir_value").Value()
c.EtcdEndPoints = etcdSec.Key("addr").Strings(",")
c.EtcdUsername = etcdSec.Key("username").Value()
c.EtcdPassword = etcdSec.Key("password").Value()
Expand Down
2 changes: 1 addition & 1 deletion e3ch/e3ch.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func NewE3chClient(config *conf.Config) (*client.EtcdHRCHYClient, error) {
return nil, err
}

client, err := client.New(clt, config.EtcdRootKey)
client, err := client.New(clt, config.EtcdRootKey, config.DirValue)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit d8d4e38

Please sign in to comment.