Documentation
¶
Index ¶
Constants ¶
View Source
const ( NotEqualURLsCode int = iota + 1000 HTTPStatusChangedCode HTTPBodyLengthChangedCode ImageHashThresholdTriggeredCode HTTPBodyHashThresholdTriggeredCode )
Compare error codes.
View Source
const ( NotEqualURLsMessage = "left URL is different from right URL" HTTPStatusChangedMessage = "HTTP status code differs" HTTPBodyLengthChangedMessage = "HTTP body length differs significantly" ImageHashThresholdTriggeredMessage = "URL screenshot difference hash threshold triggered" HTTPBodyHashThresholdTriggeredMessage = "HTTP body fuzzy hash threshold triggered" )
Compare error messages.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// CDPPath path to CDP binary
CDPPath string
// DeadLine global deadline for URL processing
DeadLine int
// WaitTime defines time for URL stabilization
WaitTime int
// ImageWidth defines CDP viewport width
ImageWidth int
// ImageHight defines CDP viewport hight
ImageHight int
// BodyLengthThresholdPercentage defines threshold score (percentage) above which difference (for HTML body length) will be reported
BodyLengthThresholdPercentage int
// FuzzyThreshold defines threshold score (number) above which difference (for HTML) will be reported
FuzzyThreshold int
// ImageDistanceThreshold defines threshold score (number) above which difference (for Iamge) will be reported
ImageDistanceThreshold int
// http Client used to get URL Info
Client *http.Client
}
Config is a configration object for this library.
type HTTPStatusChangedError ¶
type HTTPStatusChangedError struct {
Code int `json:"code"`
Message string `json:"message"`
URL string `json:"URL"`
LeftStatusCode int `json:"leftStatusCode"`
RightStatusCode int `json:"rightStatusCode"`
}
HTTPStatusChangedError is returned when Compare method received URL infos with different status code.
func (*HTTPStatusChangedError) Error ¶
func (e *HTTPStatusChangedError) Error() string
Error returs simple string representation of the error.
type NotEqualURLsError ¶
type NotEqualURLsError struct {
Code int `json:"code"`
Message string `json:"message"`
URL string `json:"URL"`
ComparedURL string `json:"comparedURL"`
}
NotEqualURLsError is returned when Compare method received different URLs.
func (*NotEqualURLsError) Error ¶
func (e *NotEqualURLsError) Error() string
Error returs simple string representation of the error.
type ThresholdTriggeredError ¶
type ThresholdTriggeredError struct {
Code int `json:"code"`
Message string `json:"message"`
URL string `json:"URL"`
Current int `json:"current"`
Threshold int `json:"threshold"`
}
ThresholdTriggeredError is returned when URL infos triggered one of predefined thresholds during comparison.
func (*ThresholdTriggeredError) Error ¶
func (e *ThresholdTriggeredError) Error() string
Error returs simple string representation of the error.
Click to show internal directories.
Click to hide internal directories.