File: resolve.go

package info (click to toggle)
dmarc-cat 0.9.2-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 164 kB
  • sloc: xml: 104; makefile: 27
file content (26 lines) | stat: -rw-r--r-- 552 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main

import (
	"net"
)

// Resolver is the main interface we use
type Resolver interface {
	LookupAddr(addr string) ([]string, error)
}

// NullResolver is empty
type NullResolver struct{}

// LookupAddr always return a good and fixed answer
func (NullResolver) LookupAddr(addr string) ([]string, error) {
	return []string{addr}, nil
}

// RealResolver will call the real one
type RealResolver struct{}

// LookupAddr use the real "net" function
func (r RealResolver) LookupAddr(addr string) ([]string, error) {
	return net.LookupAddr(addr)
}