Add memcache config entries

This commit is contained in:
Dhananjay Balan 2016-02-12 18:59:25 +05:30
parent fde6624777
commit b541f6e371
2 changed files with 9 additions and 1 deletions

View File

@ -24,6 +24,9 @@ port = 6379
db = 0 db = 0
password ="" password =""
[memcache]
servers = ["127.0.0.1:11211"]
[log] [log]
stdout = true stdout = true
file = "./godns.log" file = "./godns.log"
@ -32,7 +35,7 @@ level = "INFO" #DEBUG | INFO |NOTICE | WARN | ERROR
[cache] [cache]
# backend option [memory|redis] # backend option [memory|memcache|redis]
# redis backend not implemented yet # redis backend not implemented yet
backend = "memory" backend = "memory"
expire = 600 # 10 minutes expire = 600 # 10 minutes

View File

@ -27,6 +27,7 @@ type Settings struct {
Server DNSServerSettings `toml:"server"` Server DNSServerSettings `toml:"server"`
ResolvConfig ResolvSettings `toml:"resolv"` ResolvConfig ResolvSettings `toml:"resolv"`
Redis RedisSettings `toml:"redis"` Redis RedisSettings `toml:"redis"`
Memcache MemcacheSettings `toml:"memcache"`
Log LogSettings `toml:"log"` Log LogSettings `toml:"log"`
Cache CacheSettings `toml:"cache"` Cache CacheSettings `toml:"cache"`
Hosts HostsSettings `toml:"hosts"` Hosts HostsSettings `toml:"hosts"`
@ -50,6 +51,10 @@ type RedisSettings struct {
Password string Password string
} }
type MemcacheSettings struct {
Servers []string
}
func (s RedisSettings) Addr() string { func (s RedisSettings) Addr() string {
return s.Host + ":" + strconv.Itoa(s.Port) return s.Host + ":" + strconv.Itoa(s.Port)
} }