Documentation
¶
Index ¶
- type AllowedVendors
- 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
- func (r *TCEncoder) ReadBitField(n uint) map[int]bool
- func (r *TCEncoder) ReadChars(n uint) string
- func (r *TCEncoder) ReadPubRestrictions() (int, []*PubRestriction)
- func (r *TCEncoder) ReadRangeEntries() (int, []*RangeEntry)
- func (r *TCEncoder) ReadTime() time.Time
- func (r *TCEncoder) WriteChars(v string, n uint)
- func (r *TCEncoder) WritePubRestrictions(entries []*PubRestriction)
- func (r *TCEncoder) WriteRangeEntries(entries []*RangeEntry)
- func (r *TCEncoder) WriteTime(v time.Time)
- type TcfVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowedVendors ¶
type AllowedVendors struct {
SegmentType int
MaxVendorId int
IsRangeEncoding bool
AllowedVendors map[int]bool
NumEntries int
RangeEntries []*RangeEntry
}
func DecodeAllowedVendors ¶
func DecodeAllowedVendors(allowedVendors string) (a *AllowedVendors, err error)
Decodes a Allowed Vendors value and returns it as a AllowedVendors structure
func (*AllowedVendors) Encode ¶
func (a *AllowedVendors) Encode() string
Returns structure as a base64 raw url encoded string
func (*AllowedVendors) IsVendorAllowed ¶
func (a *AllowedVendors) IsVendorAllowed(id int) bool
Returns true if vendor id is allowed for OOB signaling
type Bits ¶
func (*Bits) WriteNumber ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
type RestrictionType int
const ( RestrictionTypeNotAllowed RestrictionType = 0 RestrictionTypeRequireConsent RestrictionType = 1 RestrictionTypeRequireLI RestrictionType = 2 RestrictionTypeUndefined RestrictionType = 3 )
type SegmentType ¶
type SegmentType int
const ( SegmentTypeUndefined SegmentType = -1 SegmentTypeCoreString SegmentType = 0 SegmentTypeDisclosedVendors SegmentType = 1 SegmentTypeAllowedVendors SegmentType = 2 SegmentTypePublisherTC SegmentType = 3 )
func GetSegmentType ¶
func GetSegmentType(segment string) (segmentType SegmentType, err error)
Decodes a segment value and returns the SegmentType - SegmentTypeUndefined = -1 - SegmentTypeCoreString = 0 - SegmentTypeDisclosedVendors = 1 - SegmentTypeAllowedVendors = 2 - SegmentTypePublisherTC = 3
type TCData ¶
type TCData struct {
CoreString *CoreString
DisclosedVendors *DisclosedVendors
AllowedVendors *AllowedVendors
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 - Allowed Vendors - Publisher TC
func (*TCData) GetPubRestrictionsForPurpose ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 TCEncoder ¶
type TCEncoder struct {
*Bits
}
func NewTCEncoder ¶
func NewTCEncoderFromSize ¶
func (*TCEncoder) ReadPubRestrictions ¶
func (r *TCEncoder) ReadPubRestrictions() (int, []*PubRestriction)
func (*TCEncoder) ReadRangeEntries ¶
func (r *TCEncoder) ReadRangeEntries() (int, []*RangeEntry)
func (*TCEncoder) WriteChars ¶
func (*TCEncoder) WritePubRestrictions ¶
func (r *TCEncoder) WritePubRestrictions(entries []*PubRestriction)
func (*TCEncoder) WriteRangeEntries ¶
func (r *TCEncoder) WriteRangeEntries(entries []*RangeEntry)
type TcfVersion ¶
type TcfVersion int
const ( TcfVersionUndefined TcfVersion = -1 TcfVersion1 TcfVersion = 1 TcfVersion2 TcfVersion = 2 )
func GetVersion ¶
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