diff --git a/godns.conf b/godns.conf index c66a1fb..692a888 100644 --- a/godns.conf +++ b/godns.conf @@ -24,6 +24,9 @@ port = 6379 db = 0 password ="" +[memcache] +servers = ["127.0.0.1:11211"] + [log] stdout = true file = "./godns.log" @@ -32,7 +35,7 @@ level = "INFO" #DEBUG | INFO |NOTICE | WARN | ERROR [cache] -# backend option [memory|redis] +# backend option [memory|memcache|redis] # redis backend not implemented yet backend = "memory" expire = 600 # 10 minutes diff --git a/settings.go b/settings.go index a9f3282..330d874 100644 --- a/settings.go +++ b/settings.go @@ -27,6 +27,7 @@ type Settings struct { Server DNSServerSettings `toml:"server"` ResolvConfig ResolvSettings `toml:"resolv"` Redis RedisSettings `toml:"redis"` + Memcache MemcacheSettings `toml:"memcache"` Log LogSettings `toml:"log"` Cache CacheSettings `toml:"cache"` Hosts HostsSettings `toml:"hosts"` @@ -50,6 +51,10 @@ type RedisSettings struct { Password string } +type MemcacheSettings struct { + Servers []string +} + func (s RedisSettings) Addr() string { return s.Host + ":" + strconv.Itoa(s.Port) }