Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-namesys
Commits
1077b5af
Commit
1077b5af
authored
Apr 12, 2021
by
vyzo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parameterize DNSResolver on the lookup TXT function
parent
a718e16e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
dns.go
dns.go
+2
-3
namesys.go
namesys.go
+1
-1
No files found.
dns.go
View file @
1077b5af
...
@@ -11,7 +11,6 @@ import (
...
@@ -11,7 +11,6 @@ import (
path
"github.com/ipfs/go-path"
path
"github.com/ipfs/go-path"
opts
"github.com/ipfs/interface-go-ipfs-core/options/namesys"
opts
"github.com/ipfs/interface-go-ipfs-core/options/namesys"
isd
"github.com/jbenet/go-is-domain"
isd
"github.com/jbenet/go-is-domain"
madns
"github.com/multiformats/go-multiaddr-dns"
)
)
const
ethTLD
=
"eth"
const
ethTLD
=
"eth"
...
@@ -28,8 +27,8 @@ type DNSResolver struct {
...
@@ -28,8 +27,8 @@ type DNSResolver struct {
}
}
// NewDNSResolver constructs a name resolver using DNS TXT records.
// NewDNSResolver constructs a name resolver using DNS TXT records.
func
NewDNSResolver
(
rslv
madns
.
BasicResolver
)
*
DNSResolver
{
func
NewDNSResolver
(
lookup
LookupTXTFunc
)
*
DNSResolver
{
return
&
DNSResolver
{
lookupTXT
:
rslv
.
L
ookup
TXT
}
return
&
DNSResolver
{
lookupTXT
:
l
ookup
}
}
}
// Resolve implements Resolver.
// Resolve implements Resolver.
...
...
namesys.go
View file @
1077b5af
...
@@ -74,7 +74,7 @@ func NewNameSystem(r routing.ValueStore, ds ds.Datastore, rslv madns.BasicResolv
...
@@ -74,7 +74,7 @@ func NewNameSystem(r routing.ValueStore, ds ds.Datastore, rslv madns.BasicResolv
}
}
return
&
mpns
{
return
&
mpns
{
dnsResolver
:
NewDNSResolver
(
rslv
),
dnsResolver
:
NewDNSResolver
(
rslv
.
LookupTXT
),
proquintResolver
:
new
(
ProquintResolver
),
proquintResolver
:
new
(
ProquintResolver
),
ipnsResolver
:
NewIpnsResolver
(
r
),
ipnsResolver
:
NewIpnsResolver
(
r
),
ipnsPublisher
:
NewIpnsPublisher
(
r
,
ds
),
ipnsPublisher
:
NewIpnsPublisher
(
r
,
ds
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment