gpp

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 10

README

go-gpp

Golang support for the IAB's GPP framework.

Provided the basic Parse and Encode methods for conversions between IAB-supported sections and GPP strings, people other than CMPs are not encouraged to generate GPP strings in production according to the IAB documentation.

For more information, please refer to https://github.com/InteractiveAdvertisingBureau/Global-Privacy-Platform

Documentation

Index

Constants

View Source
const (
	SectionGPPByte  byte = 'D'
	MaxHeaderLength      = 3
)

Variables

This section is empty.

Functions

func Encode added in v0.2.0

func Encode(sections []Section) (string, error)

Types

type GenericSection

type GenericSection struct {
	// contains filtered or unexported fields
}

func (GenericSection) Encode added in v0.2.0

func (gs GenericSection) Encode(bool) []byte

func (GenericSection) GetID

func (gs GenericSection) GetID() constants.SectionID

func (GenericSection) GetValue

func (gs GenericSection) GetValue() string

type GppContainer

type GppContainer struct {
	Version      int
	SectionTypes []constants.SectionID
	Sections     []Section
}

func Parse

func Parse(v string) (GppContainer, []error)

type Section

type Section interface {
	GetID() constants.SectionID
	GetValue() string // base64 encoding usually, but plaintext for ccpa
	Encode(bool) []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL