Documentation ¶
Index ¶
- Variables
- func LookupIP(host string) (net.IP, error)
- func LookupIPv4(host string) (net.IP, error)
- func LookupIPv6(host string) (net.IP, error)
- type DnsPing
- type DnsPingResult
- type HttpPing
- type HttpPingResult
- type IPing
- type IPingResult
- type IcmpPing
- type IcmpPingResult
- type QuicPing
- type QuicPingResult
- type TcpPing
- type TcpPingResult
- type TlsPing
- type TlsPingResult
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type DnsPing ¶ added in v0.6.0
type DnsPing struct { Port uint16 Timeout time.Duration // udp, tcp, tcp-tls,默认 udp Net string // A, AAAA, NS, ...,默认 NS Type string // 查询域名,默认 . Domain string // Net 为 tcp-tls 时,是否跳过证书验证 Insecure bool // contains filtered or unexported fields }
func (*DnsPing) Ping ¶ added in v0.6.0
func (this *DnsPing) Ping() IPingResult
func (*DnsPing) PingContext ¶ added in v0.6.0
func (this *DnsPing) PingContext(ctx context.Context) IPingResult
type DnsPingResult ¶ added in v0.6.0
func (*DnsPingResult) Error ¶ added in v0.6.0
func (this *DnsPingResult) Error() error
func (*DnsPingResult) Result ¶ added in v0.6.0
func (this *DnsPingResult) Result() int
func (*DnsPingResult) String ¶ added in v0.6.0
func (this *DnsPingResult) String() string
type HttpPing ¶
type HttpPing struct { Method string URL string Timeout time.Duration // 以下参数全部为可选 DisableHttp2 bool DisableCompression bool Insecure bool Referrer string UserAgent string Http3 bool IP net.IP }
func (*HttpPing) Ping ¶
func (this *HttpPing) Ping() IPingResult
func (*HttpPing) PingContext ¶
func (this *HttpPing) PingContext(ctx context.Context) IPingResult
type HttpPingResult ¶
func (*HttpPingResult) Error ¶
func (this *HttpPingResult) Error() error
func (*HttpPingResult) Result ¶
func (this *HttpPingResult) Result() int
func (*HttpPingResult) String ¶
func (this *HttpPingResult) String() string
type IPing ¶
type IPing interface { Ping() IPingResult PingContext(context.Context) IPingResult }
type IcmpPing ¶
type IcmpPing struct { Timeout time.Duration Privileged bool TTL int Size int // contains filtered or unexported fields }
func (*IcmpPing) Ping ¶
func (this *IcmpPing) Ping() IPingResult
func (*IcmpPing) PingContext ¶
func (this *IcmpPing) PingContext(ctx context.Context) IPingResult
type IcmpPingResult ¶
func (*IcmpPingResult) Error ¶
func (this *IcmpPingResult) Error() error
func (*IcmpPingResult) Result ¶
func (this *IcmpPingResult) Result() int
func (*IcmpPingResult) String ¶
func (this *IcmpPingResult) String() string
type QuicPing ¶ added in v0.8.0
type QuicPing struct { Host string Port uint16 Timeout time.Duration // 以下为可选参数 Insecure bool ALPN string IP net.IP }
func NewQuicPing ¶ added in v0.8.0
func (*QuicPing) Ping ¶ added in v0.8.0
func (this *QuicPing) Ping() IPingResult
func (*QuicPing) PingContext ¶ added in v0.8.0
func (this *QuicPing) PingContext(ctx context.Context) IPingResult
type QuicPingResult ¶ added in v0.8.0
func (*QuicPingResult) Error ¶ added in v0.8.0
func (this *QuicPingResult) Error() error
func (*QuicPingResult) Result ¶ added in v0.8.0
func (this *QuicPingResult) Result() int
func (*QuicPingResult) String ¶ added in v0.8.0
func (this *QuicPingResult) String() string
type TcpPing ¶
func (*TcpPing) Ping ¶
func (this *TcpPing) Ping() IPingResult
func (*TcpPing) PingContext ¶
func (this *TcpPing) PingContext(ctx context.Context) IPingResult
type TcpPingResult ¶
func (*TcpPingResult) Error ¶
func (this *TcpPingResult) Error() error
func (*TcpPingResult) Result ¶
func (this *TcpPingResult) Result() int
func (*TcpPingResult) String ¶
func (this *TcpPingResult) String() string
type TlsPing ¶
type TlsPing struct { Host string Port uint16 ConnectionTimeout time.Duration HandshakeTimeout time.Duration // 以下为可选参数 TlsVersion uint16 Insecure bool IP net.IP }
func (*TlsPing) Ping ¶
func (this *TlsPing) Ping() IPingResult
func (*TlsPing) PingContext ¶
func (this *TlsPing) PingContext(ctx context.Context) IPingResult
type TlsPingResult ¶
type TlsPingResult struct { ConnectionTime int HandshakeTime int TLSVersion uint16 Err error IP net.IP }
func (*TlsPingResult) Error ¶
func (this *TlsPingResult) Error() error
func (*TlsPingResult) Result ¶
func (this *TlsPingResult) Result() int
func (*TlsPingResult) String ¶
func (this *TlsPingResult) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.