http

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info added in v0.2.1

type Info struct {
	Server             network.TCPInfo
	Client             network.TCPInfo
	Domain             string
	Ip                 string
	Port               int
	Code               int
	Hops               uint32
	DnsTimeMs          uint32
	ConnectTimeMs      uint32
	TLSHandshakeTimeMs uint32
	TtfbMs             uint32
	ReTransmitPackets  uint32
	Speed              float32 // unit kb/s
	TotalSize          int64
	TotalTimeMs        int64
	Error              string
	PingError          string
	Hash               string
	Loss               float32
	Rounds             []RoundTime
}

func Ping added in v0.2.1

func Ping(req *http.Request, ping bool, srcAddr string) (*Info, error)

func PingGet added in v0.2.1

func PingGet(url string, ping bool, srcAddr string) (*Info, error)

func PingSimple added in v0.2.1

func PingSimple(url string) (*Info, error)

func (*Info) String added in v0.2.1

func (h *Info) String() string

type Pinger added in v0.2.1

type Pinger struct {
	Req           *http.Request
	SysPing       bool
	SrcAddr       string
	ServerSupport bool
	BodyHasher    hash.Hash
	Redirect      bool
	Timeout       time.Duration
	ServerIp      string
	VerifyHost    bool
}

func (*Pinger) Ping added in v0.2.1

func (p *Pinger) Ping() (*Info, error)

type RoundTime added in v0.2.7

type RoundTime struct {
	Domain             string
	Ip                 string
	Port               int
	DnsTimeMs          uint32
	ConnectTimeMs      uint32
	TLSHandshakeTimeMs uint32
	TtfbMs             uint32
	TotalSize          int64
	TotalTimeMs        int64
}

type TcpWrapper

type TcpWrapper struct {
	// contains filtered or unexported fields
}

func (*TcpWrapper) Close

func (t *TcpWrapper) Close() error

func (*TcpWrapper) CommonInfo added in v0.3.1

func (t *TcpWrapper) CommonInfo() (*network.TCPInfo, error)

func (*TcpWrapper) Dial

func (t *TcpWrapper) Dial(_ context.Context, network, addr string) (conn net.Conn, err error)

func (*TcpWrapper) DialTLS

func (t *TcpWrapper) DialTLS(ctx context.Context, network, addr string) (conn net.Conn, err error)

func (*TcpWrapper) DnsTime added in v0.3.0

func (t *TcpWrapper) DnsTime() time.Duration

func (*TcpWrapper) LocalAddr

func (t *TcpWrapper) LocalAddr() net.Addr

func (*TcpWrapper) Read

func (t *TcpWrapper) Read(b []byte) (n int, err error)

func (*TcpWrapper) RemoteAddr

func (t *TcpWrapper) RemoteAddr() net.Addr

func (*TcpWrapper) SetDeadline

func (t *TcpWrapper) SetDeadline(tm time.Time) error

func (*TcpWrapper) SetReadDeadline

func (t *TcpWrapper) SetReadDeadline(tm time.Time) error

func (*TcpWrapper) SetWriteDeadline

func (t *TcpWrapper) SetWriteDeadline(tm time.Time) error

func (*TcpWrapper) TTFB

func (t *TcpWrapper) TTFB() time.Duration

func (*TcpWrapper) TcpHandshake added in v0.3.0

func (t *TcpWrapper) TcpHandshake() time.Duration

func (*TcpWrapper) TlsHandshake added in v0.3.0

func (t *TcpWrapper) TlsHandshake() time.Duration

func (*TcpWrapper) Write

func (t *TcpWrapper) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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