mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 18:17:52 -05:00
23 lines
387 B
Go
23 lines
387 B
Go
package net
|
|
|
|
func (n Network) SystemString() string {
|
|
switch n {
|
|
case Network_TCP:
|
|
return "tcp"
|
|
case Network_UDP:
|
|
return "udp"
|
|
default:
|
|
return "unknown"
|
|
}
|
|
}
|
|
|
|
// HasNetwork returns true if the network list has a certain network.
|
|
func HasNetwork(list []Network, network Network) bool {
|
|
for _, value := range list {
|
|
if value == network {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|