mirror of
https://github.com/cubixle/iabtcfv2.git
synced 2026-04-24 19:54:41 +01:00
Add comment on functions
This commit is contained in:
@@ -13,6 +13,7 @@ type AllowedVendors struct {
|
|||||||
RangeEntries []*RangeEntry
|
RangeEntries []*RangeEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if vendor id is allowed for OOB signaling
|
||||||
func (a *AllowedVendors) IsVendorAllowed(id int) bool {
|
func (a *AllowedVendors) IsVendorAllowed(id int) bool {
|
||||||
if a.IsRangeEncoding {
|
if a.IsRangeEncoding {
|
||||||
for _, entry := range a.RangeEntries {
|
for _, entry := range a.RangeEntries {
|
||||||
@@ -26,6 +27,7 @@ func (a *AllowedVendors) IsVendorAllowed(id int) bool {
|
|||||||
return a.AllowedVendors[id]
|
return a.AllowedVendors[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns structure as a base64 raw url encoded string
|
||||||
func (a *AllowedVendors) Encode() string {
|
func (a *AllowedVendors) Encode() string {
|
||||||
bitSize := 20
|
bitSize := 20
|
||||||
|
|
||||||
|
|||||||
@@ -48,18 +48,23 @@ type RangeEntry struct {
|
|||||||
EndVendorID int
|
EndVendorID int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if user has given consent to special feature id
|
||||||
func (c *CoreString) IsSpecialFeatureAllowed(id int) bool {
|
func (c *CoreString) IsSpecialFeatureAllowed(id int) bool {
|
||||||
return c.SpecialFeatureOptIns[id]
|
return c.SpecialFeatureOptIns[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if user has given consent to purpose id
|
||||||
func (c *CoreString) IsPurposeAllowed(id int) bool {
|
func (c *CoreString) IsPurposeAllowed(id int) bool {
|
||||||
return c.PurposesConsent[id]
|
return c.PurposesConsent[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if legitimate interest is established for purpose id
|
||||||
|
// and user didn't exercise their right to object
|
||||||
func (c *CoreString) IsPurposeLIAllowed(id int) bool {
|
func (c *CoreString) IsPurposeLIAllowed(id int) bool {
|
||||||
return c.PurposesLITransparency[id]
|
return c.PurposesLITransparency[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if user has given consent to vendor id processing their personal data
|
||||||
func (c *CoreString) IsVendorAllowed(id int) bool {
|
func (c *CoreString) IsVendorAllowed(id int) bool {
|
||||||
if c.IsRangeEncoding {
|
if c.IsRangeEncoding {
|
||||||
for _, entry := range c.RangeEntries {
|
for _, entry := range c.RangeEntries {
|
||||||
@@ -73,6 +78,8 @@ func (c *CoreString) IsVendorAllowed(id int) bool {
|
|||||||
return c.VendorsConsent[id]
|
return c.VendorsConsent[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if transparency for vendor id's legitimate interest is established
|
||||||
|
// and user didn't exercise their right to object
|
||||||
func (c *CoreString) IsVendorLIAllowed(id int) bool {
|
func (c *CoreString) IsVendorLIAllowed(id int) bool {
|
||||||
if c.IsRangeEncodingLI {
|
if c.IsRangeEncodingLI {
|
||||||
for _, entry := range c.RangeEntriesLI {
|
for _, entry := range c.RangeEntriesLI {
|
||||||
@@ -86,6 +93,7 @@ func (c *CoreString) IsVendorLIAllowed(id int) bool {
|
|||||||
return c.VendorsLITransparency[id]
|
return c.VendorsLITransparency[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns structure as a base64 raw url encoded string
|
||||||
func (c *CoreString) Encode() string {
|
func (c *CoreString) Encode() string {
|
||||||
bitSize := 230
|
bitSize := 230
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ type DisclosedVendors struct {
|
|||||||
RangeEntries []*RangeEntry
|
RangeEntries []*RangeEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if vendor id is disclosed for validating OOB signaling
|
||||||
func (d *DisclosedVendors) IsVendorDisclosed(id int) bool {
|
func (d *DisclosedVendors) IsVendorDisclosed(id int) bool {
|
||||||
if d.IsRangeEncoding {
|
if d.IsRangeEncoding {
|
||||||
for _, entry := range d.RangeEntries {
|
for _, entry := range d.RangeEntries {
|
||||||
@@ -26,6 +27,7 @@ func (d *DisclosedVendors) IsVendorDisclosed(id int) bool {
|
|||||||
return d.DisclosedVendors[id]
|
return d.DisclosedVendors[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns structure as a base64 raw url encoded string
|
||||||
func (d *DisclosedVendors) Encode() string {
|
func (d *DisclosedVendors) Encode() string {
|
||||||
bitSize := 20
|
bitSize := 20
|
||||||
|
|
||||||
|
|||||||
@@ -11,22 +11,29 @@ type PublisherTC struct {
|
|||||||
CustomPurposesLITransparency map[int]bool
|
CustomPurposesLITransparency map[int]bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if user has given consent to standard purpose id
|
||||||
func (p *PublisherTC) IsPurposeAllowed(id int) bool {
|
func (p *PublisherTC) IsPurposeAllowed(id int) bool {
|
||||||
return p.PubPurposesConsent[id]
|
return p.PubPurposesConsent[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if legitimate interest is established for standard purpose id
|
||||||
|
// and user didn't exercise their right to object
|
||||||
func (p *PublisherTC) IsPurposeLIAllowed(id int) bool {
|
func (p *PublisherTC) IsPurposeLIAllowed(id int) bool {
|
||||||
return p.PubPurposesLITransparency[id]
|
return p.PubPurposesLITransparency[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if user has given consent to custom purpose id
|
||||||
func (p *PublisherTC) IsCustomPurposeAllowed(id int) bool {
|
func (p *PublisherTC) IsCustomPurposeAllowed(id int) bool {
|
||||||
return p.CustomPurposesConsent[id]
|
return p.CustomPurposesConsent[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if legitimate interest is established for custom purpose id
|
||||||
|
// and user didn't exercise their right to object
|
||||||
func (p *PublisherTC) IsCustomPurposeLIAllowed(id int) bool {
|
func (p *PublisherTC) IsCustomPurposeLIAllowed(id int) bool {
|
||||||
return p.CustomPurposesLITransparency[id]
|
return p.CustomPurposesLITransparency[id]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns structure as a base64 raw url encoded string
|
||||||
func (p *PublisherTC) Encode() string {
|
func (p *PublisherTC) Encode() string {
|
||||||
bitSize := 57 + (p.NumCustomPurposes * 2)
|
bitSize := 57 + (p.NumCustomPurposes * 2)
|
||||||
|
|
||||||
|
|||||||
@@ -16,22 +16,29 @@ type TCData struct {
|
|||||||
PublisherTC *PublisherTC
|
PublisherTC *PublisherTC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if user has given consent to purpose id
|
||||||
func (t *TCData) IsPurposeAllowed(id int) bool {
|
func (t *TCData) IsPurposeAllowed(id int) bool {
|
||||||
return t.CoreString.IsPurposeAllowed(id)
|
return t.CoreString.IsPurposeAllowed(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if legitimate interest is established for purpose id
|
||||||
|
// and user didn't exercise their right to object
|
||||||
func (t *TCData) IsPurposeLIAllowed(id int) bool {
|
func (t *TCData) IsPurposeLIAllowed(id int) bool {
|
||||||
return t.CoreString.IsPurposeLIAllowed(id)
|
return t.CoreString.IsPurposeLIAllowed(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if user has given consent to vendor id processing their personal data
|
||||||
func (t *TCData) IsVendorAllowed(id int) bool {
|
func (t *TCData) IsVendorAllowed(id int) bool {
|
||||||
return t.CoreString.IsVendorAllowed(id)
|
return t.CoreString.IsVendorAllowed(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns true if transparency for vendor id's legitimate interest is established
|
||||||
|
// and user didn't exercise their right to object
|
||||||
func (t *TCData) IsVendorLIAllowed(id int) bool {
|
func (t *TCData) IsVendorLIAllowed(id int) bool {
|
||||||
return t.CoreString.IsVendorLIAllowed(id)
|
return t.CoreString.IsVendorLIAllowed(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Returns structure as a base64 raw url encoded string
|
||||||
func (t *TCData) ToTCString() string {
|
func (t *TCData) ToTCString() string {
|
||||||
var segments []string
|
var segments []string
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user