summaryrefslogtreecommitdiff
path: root/internal/cache
diff options
context:
space:
mode:
authorradhitya <alif@radhitya.org>2026-07-06 19:16:57 +0700
committerradhitya <alif@radhitya.org>2026-07-06 19:16:57 +0700
commit3a194f1705b2e56c04fbe868d9edf2c226e77975 (patch)
tree8ad0061ab1e01d13ad120d8988bcf0b34532ee58 /internal/cache
parent94bd5eae2983654bcff960d5c5f408ebfe9eba25 (diff)
recursive modemad
Diffstat (limited to 'internal/cache')
-rw-r--r--internal/cache/cache.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/cache/cache.go b/internal/cache/cache.go
index 4d6b45c..b650ba1 100644
--- a/internal/cache/cache.go
+++ b/internal/cache/cache.go
@@ -8,7 +8,7 @@ import (
)
type Entry struct {
- Msg *dns.Msg
+ Msg *dns.Msg
Expires time.Time
}
@@ -17,7 +17,7 @@ func (e *Entry) expired() bool {
}
type Cache struct {
- mu sync.RWMutex
+ mu sync.RWMutex
data map[string]*Entry
}
@@ -67,7 +67,7 @@ func (c *Cache) Set(qname dns.Name, qtype, qclass uint16, msg *dns.Msg, ttl uint
key := makeKey(qname, qtype, qclass)
c.mu.Lock()
c.data[key] = &Entry{
- Msg: msg,
+ Msg: msg,
Expires: time.Now().Add(time.Duration(ttl) * time.Second),
}
c.mu.Unlock()