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
mf
go-multiaddr-fmt
Commits
0ceb139d
Unverified
Commit
0ceb139d
authored
Jun 18, 2016
by
Adam Stankiewicz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unreliable protocol family
parent
8f444fbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
patterns.go
patterns.go
+3
-0
patterns_test.go
patterns_test.go
+3
-0
No files found.
patterns.go
View file @
0ceb139d
...
...
@@ -18,6 +18,9 @@ var UDP = And(IP, Base(ma.P_UDP))
// Define UTP as 'utp' on top of udp (on top of ipv4 or ipv6)
var
UTP
=
And
(
UDP
,
Base
(
ma
.
P_UTP
))
// Define unreliable transport as udp
var
Unreliable
=
Or
(
UDP
)
// Now define a Reliable transport as either tcp or utp
var
Reliable
=
Or
(
TCP
,
UTP
)
...
...
patterns_test.go
View file @
0ceb139d
...
...
@@ -110,6 +110,9 @@ func TestBasicMatching(t *testing.T) {
assertMatches
(
t
,
Reliable
,
good_utp
,
good_tcp
)
assertMismatches
(
t
,
Reliable
,
good_ip
,
good_udp
,
good_ipfs
)
assertMatches
(
t
,
Unreliable
,
good_udp
)
assertMismatches
(
t
,
Unreliable
,
good_ip
,
good_tcp
,
good_utp
,
good_ipfs
)
assertMatches
(
t
,
IPFS
,
good_ipfs
)
assertMismatches
(
t
,
IPFS
,
bad_ipfs
,
good_ip
,
good_tcp
,
good_utp
,
good_udp
)
}
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