Versions in this module Expand all Collapse all v1 v1.2.2 Jul 21, 2026 v1.2.1 Jul 21, 2026 Changes in this version + type AllowedVendors struct + AllowedVendors map[int]bool + IsRangeEncoding bool + MaxVendorId int + NumEntries int + RangeEntries []*RangeEntry + SegmentType int + func DecodeAllowedVendors(allowedVendors string) (a *AllowedVendors, err error) + func (a *AllowedVendors) Encode() string + func (a *AllowedVendors) IsVendorAllowed(id int) bool + type Bits struct + Bytes []byte + Position uint + func NewBits(bytes []byte) *Bits + func (b *Bits) ReadBool() bool + func (b *Bits) ReadInt(n uint) int + func (b *Bits) WriteBool(v bool) + func (b *Bits) WriteBools(getBool func(int) bool, n int) + func (b *Bits) WriteInt(v int, n uint) + func (b *Bits) WriteNumber(v int64, n uint) + type CoreString struct + CmpId int + CmpVersion int + ConsentLanguage string + ConsentScreen int + Created time.Time + IsRangeEncoding bool + IsRangeEncodingLI bool + IsServiceSpecific bool + LastUpdated time.Time + MaxVendorId int + MaxVendorIdLI int + NumEntries int + NumEntriesLI int + NumPubRestrictions int + PubRestrictions []*PubRestriction + PublisherCC string + PurposeOneTreatment bool + PurposesConsent map[int]bool + PurposesLITransparency map[int]bool + RangeEntries []*RangeEntry + RangeEntriesLI []*RangeEntry + SpecialFeatureOptIns map[int]bool + TcfPolicyVersion int + UseNonStandardTexts bool + VendorListVersion int + VendorsConsent map[int]bool + VendorsLITransparency map[int]bool + Version int + func DecodeCoreString(coreString string) (c *CoreString, err error) + 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 struct + DisclosedVendors map[int]bool + IsRangeEncoding bool + MaxVendorId int + NumEntries int + RangeEntries []*RangeEntry + SegmentType int + func DecodeDisclosedVendors(disclosedVendors string) (d *DisclosedVendors, err error) + func (d *DisclosedVendors) Encode() string + func (d *DisclosedVendors) IsVendorDisclosed(id int) bool + type PubRestriction struct + NumEntries int + PurposeId int + RangeEntries []*RangeEntry + RestrictionType RestrictionType + func (p *PubRestriction) IsVendorIncluded(id int) bool + type PublisherTC struct + CustomPurposesConsent map[int]bool + CustomPurposesLITransparency map[int]bool + NumCustomPurposes int + PubPurposesConsent map[int]bool + PubPurposesLITransparency map[int]bool + SegmentType int + func DecodePublisherTC(publisherTC string) (p *PublisherTC, err error) + func (p *PublisherTC) Encode() string + func (p *PublisherTC) IsCustomPurposeAllowed(id int) bool + func (p *PublisherTC) IsCustomPurposeLIAllowed(id int) bool + func (p *PublisherTC) IsPurposeAllowed(id int) bool + func (p *PublisherTC) IsPurposeLIAllowed(id int) bool + type RangeEntry struct + EndVendorID int + StartVendorID int + type RestrictionType int + const RestrictionTypeNotAllowed + const RestrictionTypeRequireConsent + const RestrictionTypeRequireLI + const RestrictionTypeUndefined + type SegmentType int + const SegmentTypeAllowedVendors + const SegmentTypeCoreString + const SegmentTypeDisclosedVendors + const SegmentTypePublisherTC + const SegmentTypeUndefined + func GetSegmentType(segment string) (segmentType SegmentType, err error) + type TCData struct + AllowedVendors *AllowedVendors + CoreString *CoreString + DisclosedVendors *DisclosedVendors + PublisherTC *PublisherTC + func Decode(tcString string) (t *TCData, err error) + 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 struct + func NewTCEncoder(src []byte) *TCEncoder + func NewTCEncoderFromSize(bitSize int) *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 int + const TcfVersion1 + const TcfVersion2 + const TcfVersionUndefined + func GetVersion(s string) (version TcfVersion, err error)