amp

package
v3.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConsentNone      = 0
	ConsentTCF1      = 1
	ConsentTCF2      = 2
	ConsentUSPrivacy = 3
)

Policy consent types

Variables

This section is empty.

Functions

func ReadPolicy

func ReadPolicy(ampParams Params, pbsConfigGDPREnabled bool) (privacy.PolicyWriter, error)

ReadPolicy returns a privacy writer in accordance to the query values consent, consent_type and gdpr_applies. Returned policy writer could either be GDPR, CCPA or NilPolicy. The second return value is a warning.

Types

type Params

type Params struct {
	Account           string
	AdditionalConsent string
	CanonicalURL      string
	Consent           string
	ConsentType       int64
	Debug             bool
	GdprApplies       *bool
	Origin            string
	Size              Size
	Slot              string
	StoredRequestID   string
	Targeting         string
	Timeout           *uint64
	Trace             string
}

Params defines the parameters of an AMP request.

func ParseParams

func ParseParams(httpRequest *http.Request) (Params, error)

ParseParams parses the AMP parameters from a HTTP request.

type Size

type Size struct {
	Height         int64
	Multisize      []openrtb2.Format
	OverrideHeight int64
	OverrideWidth  int64
	Width          int64
}

Size defines size information of an AMP request.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL