Documentation ¶
Index ¶
- type Bits
- type CoreString
- func (c *CoreString) Encode() string
- func (c *CoreString) GetPubRestrictionsForPurpose(id int) []*PubRestriction
- func (c *CoreString) IsPurposeAllowed(id int) bool
- func (c *CoreString) IsPurposeLIAllowed(id int) bool
- func (c *CoreString) IsSpecialFeatureAllowed(id int) bool
- func (c *CoreString) IsVendorAllowed(id int) bool
- func (c *CoreString) IsVendorAllowedForFlexiblePurposes(id int, purposeIds ...int) bool
- func (c *CoreString) IsVendorAllowedForFlexiblePurposesLI(id int, purposeIds ...int) bool
- func (c *CoreString) IsVendorAllowedForPurposes(id int, purposeIds ...int) bool
- func (c *CoreString) IsVendorAllowedForPurposesLI(id int, purposeIds ...int) bool
- func (c *CoreString) IsVendorLIAllowed(id int) bool
- type DisclosedVendors
- type PubRestriction
- type PublisherTC
- type RangeEntry
- type RestrictionType
- type SegmentType
- type TCData
- func (t *TCData) GetPubRestrictionsForPurpose(id int) []*PubRestriction
- func (t *TCData) IsPurposeAllowed(id int) bool
- func (t *TCData) IsPurposeLIAllowed(id int) bool
- func (t *TCData) IsSpecialFeatureAllowed(id int) bool
- func (t *TCData) IsVendorAllowed(id int) bool
- func (t *TCData) IsVendorAllowedForFlexiblePurposes(id int, purposeIds ...int) bool
- func (t *TCData) IsVendorAllowedForFlexiblePurposesLI(id int, purposeIds ...int) bool
- func (t *TCData) IsVendorAllowedForPurposes(id int, purposeIds ...int) bool
- func (t *TCData) IsVendorAllowedForPurposesLI(id int, purposeIds ...int) bool
- func (t *TCData) IsVendorLIAllowed(id int) bool
- func (t *TCData) ToTCString() string
- type TCEncoder
- type TcfVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoreString ¶
type CoreString struct { Version int Created time.Time LastUpdated time.Time CmpId int CmpVersion int ConsentScreen int ConsentLanguage string VendorListVersion int TcfPolicyVersion int IsServiceSpecific bool UseNonStandardTexts bool SpecialFeatureOptIns map[int]bool PurposesConsent map[int]bool PurposesLITransparency map[int]bool PurposeOneTreatment bool PublisherCC string MaxVendorId int IsRangeEncoding bool VendorsConsent map[int]bool NumEntries int RangeEntries []*RangeEntry MaxVendorIdLI int IsRangeEncodingLI bool VendorsLITransparency map[int]bool NumEntriesLI int RangeEntriesLI []*RangeEntry NumPubRestrictions int PubRestrictions []*PubRestriction }
func DecodeCoreString ¶
func DecodeCoreString(coreString string) (c *CoreString, err error)
Decodes a Core String value and returns it as a CoreString structure
func (*CoreString) Encode ¶
func (c *CoreString) Encode() string
Returns structure as a base64 raw url encoded string
func (*CoreString) GetPubRestrictionsForPurpose ¶ added in v1.0.3
func (c *CoreString) GetPubRestrictionsForPurpose(id int) []*PubRestriction
Returns a list of publisher restrictions applied to purpose id
func (*CoreString) IsPurposeAllowed ¶
func (c *CoreString) IsPurposeAllowed(id int) bool
Returns true if user has given consent to purpose id
func (*CoreString) IsPurposeLIAllowed ¶
func (c *CoreString) IsPurposeLIAllowed(id int) bool
Returns true if legitimate interest is established for purpose id and user didn't exercise their right to object
func (*CoreString) IsSpecialFeatureAllowed ¶
func (c *CoreString) IsSpecialFeatureAllowed(id int) bool
Returns true if user has given consent to special feature id
func (*CoreString) IsVendorAllowed ¶
func (c *CoreString) IsVendorAllowed(id int) bool
Returns true if user has given consent to vendor id processing their personal data
func (*CoreString) IsVendorAllowedForFlexiblePurposes ¶ added in v1.1.0
func (c *CoreString) IsVendorAllowedForFlexiblePurposes(id int, purposeIds ...int) bool
Returns true if user has given consent to vendor id processing all purposes ids or if transparency for its legitimate interest is established in accordance with publisher restrictions
func (*CoreString) IsVendorAllowedForFlexiblePurposesLI ¶ added in v1.1.0
func (c *CoreString) IsVendorAllowedForFlexiblePurposesLI(id int, purposeIds ...int) bool
Returns true if transparency for vendor id's legitimate interest is established for all purpose ids or if user has given consent in accordance with publisher restrictions
func (*CoreString) IsVendorAllowedForPurposes ¶ added in v1.0.3
func (c *CoreString) IsVendorAllowedForPurposes(id int, purposeIds ...int) bool
Returns true if user has given consent to vendor id processing all purposes ids and publisher hasn't set restrictions for them
func (*CoreString) IsVendorAllowedForPurposesLI ¶ added in v1.0.3
func (c *CoreString) IsVendorAllowedForPurposesLI(id int, purposeIds ...int) bool
Returns true if transparency for vendor id's legitimate interest is established for all purpose ids and publisher hasn't set restrictions for them
func (*CoreString) IsVendorLIAllowed ¶
func (c *CoreString) IsVendorLIAllowed(id int) bool
Returns true if transparency for vendor id's legitimate interest is established and user didn't exercise their right to object
type DisclosedVendors ¶
type DisclosedVendors struct { SegmentType int MaxVendorId int IsRangeEncoding bool DisclosedVendors map[int]bool NumEntries int RangeEntries []*RangeEntry }
func DecodeDisclosedVendors ¶
func DecodeDisclosedVendors(disclosedVendors string) (d *DisclosedVendors, err error)
Decodes a Disclosed Vendors value and returns it as a DisclosedVendors structure
func (*DisclosedVendors) Encode ¶
func (d *DisclosedVendors) Encode() string
Returns structure as a base64 raw url encoded string
func (*DisclosedVendors) IsVendorDisclosed ¶
func (d *DisclosedVendors) IsVendorDisclosed(id int) bool
Returns true if vendor id is disclosed for validating OOB signaling
type PubRestriction ¶
type PubRestriction struct { PurposeId int RestrictionType RestrictionType NumEntries int RangeEntries []*RangeEntry }
func (*PubRestriction) IsVendorIncluded ¶ added in v1.0.3
func (p *PubRestriction) IsVendorIncluded(id int) bool
Returns true if restriction is applied to vendor id
type PublisherTC ¶
type PublisherTC struct { SegmentType int PubPurposesConsent map[int]bool PubPurposesLITransparency map[int]bool NumCustomPurposes int CustomPurposesConsent map[int]bool CustomPurposesLITransparency map[int]bool }
func DecodePublisherTC ¶
func DecodePublisherTC(publisherTC string) (p *PublisherTC, err error)
Decodes a Publisher TC value and returns it as a PublisherTC structure
func (*PublisherTC) Encode ¶
func (p *PublisherTC) Encode() string
Returns structure as a base64 raw url encoded string
func (*PublisherTC) IsCustomPurposeAllowed ¶
func (p *PublisherTC) IsCustomPurposeAllowed(id int) bool
Returns true if user has given consent to custom purpose id
func (*PublisherTC) IsCustomPurposeLIAllowed ¶
func (p *PublisherTC) IsCustomPurposeLIAllowed(id int) bool
Returns true if legitimate interest is established for custom purpose id and user didn't exercise their right to object
func (*PublisherTC) IsPurposeAllowed ¶
func (p *PublisherTC) IsPurposeAllowed(id int) bool
Returns true if user has given consent to standard purpose id
func (*PublisherTC) IsPurposeLIAllowed ¶
func (p *PublisherTC) IsPurposeLIAllowed(id int) bool
Returns true if legitimate interest is established for standard purpose id and user didn't exercise their right to object
type RangeEntry ¶
type RestrictionType ¶ added in v1.0.3
type RestrictionType int
const ( RestrictionTypeNotAllowed RestrictionType = 0 RestrictionTypeRequireConsent RestrictionType = 1 RestrictionTypeRequireLI RestrictionType = 2 RestrictionTypeUndefined RestrictionType = 3 )
type SegmentType ¶ added in v1.0.2
type SegmentType int
const ( SegmentTypeUndefined SegmentType = -1 SegmentTypeCoreString SegmentType = 0 SegmentTypeDisclosedVendors SegmentType = 1 SegmentTypePublisherTC SegmentType = 3 )
func GetSegmentType ¶ added in v1.0.2
func GetSegmentType(segment string) (segmentType SegmentType, err error)
Decodes a segment value and returns the SegmentType - SegmentTypeUndefined = -1 - SegmentTypeCoreString = 0 - SegmentTypeDisclosedVendors = 1 - SegmentTypePublisherTC = 3
type TCData ¶
type TCData struct { CoreString *CoreString DisclosedVendors *DisclosedVendors PublisherTC *PublisherTC }
func Decode ¶
Decode a TC String and returns it as a TCData structure A valid TC String must start with a Core String segment A TC String can optionally and arbitrarily ordered contain: - Disclosed Vendors - Publisher TC
func (*TCData) GetPubRestrictionsForPurpose ¶ added in v1.0.3
func (t *TCData) GetPubRestrictionsForPurpose(id int) []*PubRestriction
Returns a list of publisher restrictions applied to purpose id
func (*TCData) IsPurposeAllowed ¶
Returns true if user has given consent to purpose id
func (*TCData) IsPurposeLIAllowed ¶
Returns true if legitimate interest is established for purpose id and user didn't exercise their right to object
func (*TCData) IsSpecialFeatureAllowed ¶ added in v1.0.2
Returns true if user has given consent to special feature id
func (*TCData) IsVendorAllowed ¶
Returns true if user has given consent to vendor id processing their personal data
func (*TCData) IsVendorAllowedForFlexiblePurposes ¶ added in v1.1.0
Returns true if user has given consent to vendor id processing all purposes ids or if transparency for its legitimate interest is established in accordance with publisher restrictions
func (*TCData) IsVendorAllowedForFlexiblePurposesLI ¶ added in v1.1.0
Returns true if transparency for vendor id's legitimate interest is established for all purpose ids or if user has given consent in accordance with publisher restrictions
func (*TCData) IsVendorAllowedForPurposes ¶ added in v1.0.3
Returns true if user has given consent to vendor id processing all purposes ids and publisher hasn't set restrictions for them
func (*TCData) IsVendorAllowedForPurposesLI ¶ added in v1.0.3
Returns true if transparency for vendor id's legitimate interest is established for all purpose ids and publisher hasn't set restrictions for them
func (*TCData) IsVendorLIAllowed ¶
Returns true if transparency for vendor id's legitimate interest is established and user didn't exercise their right to object
func (*TCData) ToTCString ¶
Returns structure as a base64 raw url encoded string
type TcfVersion ¶ added in v1.0.2
type TcfVersion int
const ( TcfVersionUndefined TcfVersion = -1 TcfVersion1 TcfVersion = 1 TcfVersion2 TcfVersion = 2 )
func GetVersion ¶ added in v1.0.2
func GetVersion(s string) (version TcfVersion, err error)
Decodes a string and returns the TcfVersion It can also decode version from a TCF V1.1 consent string - TcfVersionUndefined = -1 - TcfVersion1 = 1 - TcfVersion2 = 2