client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Latency

type Latency struct {
	TTFB         int `csv:"ttfb",json:"ttfb""`
	DNSresolve   int `csv:"dnsResolve",json:"dnsResolve"`
	Connect      int `csv:"conn",json:"conn"`
	TLSHandshake int `csv:"tlsHandShake",json:"tlsHandShake"`
	ProxyResp    int `csv:"proxyResp",json:"proxyResp"`
}

type PChickError

type PChickError struct {
	Err error
}

func (*PChickError) Error

func (err *PChickError) Error() string

func (*PChickError) MarshalCSV

func (err *PChickError) MarshalCSV() (string, error)

type Result

type Result struct {
	ProxyURL         URL         `csv:"proxy",json:"proxy,string"`
	Status           bool        `csv:"result",json:"result"`
	TargetURL        url.URL     `csv:"-",json:"-"`
	TargetStatusCode int         `csv:"targetStatusCode",json:"targetStatusCode"`
	ProxyStatusCode  int         `csv:"proxyStatusCode",json:"proxyStatusCode"`
	RespPayload      string      `csv:"-",json:"-"`
	ProxyRespHeader  http.Header `csv:"-",json:"-"`
	Latency          Latency     `csv:"latency",json:"latency"`
	ProxyServIPAddr  net.IP      `csv:"ProxyServIPAddr",json:"ProxyServIPAddr"`
	ProxyNodeIPAddr  net.IP      `csv:"ProxyNodeIPAddr",json:"ProxyNodeIPAddr"`
	Error            PChickError `csv:"error",json:"error"`
}

func TestHTTP

func TestHTTP(targetURL *url.URL, proxyURL *url.URL, timeOut time.Duration, includeRespBody bool) (res *Result, err error)

func TestUDPEcho

func TestUDPEcho(targetURL *url.URL, proxyURL *url.URL, timeOut time.Duration, includeRespPayload bool, debug bool) (res *Result, err error)

func (*Result) EnrichHTTP

func (res *Result) EnrichHTTP(err error) error

Enrich test Result with metadata and normilise Error text.

func (*Result) EnrichUdpEcho

func (res *Result) EnrichUdpEcho(err error) error

func (*Result) MarshalJSON

func (res *Result) MarshalJSON() ([]byte, error)

type URL added in v0.3.0

type URL struct {
	url.URL
}

func (URL) MarshalCSV added in v0.3.0

func (u URL) MarshalCSV() (string, error)

func (URL) MarshalJSON added in v0.3.0

func (u URL) MarshalJSON() (string, error)

Jump to

Keyboard shortcuts

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