Esempio n. 1
0
func (this *NetworkList) Build() *v2net.NetworkList {
	list := new(v2net.NetworkList)
	for _, network := range *this {
		list.Network = append(list.Network, network.Build())
	}
	return list
}
Esempio n. 2
0
func (s *Server) Network() net.NetworkList {
	list := net.NetworkList{
		Network: []net.Network{net.Network_TCP},
	}
	if s.config.UdpEnabled {
		list.Network = append(list.Network, net.Network_UDP)
	}
	return list
}
Esempio n. 3
0
func (v *NetworkList) Build() *v2net.NetworkList {
	if v == nil {
		return &v2net.NetworkList{
			Network: []v2net.Network{v2net.Network_TCP},
		}
	}

	list := new(v2net.NetworkList)
	for _, network := range *v {
		list.Network = append(list.Network, network.Build())
	}
	return list
}