MCPcopy Create free account
hub / github.com/Hidden-Node/GooseRelayVPN-AndroidClient / get

Method get

internal/exit/dnscache.go:34–46  ·  view source on GitHub ↗

get returns a cached IP for host, or "" if missing/expired. Expired entries are evicted on access to keep the map small.

(host string)

Source from the content-addressed store, hash-verified

32// get returns a cached IP for host, or "" if missing/expired. Expired entries
33// are evicted on access to keep the map small.
34func (c *dnsCache) get(host string) string {
35 c.mu.Lock()
36 defer c.mu.Unlock()
37 e, ok := c.entries[host]
38 if !ok {
39 return ""
40 }
41 if time.Now().After(e.expires) {
42 delete(c.entries, host)
43 return ""
44 }
45 return e.ip
46}
47
48func (c *dnsCache) set(host, ip string) {
49 c.mu.Lock()

Callers 7

parseImportedProfileMethod · 0.80
parseScriptKeysJsonMethod · 0.80
buildDnsResponseMethod · 0.80
ProfileEditorDialogFunction · 0.80
SettingsViewModelClass · 0.80
importJsonToProfileMethod · 0.80
dialWithDNSCacheFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected