mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
remove unused functions
This commit is contained in:
parent
6543f5825b
commit
d1f318c82a
@ -83,7 +83,14 @@ func (d Destination) NetAddr() string {
|
||||
|
||||
// String returns the strings form of this Destination.
|
||||
func (d Destination) String() string {
|
||||
return d.Network.URLPrefix() + ":" + d.NetAddr()
|
||||
prefix := "unknown:"
|
||||
switch d.Network {
|
||||
case Network_TCP:
|
||||
prefix = "tcp:"
|
||||
case Network_UDP:
|
||||
prefix = "udp:"
|
||||
}
|
||||
return prefix + d.NetAddr()
|
||||
}
|
||||
|
||||
// IsValid returns true if this Destination is valid.
|
||||
|
@ -1,23 +1,5 @@
|
||||
package net
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func ParseNetwork(nwStr string) Network {
|
||||
if network, found := Network_value[nwStr]; found {
|
||||
return Network(network)
|
||||
}
|
||||
switch strings.ToLower(nwStr) {
|
||||
case "tcp":
|
||||
return Network_TCP
|
||||
case "udp":
|
||||
return Network_UDP
|
||||
default:
|
||||
return Network_Unknown
|
||||
}
|
||||
}
|
||||
|
||||
func (n Network) AsList() *NetworkList {
|
||||
return &NetworkList{
|
||||
Network: []Network{n},
|
||||
@ -35,17 +17,6 @@ func (n Network) SystemString() string {
|
||||
}
|
||||
}
|
||||
|
||||
func (n Network) URLPrefix() string {
|
||||
switch n {
|
||||
case Network_TCP:
|
||||
return "tcp"
|
||||
case Network_UDP:
|
||||
return "udp"
|
||||
default:
|
||||
return "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
func HasNetwork(list []Network, network Network) bool {
|
||||
for _, value := range list {
|
||||
if string(value) == string(network) {
|
||||
|
Loading…
Reference in New Issue
Block a user