Add memcache config entries
This commit is contained in:
parent
fde6624777
commit
b541f6e371
@ -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
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user