redis-enable is now in hosts

This commit is contained in:
bigeagle 2015-02-03 23:09:20 +08:00
parent 952f39ddf2
commit 0728359489
2 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@ func NewHosts(hs HostsSettings, rs RedisSettings) Hosts {
fileHosts := &FileHosts{hs.HostsFile}
var rc *redis.Client
if rs.Enable {
if hs.RedisEnable {
rc = &redis.Client{Addr: rs.Addr(), Db: rs.DB, Password: rs.Password}
} else {
rc = nil

View File

@ -36,7 +36,6 @@ type DNSServerSettings struct {
}
type RedisSettings struct {
Enable bool
Host string
Port int
DB int
@ -60,6 +59,7 @@ type CacheSettings struct {
type HostsSettings struct {
Enable bool
HostsFile string `toml:"host-file"`
RedisEnable bool `toml:"redis-enable"`
RedisKey string `toml:"redis-key"`
TTL uint32 `toml:"ttl"`
}