github.com/Uhtred009/v2ray-core-1@v4.31.2+incompatible/common/net/network.go (about)

     1  package net
     2  
     3  func (n Network) SystemString() string {
     4  	switch n {
     5  	case Network_TCP:
     6  		return "tcp"
     7  	case Network_UDP:
     8  		return "udp"
     9  	default:
    10  		return "unknown"
    11  	}
    12  }
    13  
    14  // HasNetwork returns true if the network list has a certain network.
    15  func HasNetwork(list []Network, network Network) bool {
    16  	for _, value := range list {
    17  		if value == network {
    18  			return true
    19  		}
    20  	}
    21  	return false
    22  }