Versions in this module Expand all Collapse all v1 v1.0.6 Jun 26, 2023 Changes in this version + const CCPANo + const CCPANotApplicable + const CCPAVersion + const CCPAYes + const SectionIDCANTCF + const SectionIDEUTCFv2 + const SectionIDUSCA + const SectionIDUSCO + const SectionIDUSCT + const SectionIDUSNAT + const SectionIDUSPV1 + const SectionIDUSUT + const SectionIDUSVA + var PrecompiledFibonacci = map[int]int + func FibonacciIndexValue(index int) (int, error) + func IsValidCCPAString(ccpaString string) (bool, error) + func ParseGpcSubsection(r *ConsentReader) (bool, error) + func ParseGppConsent(s string) (map[int]GppParsedConsent, error) + type CcpaParsedConsent struct + LSPACoveredTransaction uint8 + Notice uint8 + OptOutSale uint8 + Version int + func ParseCCPA(s string) (*CcpaParsedConsent, error) + type ConsentReader struct + func NewConsentReader(src []byte) *ConsentReader + func (r *ConsentReader) ReadBitField(n uint) (map[int]bool, error) + func (r *ConsentReader) ReadFibonacciInt() (int, error) + func (r *ConsentReader) ReadFibonacciRange() ([]int, error) + func (r *ConsentReader) ReadInt(n uint) (int, error) + func (r *ConsentReader) ReadMspaBitfieldConsent(l uint) (map[int]MspaConsent, error) + func (r *ConsentReader) ReadMspaConsent() (MspaConsent, error) + func (r *ConsentReader) ReadMspaNaYesNo() (MspaNaYesNo, error) + func (r *ConsentReader) ReadMspaNotice() (MspaNotice, error) + func (r *ConsentReader) ReadMspaOptOut() (MspaOptout, error) + func (r *ConsentReader) ReadNBitField(n, l uint) (map[int]int, error) + func (r *ConsentReader) ReadPubRestrictionEntries(n uint) ([]*PubRestrictionEntry, error) + func (r *ConsentReader) ReadPublisherTCEntry() (*PublisherTCEntry, error) + func (r *ConsentReader) ReadRangeEntries(n uint) ([]*RangeEntry, error) + func (r *ConsentReader) ReadRestrictionType() (RestrictionType, error) + func (r *ConsentReader) ReadSegmentType() (SegmentType, error) + func (r *ConsentReader) ReadString(n uint) (string, error) + func (r *ConsentReader) ReadTime() (time.Time, error) + func (r *ConsentReader) ReadVendors(t SegmentType) (*OOBVendorList, error) + type GppHeader struct + Sections []int + Type int + Version int + func ParseGppHeader(s string) (*GppHeader, error) + type GppParsedConsent interface + type GppSection struct + func (g *GppSection) GetSectionId() int + func (g *GppSection) GetSectionValue() string + type GppSectionParser interface + GetSectionId func() int + GetSectionValue func() string + ParseConsent func() (GppParsedConsent, error) + func MapGppSectionToParser(s string) ([]GppSectionParser, error) + type GppSubSection struct + Gpc bool + func ParseGppSubSections(subSections []string) (*GppSubSection, error) + type GppSubSectionTypes int + const SubSectCore + const SubSectGpc + type MspaConsent int + const Consent + const ConsentNotApplicable + const InvalidConsentValue + const NoConsent + type MspaNaYesNo int + const InvalidMspaValue + const MspaNo + const MspaNotApplicable + const MspaYes + type MspaNotice int + const InvalidNoticeValue + const NoticeNotApplicable + const NoticeNotProvided + const NoticeProvided + type MspaOptout int + const InvalidOptOutValue + const NotOptedOut + const OptOutNotApplicable + const OptedOut + type MspaParsedConsent struct + Gpc bool + KnownChildSensitiveDataConsents map[int]MspaConsent + MspaCoveredTransaction MspaNaYesNo + MspaOptOutOptionMode MspaNaYesNo + MspaServiceProviderMode MspaNaYesNo + PersonalDataConsents MspaConsent + SaleOptOut MspaOptout + SaleOptOutNotice MspaNotice + SensitiveDataLimitUseNotice MspaNotice + SensitiveDataProcessing map[int]MspaConsent + SensitiveDataProcessingOptOutNotice MspaNotice + SharingNotice MspaNotice + SharingOptOut MspaOptout + SharingOptOutNotice MspaNotice + TargetedAdvertisingOptOut MspaOptout + TargetedAdvertisingOptOutNotice MspaNotice + Version int + type MspaUsCA struct + func NewMspaCA(section string) *MspaUsCA + func (m *MspaUsCA) ParseConsent() (GppParsedConsent, error) + type MspaUsCO struct + func NewMspaCO(section string) *MspaUsCO + func (m *MspaUsCO) ParseConsent() (GppParsedConsent, error) + type MspaUsCT struct + func NewMspaCT(section string) *MspaUsCT + func (m *MspaUsCT) ParseConsent() (GppParsedConsent, error) + type MspaUsNational struct + func NewMspaNational(section string) *MspaUsNational + func (m *MspaUsNational) ParseConsent() (GppParsedConsent, error) + type MspaUsUT struct + func NewMspaUT(section string) *MspaUsUT + func (m *MspaUsUT) ParseConsent() (GppParsedConsent, error) + type MspaUsVA struct + func NewMspaVA(section string) *MspaUsVA + func (m *MspaUsVA) ParseConsent() (GppParsedConsent, error) + type NotSupported struct + func NewNotSupported(section string, sectionID int) *NotSupported + func (n *NotSupported) ParseConsent() (GppParsedConsent, error) + type OOBVendorList struct + IsRangeEncoding bool + MaxVendorID int + NumEntries int + SegmentType SegmentType + VendorEntries []*RangeEntry + Vendors map[int]bool + type ParsedConsent struct + CMPID int + CMPVersion int + ConsentLanguage string + ConsentScreen int + ConsentedVendors map[int]bool + Created time.Time + DefaultConsent bool + IsRangeEncoding bool + LastUpdated time.Time + MaxVendorID int + NumEntries int + PurposesAllowed map[int]bool + RangeEntries []*RangeEntry + VendorListVersion int + Version int + func Parse(s string) (*ParsedConsent, error) + func ParseV1(s string) (*ParsedConsent, error) + func (p *ParsedConsent) EveryPurposeAllowed(ps []int) bool + func (p *ParsedConsent) PurposeAllowed(ps int) bool + func (p *ParsedConsent) SuitableToProcess(ps []int, v int) bool + func (p *ParsedConsent) VendorAllowed(v int) bool + type PubRestrictionEntry struct + NumEntries int + PurposeID int + RestrictionType RestrictionType + RestrictionsRange []*RangeEntry + type PublisherTCEntry struct + CustomPurposesConsent map[int]bool + CustomPurposesLITransparency map[int]bool + NumCustomPurposes int + PubPurposesConsent map[int]bool + PubPurposesLITransparency map[int]bool + SegmentType SegmentType + type RangeEntry struct + EndVendorID int + StartVendorID int + type RestrictionType int + const PurposeFlatlyNotAllowed + const RequireConsent + const RequireLegitimateInterest + const Undefined + type SegmentType int + const AllowedVendors + const CoreString + const DisclosedVendors + const PublisherTC + type SpecialFeature int + const ActivelyScanDevice + const InvalidSpecialFeature + const UsePreciseGeolocation + type SpecialPurpose int + const EnsureSecurity + const InvalidSpecialPurpose + const TechnicallyDeliverAds + type TCFCA struct + func NewTCFCA(section string) *TCFCA + func (t *TCFCA) ParseConsent() (GppParsedConsent, error) + type TCFEU struct + func NewTCFEU(section string) *TCFEU + func (t *TCFEU) ParseConsent() (GppParsedConsent, error) + type TCFVersion int + const InvalidTCFVersion + const V1 + const V2 + func TCFVersionFromTCString(s string) TCFVersion + type USPV struct + func NewUSPV(section string) *USPV + func (u *USPV) ParseConsent() (GppParsedConsent, error) + type V2CAParsedConsent struct + CMPID int + CMPVersion int + ConsentLanguage string + ConsentScreen int + Created time.Time + ExpressConsentedVendors map[int]bool + ImpliedConsentedVendors map[int]bool + IsExpressConsentRangeEncoding bool + IsImpliedConsentRangeEncoding bool + LastUpdated time.Time + MaxExpressConsentVendorID int + MaxImpliedConsentVendorID int + NumExpressConsentEntries int + NumImpliedConsentEntries int + PurposesExpressConsent map[int]bool + PurposesImpliedConsent map[int]bool + SpecialFeatureExpressConsent map[int]bool + TCFPolicyVersion int + UseNonStandardStacks bool + VendorExpressConsent []*RangeEntry + VendorImpliedConsent []*RangeEntry + VendorListVersion int + Version int + func ParseCAV2(s string) (*V2CAParsedConsent, error) + type V2ParsedConsent struct + CMPID int + CMPVersion int + ConsentLanguage string + ConsentScreen int + ConsentedVendors map[int]bool + ConsentedVendorsRange []*RangeEntry + Created time.Time + InterestsVendors map[int]bool + InterestsVendorsRange []*RangeEntry + IsConsentRangeEncoding bool + IsInterestsRangeEncoding bool + IsServiceSpecific bool + LastUpdated time.Time + MaxConsentVendorID int + MaxInterestsVendorID int + NumConsentEntries int + NumInterestsEntries int + NumPubRestrictions int + OOBAllowedVendors *OOBVendorList + OOBDisclosedVendors *OOBVendorList + PubRestrictionEntries []*PubRestrictionEntry + PublisherCC string + PurposeOneTreatment bool + PurposesConsent map[int]bool + PurposesLITransparency map[int]bool + SpecialFeaturesOptIn map[int]bool + TCFPolicyVersion int + UseNonStandardStacks bool + VendorListVersion int + Version int + func ParseV2(s string) (*V2ParsedConsent, error) + func (p *V2ParsedConsent) EveryPurposeAllowed(ps []int) bool + func (p *V2ParsedConsent) PublisherRestricted(ps []int, v int) bool + func (p *V2ParsedConsent) PurposeAllowed(ps int) bool + func (p *V2ParsedConsent) SuitableToProcess(ps []int, v int) bool + func (p *V2ParsedConsent) VendorAllowed(v int) bool