Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pinger ¶
type Pinger struct { DnsResolver types.DnsResolver Latency types.Latency }
func NewPingerWithDnsResolver ¶
func NewPingerWithDnsResolver(dnsResolver types.DnsResolver) *Pinger
Create a new Minecraft Pinger with a custom DNS resolver
func (*Pinger) Ping ¶
Ping and get information from an host and port, default timeout: 3s Return a pointer to types.PingResponse or an error
Error is thrown when the host is unreachable or the data received are incorrect ¶
Example: Pinger.Ping("play.hypixel.net", 25565)
func (*Pinger) PingWithTimeout ¶
func (p *Pinger) PingWithTimeout(host string, port uint16, timeout time.Duration) (*types.PingResponse, error)
Ping and get information from an host and port with a custom timeout Return a pointer to types.PingResponse or an error
Error is thrown when the host is unreachable or the data received are incorrect ¶
Example: pinger.Ping("play.hypixel.net", 25565, 5 * time.Second)
Click to show internal directories.
Click to hide internal directories.