Skip to content

Commit

Permalink
Merge pull request #25 from Jorropo/feat/exposes-backend
Browse files Browse the repository at this point in the history
feat: exposes backend
  • Loading branch information
Stebalien authored Nov 30, 2020
2 parents 2951ee1 + 8af92eb commit dba25a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ var DefaultResolver = &Resolver{Backend: net.DefaultResolver}

const dnsaddrTXTPrefix = "dnsaddr="

type backend interface {
type Backend interface {
LookupIPAddr(context.Context, string) ([]net.IPAddr, error)
LookupTXT(context.Context, string) ([]string, error)
}

type Resolver struct {
Backend backend
Backend Backend
}

var _ Backend = (*MockBackend)(nil)

type MockBackend struct {
IP map[string][]net.IPAddr
TXT map[string][]string
Expand Down

0 comments on commit dba25a2

Please sign in to comment.