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
738f1824
Commit
738f1824
authored
Jan 22, 2018
by
ForrestWeston
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs for core/core method impls
License: MIT Signed-off-by:
ForrestWeston
<
forrest@protocol.ai
>
parent
e5f2f56b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
core/core.go
core/core.go
+7
-0
No files found.
core/core.go
View file @
738f1824
...
...
@@ -420,6 +420,8 @@ func setupDiscoveryOption(d config.Discovery) DiscoveryOption {
return
nil
}
// HandlePeerFound attempts to connect to peer from `PeerInfo`, if it fails
// logs a warning log.
func
(
n
*
IpfsNode
)
HandlePeerFound
(
p
pstore
.
PeerInfo
)
{
log
.
Warning
(
"trying peer info: "
,
p
)
ctx
,
cancel
:=
context
.
WithTimeout
(
n
.
Context
(),
discoveryConnTimeout
)
...
...
@@ -590,6 +592,7 @@ func (n *IpfsNode) teardown() error {
return
nil
}
// OnlineMode returns whether or not the IpfsNode is in OnlineMode.
func
(
n
*
IpfsNode
)
OnlineMode
()
bool
{
switch
n
.
mode
{
case
onlineMode
:
...
...
@@ -599,6 +602,7 @@ func (n *IpfsNode) OnlineMode() bool {
}
}
// SetLocal will set the IpfsNode to local mode
func
(
n
*
IpfsNode
)
SetLocal
(
isLocal
bool
)
{
if
isLocal
{
n
.
mode
=
localMode
...
...
@@ -606,6 +610,7 @@ func (n *IpfsNode) SetLocal(isLocal bool) {
n
.
localModeSet
=
true
}
// LocalMode returns whether or not the IpfsNode is in LocalMode
func
(
n
*
IpfsNode
)
LocalMode
()
bool
{
if
!
n
.
localModeSet
{
// programmer error should not happen
...
...
@@ -619,6 +624,7 @@ func (n *IpfsNode) LocalMode() bool {
}
}
// Bootstrap will set and call the IpfsNodes bootstrap function.
func
(
n
*
IpfsNode
)
Bootstrap
(
cfg
BootstrapConfig
)
error
{
// TODO what should return value be when in offlineMode?
...
...
@@ -670,6 +676,7 @@ func (n *IpfsNode) loadID() error {
return
nil
}
// GetKey will return a key from the Keystore with name `name`.
func
(
n
*
IpfsNode
)
GetKey
(
name
string
)
(
ic
.
PrivKey
,
error
)
{
if
name
==
"self"
{
return
n
.
PrivateKey
,
nil
...
...
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