udp: Add basic UDP tests

This commit is contained in:
Justin Li
2015-02-21 14:35:21 -05:00
parent 105edf21f1
commit 7512f50731
6 changed files with 218 additions and 3 deletions
+7
View File
@@ -45,6 +45,13 @@ func (e ClientError) Error() string { return string(e) }
func (e NotFoundError) Error() string { return string(e) }
func (e ProtocolError) Error() string { return string(e) }
func IsPublicError(err error) bool {
_, cl := err.(ClientError)
_, nf := err.(NotFoundError)
_, pc := err.(ProtocolError)
return cl || nf || pc
}
type PeerList []Peer
type PeerKey string