Versions in this module Expand all Collapse all v1 v1.0.0 Apr 16, 2026 Changes in this version + const IfaceCidr + const IfaceIname + const IfaceIp4 + const IfaceIp6 + const IfaceMacddr + const IfaceMask + const ProtocolICMP + func DialExpec(addr, expect string, timeouts ...time.Duration) bool + func GetDefaultIface() (string, error) + func GetFreePort(isUdp ...bool) (int, error) + func GetFreePorts(count int, isUdp ...bool) ([]int, error) + func GetFreeTcpPort() (int, error) + func GetFreeTcpPorts(count int) ([]int, error) + func GetFreeUdpPort() (int, error) + func GetFreeUdpPorts(count int) ([]int, error) + func GetIfaceRouteDefault() (ifacename string) + func GetNetworkTime(ntpserver string, port int) (t *time.Time, err error) + func GetOutboundIP(iface ...string) (string, error) + func GetPublicIp() string + func HABuildErrorResponseStr(errors []HAErrorCode, messages []HAMessages) (response string) + func HABuildSuccessResponeStr(result HAResult, messages []HAMessages, result_info ...HAResultInfo) (response string) + func HttpClientFlush() + func HttpClientNewTransPort() *http.Transport + func HttpClientReset() + func IfaceGetAllName(noLocalhosts ...bool) (ifaces []string) + func IfaceIsPluged(ifacename string) bool + func IfaceListAll() + func IfaceListHasInternet() (ifaces []string) + func IfaceRestart(ifacname string) bool + func IpBetween(from net.IP, to net.IP, test net.IP) bool + func IpConfig(ipstr, maskstr, gwipstr string, ifaces ...string) error + func IpConfigAuto(ipcidr string, ifaces ...string) error + func IpDhcpRenew(ifi string, timeouts ...time.Duration) error + func IpFlush(ifi string) error + func IpGetDefault(ipstr string) (mask, gw string, err error) + func IpInc(ip net.IP) + func IpIsPrivate(ip string) bool + func IpParserCIDR(cidr string) (maskip, defaultgateway string, err error) + func IsOnline(times, intervalsecs int) bool + func IsPortAvailable(ip string, port int, timeouts ...time.Duration) bool + func IsPortOpen(addr string, port int, proto string, timeouts ...time.Duration) bool + func IsPortOpen1(addr string, port int, proto string, timeouts ...time.Duration) bool + func IsPortTcpAvailable(ip string, port int, timeouts ...time.Duration) bool + func IsPortTcpUsed(ip string, port int, timeouts ...time.Duration) bool + func IsPortUdpAvailable(ip string, port int, timeouts ...time.Duration) bool + func IsPortUdpUsed(ip string, port int, timeouts ...time.Duration) bool + func IsPortUsed(ip string, port int, timeouts ...time.Duration) bool + func IsPublicIP(IP net.IP) bool + func IsSsh(addr string, timeouts ...time.Duration) bool + func IsVnc(addr string, timeouts ...time.Duration) bool + func MacFromIP(ip2check string, ifaceFlags ...string) (info string, err error) + func NMConnectWifi(ifacename, ssid, password string) error + func NMCreateHostPost(ifacename, conname, ssid, password string) error + func NetCheckConectionToServer(domain string, ifacenames ...string) error + func NetDiscoveryConfigPort(port int) + func NetDiscoveryQueryServiceEntry(serviceName, domain string, timeout time.Duration, ifaceNames ...string) []*mdns.ServiceEntry + func NetGetCIDR(iface ...string) (string, error) + func NetGetDefaultGatewayOfIface(iface ...string) (string, error) + func NetGetGatewayOfInterface(ifaceCheck string) (string, error) + func NetGetInameByIP(ip string) (i string, err error) + func NetGetInterfaceInfo(infotype int, ifaces ...string) (info string, err error) + func NetGetInterfaceIpv4Addr(interfaceName string) (addr string, err error) + func NetGetMac(iface ...string) (macadd string, err error) + func NetGetMacBytesInterFace(interfaceName string) (macadd []byte, err error) + func NetGetMacInterFace(interfaceName string) (macadd string, err error) + func NetGetMacs(iface ...string) ([]string, error) + func NetGetMask(iface ...string) (string, error) + func NetGetMetricOfInterface(ifaceCheck string, cirdOrIp string) (int, error) + func NetGetStaticLoopbackName() (retstr string) + func NetGetStaticMac() string + func NetIfaceHasIpv4(interfaceName string) bool + func NetInitDiscoveryServer(ipService interface{}, serviceport interface{}, id, serviceName string, ...) (s *mdns.Server, err error) + func NetInterfaceIsUp(ifaceName string) (bool, error) + func NetIsIpv4(ip net.IP) bool + func NetIsOnline(times, intervalsecs int, ifacenames ...string) bool + func NetIsOnlineOld(times, intervalsecs int, ifacenames ...string) bool + func NetIsOnlinePing(times, intervalsecs int, ifacenames ...string) bool + func NetIsOnlinePingExternal(times, intervalsecs int, ifacenames ...string) bool + func NetIsOnlineTcp(times, intervalsecs int, ifacenames ...string) bool + func NetRouteAdd(iface string, metric int, cirdOrIp string) (cmd2run string, err error) + func NetRouteAddTemporary(iface string, metric int, cirdOrIp string) (err error) + func NetRouteDelete(iface string, metric int, cirdOrIp string) (cmd2run string, err error) + func NetTCPClientSend(servAddr string, dataSend []byte, timeouts ...time.Duration) (retbytes []byte, err error) + func NetWaitServerIsOnline(domain string, timeout time.Duration, ifacenames ...string) error + func OnvifSendProbe(ifaceName ...string) (devices []string) + func Ping(addr, iface string, timeouts ...time.Duration) (*net.IPAddr, time.Duration, error) + func PingExternal(domain, ifacename string, timeout time.Duration) error + func ResolverDomain(domain string, debugflag ...bool) (addrs []string, err error) + func ResolverDomain2Ip4(domain string, debugflag ...bool) (addr string, err error) + func ResolverDomainOld(domain string, debugflag ...bool) (addrs []string, err error) + func RouteDefault(ifacename string, metrics ...int) (err error) + func RouteTem(ifacename string, metrics ...int) (err error) + func ServerIsLive(domain string, ifacenames ...string) bool + func TimeGetUTCFromInternet() (t string) + func TimeGetUTCFromhttp() (gmtteme string) + func TimeUpdateFromInternet(tzone ...string) bool + func TimeZoneGet() (tz string) + type CamerasInfo struct + FirmwareVersion string + From string + Hardware string + IP string + LastConnectError time.Time + Location string + Name string + UUID string + XADDR string + func OnvifDiscovery(ifaceName ...string) []CamerasInfo + type DeviceCCCInfo struct + Device_id string + Extra []string + From string + IP string + LastDiscovery time.Time + Port int + Serial_number string + Version string + func NetDiscoveryQueryCCC(servicename string, ifaceName ...string) (deviceList []DeviceCCCInfo) + type DiscoveryInfo struct + Host string + Info []string + Ip4 string + Name string + Port int + func NetDiscoveryQuery(serviceName string, timeout time.Duration, ifaceNames ...string) []*DiscoveryInfo + type HA map[string]interface + type HAErrorCode struct + Code int + Messages string + func HABuildErrorCode(code int, msg string) HAErrorCode + type HAErrorResponse struct + func HABuildErrorResponse(errors []HAErrorCode, messages []HAMessages) (response *HAErrorResponse) + type HAMessages map[string]interface + type HAResponseCommon struct + Errors []HAErrorCode + Messages []HAMessages + Result HAResult + Success bool + type HAResult map[string]interface + type HAResultInfo map[string]interface + type HASuccessResponse struct + Result_info HAResultInfo + func HABuildSuccessRespone(result HAResult, messages []HAMessages, result_info ...HAResultInfo) (response *HASuccessResponse)