network

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HttpStatusCode

func HttpStatusCode(url string) (int, error)

HttpStatusCode return http status code of url

Types

type Network

type Network struct {
	LocalIP                       net.IP
	DNS                           []string
	SubnetMask                    net.IP
	DefaultGateway                net.IP
	DefaultGatewayHardwareAddress net.HardwareAddr
	InterfaceName                 string
	HardwareAddress               net.HardwareAddr
	Suffix                        string
	Interface                     *net.Interface
}

Network is the interface which store network configuration data

func GetConfig

func GetConfig() (*Network, error)

GetConfig return instance of network configuration.

func RefreshConfig

func RefreshConfig() (*Network, error)

RefreshConfig refetch network configuration

func (*Network) String

func (network *Network) String() string

String return network information as string

type PingResult

type PingResult struct {
	Min, Max, Avg, Loss, Dev int
	Resolved                 bool
}

PingResult ping result struct

func Ping

func Ping(host string, pings int) (PingResult, error)

Ping ping destination return the info

func (PingResult) String

func (result PingResult) String() string

String return ping result in string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL