MCPcopy
hub / github.com/karol-broda/snitch / New

Function New

internal/resolver/resolver.go:24–30  ·  view source on GitHub ↗

New creates a new resolver with the specified timeout

(timeout time.Duration)

Source from the content-addressed store, hash-verified

22
23// New creates a new resolver with the specified timeout
24func New(timeout time.Duration) *Resolver {
25 return &Resolver{
26 timeout: timeout,
27 cache: make(map[string]string),
28 noCache: false,
29 }
30}
31
32// SetNoCache disables caching - each lookup will hit DNS directly
33func (r *Resolver) SetNoCache(noCache bool) {

Callers 15

BenchmarkGetCacheSizeFunction · 0.70
BenchmarkClearCacheFunction · 0.70
TestNewFunction · 0.70
TestSetNoCacheFunction · 0.70

Calls

no outgoing calls

Tested by 15

BenchmarkGetCacheSizeFunction · 0.56
BenchmarkClearCacheFunction · 0.56
TestNewFunction · 0.56
TestSetNoCacheFunction · 0.56