tester

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertificateFileError

type CertificateFileError struct {
	FileName string
	Err      error
}

func (*CertificateFileError) Error

func (r *CertificateFileError) Error() string

type CertificateFileFormatError

type CertificateFileFormatError struct {
	FileName string
	Err      error
}

func (*CertificateFileFormatError) Error

type Duration

type Duration struct {
	Duration,
	Total time.Duration
}

type Durations

type Durations struct {
	DNSLookup,
	TCPConnection,
	TLSHandshake,
	ConnectionEstablishment,
	TTFB,
	Total Duration
}

type HttpCodeError added in v0.0.9

type HttpCodeError struct {
	Err error
}

func (*HttpCodeError) Error added in v0.0.9

func (r *HttpCodeError) Error() string

type HttpEngine

type HttpEngine struct {
	Progress RequestsProgress
	// contains filtered or unexported fields
}

func (*HttpEngine) GetProgress

func (engine *HttpEngine) GetProgress() RequestsProgress

func (*HttpEngine) Measure

func (engine *HttpEngine) Measure(
	parameters Parameters,
	resourceFeeder *ResourceFeeder,
	onProgress func(progress RequestsProgress),
) ([]MeasurementResult, time.Duration)

type MeasurementResult

type MeasurementResult struct {
	RequestResult RequestResult
	Error         error
}

func Test

func Test(parameters Parameters, onProgress func(progress RequestsProgress)) (
	[]MeasurementResult, time.Duration, error,
)

type Parameters

type Parameters struct {
	Resources             []Resource
	Requests              int
	Concurrency           int
	Timeout               time.Duration
	Method                string
	UserAgent             string
	UserAgentTemplate     string
	KeepAlive             bool
	Proxy                 string
	MaxIdleConnections    int
	IdleConnTimeout       time.Duration
	TLSHandshakeTimeout   time.Duration
	IPv4Only              bool
	IPv6Only              bool
	AllowInsecureSSL      bool
	ClientCertificateFile string
	PostDataFile          string
	PostData              string
	ContentType           string
	FormData              string
	OutputFormat          string
	CustomHeaders         []string
	TimeLimit             time.Duration
	URLListFile           string
	ExitWithErrorOnCode   []string
}

type PostDataFileError

type PostDataFileError struct {
	FileName string
	Err      error
}

func (*PostDataFileError) Error

func (r *PostDataFileError) Error() string

type RequestResult

type RequestResult struct {
	Resource      Resource
	Status        string // e.g. "200 OK"
	StatusCode    int    // e.g. 200
	ContentLength int64
	Timing        Timing
	Durations     Durations
	TLS           TLS
	Headers       ResponseHeaders
	Error         error
}

func (RequestResult) ToJson

func (result RequestResult) ToJson() ([]byte, error)

type RequestsProgress

type RequestsProgress struct {
	TotalRequests,
	CompletedRequests,
	FailedRequests int
}

type Resource added in v0.0.9

type Resource struct {
	Url *url.URL
}

type ResourceFeeder added in v0.0.9

type ResourceFeeder struct {
	Resources []Resource
	// contains filtered or unexported fields
}

func (*ResourceFeeder) GetNextValue added in v0.0.9

func (s *ResourceFeeder) GetNextValue() (Resource, error)

type ResponseError

type ResponseError struct {
	Message string
	Err     error
}

func (*ResponseError) Error

func (r *ResponseError) Error() string

type ResponseHeaders

type ResponseHeaders struct {
	Server,
	PoweredBy string
}

type TLS

type TLS struct {
	UseTLS     bool
	TLSVersion string
}

type TestEngine

type TestEngine interface {
	Measure(
		parameters Parameters,
		resourceFeeder *ResourceFeeder,
		onProgress func(progress RequestsProgress),
	) ([]MeasurementResult, time.Duration)

	GetProgress() RequestsProgress
}

type Timing

type Timing struct {
	Start,
	DNSStart,
	DNSEnd,
	TCPConnect,
	ServerConnect,
	TTFB,
	TLSHandshakeStart,
	TLSHandshakeEnd,
	RequestSent,
	TotalTime time.Time
}

Jump to

Keyboard shortcuts

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