modulepackage
0.0.0-20191215111754-a1026e1c77cb
Repository: https://github.com/ymiz/go-webpagetest.git
Documentation: pkg.go.dev
# README
go-webpagetest
Simple, opionated wrapper for WebPagetest API and CLI (mostly as a test for wrapper itself)
Usage
Get it with:
go get -d -v github.com/olegfedoseev/go-webpagetest
And than in you code:
import "github.com/olegfedoseev/go-webpagetest"
wpt, err := webpagetest.NewClient("https://webpagetest.org")
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
result, err := wpt.RunTest(webpagetest.TestSettings{
URL: "https://google.com",
Location: "Frankfurt_Ruxit:Chrome",
Runs: 3,
ScreenWidth: 1280,
ScreenHeight: 720,
})
if err != nil {
log.Fatalf("Error: %v", err)
}
fmt.Printf("Result: %#v", result)
Or you can look at source code of CLI at cmd/main.go
# Packages
No description provided by the author
# Functions
NewClient returns new ready to use Client.
# Structs
Breakdown is struct for data for pie charts of resource distribution.
Client is client of WebPageTest.
Connectivity settings for test.
Domain is struct for stats about requests form particular domain.
Headers is struct for http headers of request and response.
Images is struct for links to originals of various images for test tun.
Location is where your agents are.
Pages is struct for links to various pages about test run.
RawData is struct for links to raw data about test tun.
ResultData holds all info about test.
Tester is an agent that will run tests.
TestInfo is info about test.
TestRun is a test run info.
TestSettings is structure for describing what should be done in test run.
TestStatus is status of a test.
TestStep is struct with information of one particular test "run".
TestView struct tries to combine to kinds of testViews than WebPagetest returns With Steps in case of scripted run and without steps, when we test single url Because Go is strictly typed, we have to "merge" them in one data type.
Thumbnails is struct for links to thumbnails of various images for test tun.
VideoFrame is struct for one video frame.
# Type aliases
Locations grouped by Group.
StatusCallback is helper type for function to be called while waiting for test to complete.
Testers is an array of Tester.