Documentation ¶
Index ¶
- Variables
- func Save(reports []*Report)
- func SetBasePath(basePath string)
- func SetCallbackConfiguration(callbackConf *CallbackConfig)
- func SetS3Configuration(reportS3Conf *ReportS3Config)
- type CallbackConfig
- type Report
- func (r *Report) Dump() string
- func (r *Report) GenerateAttachments(stepsgen map[string]any)
- func (r *Report) GenerateConnectionInfo(stepsgen map[string]any)
- func (r *Report) GenerateMoreIndexHTML() string
- func (r *Report) GenerateReportHttpRespone(stepsgen map[string]any)
- func (r *Report) Save() error
- func (r *Report) SaveFile() error
- func (r *Report) SaveS3() error
- func (r *Report) SendCallback() error
- type ReportConnectionInfo
- type ReportHttpRespone
- type ReportS3Config
Constants ¶
This section is empty.
Variables ¶
var ( // IsEnabled returns true if the report is enabled. IsEnabled = false // ReportS3Conf is the S3 report configuration. ReportS3Conf *ReportS3Config // CallbackConf is the callback report configuration. CallbackConf *CallbackConfig // BasePath is the base path of the report. BasePath = "/tmp/hidra" )
Functions ¶
func SetCallbackConfiguration ¶
func SetCallbackConfiguration(callbackConf *CallbackConfig)
SetCallbackConfiguration configures the callback report.
func SetS3Configuration ¶
func SetS3Configuration(reportS3Conf *ReportS3Config)
SetS3Configuration configures the S3 report.
Types ¶
type CallbackConfig ¶
type CallbackConfig struct { // URL is the URL of the callback. URL string `yaml:"url"` }
CallbackConfig is the callback report configuration.
type Report ¶
type Report struct { // Name is the name of the test. Name string `json:"name,omitempty"` // Path is the path of the test. Path string `json:"path,omitempty"` // Duration is the duration of the test. Duration string `json:"duration,omitempty"` // Metrics is the metrics of the test. Metrics map[string]float64 `json:"metrics,omitempty"` // LastError is the last error of the test. LastError string `json:"last_error,omitempty"` // Attachments is the attachments of the report. Attachments map[string][]byte `json:"-"` // AttachmentList is the list of attachments. AttachmentList []string `json:"attachments,omitempty"` // Tags is the tags of the report. Tags map[string]string `json:"tags,omitempty"` // ConnectionInfo is the connection info of the report. ConnectionInfo ReportConnectionInfo `json:"connection_info,omitempty"` // HttpInfo is the HTTP info of the report. HttpInfo ReportHttpRespone `json:"http_info,omitempty"` // Variables is the variables of the report. Variables map[string]string `json:"variables,omitempty"` }
Report is a report of a single test run.
func NewReport ¶
func NewReport(sample *config.SampleConfig, allMetrics []*metrics.Metric, variables map[string]string, duration time.Duration, stepsgen map[string]any, err error) *Report
NewReport creates a new report.
func (*Report) GenerateAttachments ¶
GenerateAttachments generates all attachnments of the report.
func (*Report) GenerateConnectionInfo ¶
GenerateConnectionInfo returns the connection info of the report.
func (*Report) GenerateMoreIndexHTML ¶
GenerateMoreIndexHTML generates the index.html for the report.
func (*Report) GenerateReportHttpRespone ¶
GenerateReportHttpRespone returns the HTTP response of the report.
func (*Report) SendCallback ¶
SendCallback sends a callback to the client.
type ReportConnectionInfo ¶
type ReportConnectionInfo struct { IP string `json:"ip,omitempty"` Traceroute []string `json:"traceroute,omitempty"` }
ReportConnectionInfo is the connection info of the report.
type ReportHttpRespone ¶
type ReportHttpRespone struct { // Headers is the headers of the report. Headers map[string]string `json:"headers,omitempty"` // ResponseCode ResponseCode int `json:"response_code,omitempty"` }
ReportHttpRespone is the HTTP response of the report.
type ReportS3Config ¶
type ReportS3Config struct { // Bucket is the bucket name. Bucket string `yaml:"bucket"` // Region is the region. Region string `yaml:"region"` // AccessKeyID is the access key ID. AccessKeyID string `yaml:"access_key_id"` // SecretAccessKey is the secret access key. SecretAccessKey string `yaml:"secret_access_key"` // Endpoint is the endpoint. Endpoint string `yaml:"endpoint"` // ForcePathStyle is the flag to force path style. ForcePathStyle bool `yaml:"force_path_style"` // UseSSL is the flag to use SSL. UseSSL bool `yaml:"use_ssl"` }
ReportS3Config is the S3 report configuration.