Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdsTxt ¶
func DefaultResolve ¶
DefaultResolve requests and parses ads.txt using a default HTTP client
func Parse ¶
Parse parses ads.txt from in
Example ¶
rawAdsTxt := strings.NewReader(`# comment foo,bar,DIRECT,baz one,two,RESELLER three,four,RESELLER # another comment contact=foo contact=foobar subdomain=bar #comment`) adstxt, err := Parse(rawAdsTxt) fmt.Printf("error: %t\n", err != nil) fmt.Printf("record count: %d\n", len(adstxt.Records)) fmt.Printf("variable count: %d\n", len(adstxt.Variables))
Output: error: false record count: 3 variable count: 2
type Record ¶
type Record struct { AdSystemDomain string SellerAccountID string Relationship RelationshipType CertAuthorityID string Extension string }
type RelationshipType ¶
type RelationshipType int
const ( RelationshipTypeUnspecified RelationshipType = iota Direct Reseller )
Click to show internal directories.
Click to hide internal directories.