Skip to content

Commit

Permalink
read real MySQL user and pass
Browse files Browse the repository at this point in the history
  • Loading branch information
arstercz committed Aug 9, 2017
1 parent 79a3d47 commit eea4ab5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@ func get_backend_dsn(c *goconfig.ConfigFile) (dsn string, err error) {
}
return dsn, nil
}

func get_read_user(c *goconfig.ConfigFile) (user string, pass string, err error) {
user, err = c.GetString("onlineread", "user")
if err != nil {
return "", "", err
}
pass, err = c.GetString("onlineread", "pass")
if err != nil {
return user, "", err
}
return user, pass, nil
}

0 comments on commit eea4ab5

Please sign in to comment.