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
p2p
go-p2p-core
Commits
0d53a552
Unverified
Commit
0d53a552
authored
Jun 03, 2020
by
vyzo
Committed by
GitHub
Jun 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
connmgr: add IsProtected interface (#158)
parent
26478862
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
connmgr/manager.go
connmgr/manager.go
+4
-0
connmgr/null.go
connmgr/null.go
+1
-0
No files found.
connmgr/manager.go
View file @
0d53a552
...
...
@@ -70,6 +70,10 @@ type ConnManager interface {
// See notes on Protect() for more info.
Unprotect
(
id
peer
.
ID
,
tag
string
)
(
protected
bool
)
// IsProtected returns true if the peer is protected for some tag; if the tag is the empty string
// then it will return true if the peer is protected for any tag
IsProtected
(
id
peer
.
ID
,
tag
string
)
(
protected
bool
)
// Close closes the connection manager and stops background processes.
Close
()
error
}
...
...
connmgr/null.go
View file @
0d53a552
...
...
@@ -20,4 +20,5 @@ func (_ NullConnMgr) TrimOpenConns(ctx context.Context) {}
func
(
_
NullConnMgr
)
Notifee
()
network
.
Notifiee
{
return
network
.
GlobalNoopNotifiee
}
func
(
_
NullConnMgr
)
Protect
(
peer
.
ID
,
string
)
{}
func
(
_
NullConnMgr
)
Unprotect
(
peer
.
ID
,
string
)
bool
{
return
false
}
func
(
_
NullConnMgr
)
IsProtected
(
peer
.
ID
,
string
)
bool
{
return
false
}
func
(
_
NullConnMgr
)
Close
()
error
{
return
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