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
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

View File

@ -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)
}