Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
go-ipfs
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
ipfs
go-ipfs
Commits
738f1824
Commit
738f1824
authored
7 years ago
by
ForrestWeston
Browse files
Options
Downloads
Patches
Plain Diff
docs for core/core method impls
License: MIT Signed-off-by:
ForrestWeston
<
forrest@protocol.ai
>
parent
e5f2f56b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/core.go
+7
-0
7 additions, 0 deletions
core/core.go
with
7 additions
and
0 deletions
core/core.go
+
7
−
0
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment