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-dms3
Commits
d47ff797
Commit
d47ff797
authored
Feb 28, 2018
by
Dirk McCormick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document namesys options
License: MIT Signed-off-by:
Dirk McCormick
<
dirkmdev@gmail.com
>
parent
e8f79c88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
namesys/opts/opts.go
namesys/opts/opts.go
+6
-0
No files found.
namesys/opts/opts.go
View file @
d47ff797
...
...
@@ -39,26 +39,32 @@ func DefaultResolveOpts() *ResolveOpts {
}
}
// ResolveOpt is used to set an option
type
ResolveOpt
func
(
*
ResolveOpts
)
// Depth is the recursion depth limit
func
Depth
(
depth
uint
)
ResolveOpt
{
return
func
(
o
*
ResolveOpts
)
{
o
.
Depth
=
depth
}
}
// DhtRecordCount is the number of IPNS records to retrieve from the DHT
func
DhtRecordCount
(
count
uint
)
ResolveOpt
{
return
func
(
o
*
ResolveOpts
)
{
o
.
DhtRecordCount
=
count
}
}
// DhtTimeout is the amount of time to wait for DHT records to be fetched
// and verified. A zero value indicates that there is no explicit timeout
func
DhtTimeout
(
timeout
time
.
Duration
)
ResolveOpt
{
return
func
(
o
*
ResolveOpts
)
{
o
.
DhtTimeout
=
timeout
}
}
// ProcessOpts converts an array of ResolveOpt into a ResolveOpts object
func
ProcessOpts
(
opts
[]
ResolveOpt
)
*
ResolveOpts
{
rsopts
:=
DefaultResolveOpts
()
for
_
,
option
:=
range
opts
{
...
...
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