Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMultiple ¶
GetMultiple crawl and parse multiple Ads.txt files from remote hosts based on Ads.txt Specification Version 1.0.1 https://iabtechlab.com/wp-content/uploads/2017/09/IABOpenRTB_Ads.txt_Public_Spec_V1-0-1.pdf
Types ¶
type DataRecord ¶
type DataRecord struct { AdverterDomain string `json:"adverterdomain"` // AdverterDomain Domain name of the advertising system (required) PublisherAccountID string `json:"publisheraccountid"` // PublisherAccountID the identifier associated with the seller (required) AccountType string `json:"accountype"` // AccountType enumeration of the type of account: DIRECT or RESELLER (required) CertAuthorityID string `json:"certauthorityid,omitempty"` // CertAuthorityID An ID that uniquely identifies the advertising system within a certification authority (optional) }
DataRecord hold single Ads.txt data record
type Handler ¶
The Handler interface is used to process Ads.txt requests. It is similar to the net/http.Handler interface.
type HandlerFunc ¶
A HandlerFunc is a function signature that implements the Handler interface. A function with this signature can thus be used as a Handler.
type Records ¶
type Records struct { DataRecords []*DataRecord `json:"dataRecords"` Variables []*Variable `json:"variables"` Warnings []*Warning `json:"warnings"` Body []string `json:"body"` // Original Ads.txt file content }
Records holds collection of Ads.txt records parsed from an Ads.txt file, in addition to errors found during Ads.txt file parsing
func ParseBody ¶
ParseBody parse Ads.txt file based on Ads.txt Specification Version 1.0.1 https://iabtechlab.com/wp-content/uploads/2017/09/IABOpenRTB_Ads.txt_Public_Spec_V1-0-1.pdf
type Request ¶
type Request struct { Domain string `json:"domain"` // Domain holds the root domain of the remote host URL string `json:"url"` // URL of the Ads.txt file to fetch }
Request to fetch Ads.txt file from remote host
func NewRequest ¶
NewRequest create new Ads.txt file request from remote host
type Response ¶
type Response struct { *Request *Records Expires time.Time `json:"expires"` // Ads.txt file expiration date }
Response to an Ads.txt request: collection of Data\Variable records parsed from Ads.txt file and file expiration date
type Severity ¶
type Severity int
Severity of parse warning (low for moderate warning, high indicates potential error)
type Variable ¶
type Variable struct { Type string `json:"type"` // Type of variable record. Supported types are subdomain and contact Value string `json:"value"` // Value of variable record }
Variable hold single of Ads.txt variable record
type Warning ¶
type Warning struct { Index int `json:"index"` // Index of the line in the Ads.txt file in which warning was found Text string `json:"txt"` // Text of the line in the Ads.txt file in which warning was found Message string `json:"msg"` // Warning reason Level Severity `json:"level"` // Severity level of parse warning }
Warning represent failure to parse Ads.txt line according to official ads.txt spec