Documentation ¶
Index ¶
- func GetReportCounts(ctx context.Context, site, project, dataset, table string) ([]*analytics.WebVitalSummary, error)
- func UpdateReportsBQSchema(ctx context.Context, project, dataset, table string) error
- func WriteReportToBigQuery(ctx context.Context, project, dataset, table string, reports []*Report) error
- type CSPReport
- type ExpectCTReport
- type ExpectCTSubReport
- type Report
- type ReportToReport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetReportCounts ¶
func UpdateReportsBQSchema ¶
UpdateReportsBQSchema updates the bigquery schema if fields are added.
Types ¶
type CSPReport ¶
type CSPReport struct { CSPReport struct { DocumentURI string `json:"document-uri"` Referer string `json:"referrer"` ViolatedDirective string `json:"violated-directive"` EffectiveDirective string `json:"effective-directive"` OriginalPolicy string `json:"original-policy"` BlockedURI string `json:"blocked-uri"` StatusCode int `json:"status-code"` SourceFile string `json:"source-file"` LineNumber int `json:"line-number"` ColumnNumber int `json:"column-number"` } `json:"csp-report"` }
CSPReport is the struct for CSP errors. Spec is at https://www.w3.org/TR/CSP3/#violation.
type ExpectCTReport ¶
type ExpectCTReport struct {
ExpectCTReport ExpectCTSubReport `json:"expect-ct-report"`
}
ExpectCTReport is the struct for Expect-CT errors.
type ExpectCTSubReport ¶
type ExpectCTSubReport struct { DateTime time.Time `json:"date-time"` EffectiveExpirationDate time.Time `json:"effective-expiration-date"` Hostname string `json:"hostname"` Port int `json:"port"` Scts []string `json:"scts"` ServedCertificateChain []string `json:"served-certificate-chain"` ValidatedCertificateChain []string `json:"validated-certificate-chain"` }
ExpectCTSubReport is the internal datastructure of an ExpectCTReport.
type Report ¶
type Report struct { ExpectCT *ExpectCTReport `bigquery:",nullable"` CSP *CSPReport `bigquery:",nullable"` ReportTo []*ReportToReport // When we recorded this metric. Time bigquery.NullDateTime // What service this is for. Service bigquery.NullString }
Report is a simple interface for types exported by ParseReport.
func ParseReport ¶
ParseReport takes a content-type header and a body json string and parses it into valid Go structs.
type ReportToReport ¶
type ReportToReport struct { Type string `json:"type"` Age int `json:"age"` URL string `json:"url"` UserAgent string `json:"user_agent"` Body struct { AnticipatedRemoval float64 `json:"anticipatedRemoval,omitempty"` Blocked string `json:"blocked,omitempty"` BlockedURL string `json:"blockedURL,omitempty"` ColumnNumber int64 `json:"columnNumber,omitempty"` Directive string `json:"directive,omitempty"` Disposition string `json:"disposition,omitempty"` DocumentURL string `json:"documentURL,omitempty"` EffectiveDirective string `json:"effectiveDirective,omitempty"` ElapsedTime int64 `json:"elapsed_time,omitempty"` ID string `json:"id,omitempty"` LineNumber int64 `json:"lineNumber,omitempty"` Message string `json:"message,omitempty"` Method string `json:"method,omitempty"` OriginalPolicy string `json:"originalPolicy,omitempty"` Phase string `json:"phase,omitempty"` Policy string `json:"policy,omitempty"` Protocol string `json:"protocol,omitempty"` Reason string `json:"reason,omitempty"` Referrer string `json:"referrer,omitempty"` SamplingFraction float64 `json:"sampling_fraction,omitempty"` ServerIP string `json:"server_ip,omitempty"` SourceFile string `json:"sourceFile,omitempty"` Status int64 `json:"status,omitempty"` StatusCode int64 `json:"status_code,omitempty"` Type string `json:"type,omitempty"` } `json:"body"` }
ReportToReport is the struct for generic reports via the Reporting API. TODO: There are multiple ways browsers send the field statuscode!
Click to show internal directories.
Click to hide internal directories.