mirror of
https://github.com/cubixle/iabtcfv2.git
synced 2026-04-30 16:38:42 +01:00
Update README
This commit is contained in:
@@ -14,7 +14,7 @@ The package defines a `TCData` structure with the four segments a TC String can
|
|||||||
|
|
||||||
### Decode a TC String
|
### Decode a TC String
|
||||||
|
|
||||||
To decode a TC String, use the `Decode(tcString string)` function.
|
To decode a TC String, use `Decode(tcString string) (t *TCData, err error)`.
|
||||||
|
|
||||||
NOTE : A valid TC String must start with a *Core String* segment value.
|
NOTE : A valid TC String must start with a *Core String* segment value.
|
||||||
```
|
```
|
||||||
@@ -25,10 +25,10 @@ if err != nil {
|
|||||||
```
|
```
|
||||||
|
|
||||||
To decode a segment value of a TC String, use the appropriate function:
|
To decode a segment value of a TC String, use the appropriate function:
|
||||||
- `DecodeCoreString(coreString string)`
|
- `DecodeCoreString(coreString string) (c *CoreString, err error)`
|
||||||
- `DecodeDisclosedVendors(disclosedVendors string)`
|
- `DecodeDisclosedVendors(disclosedVendors string) (d *DisclosedVendors, err error)`
|
||||||
- `DecodeAllowedVendors(allowedVendors string)`
|
- `DecodeAllowedVendors(allowedVendors string) (a *AllowedVendors, err error)`
|
||||||
- `DecodePublisherTC(publisherTC string)`
|
- `DecodePublisherTC(publisherTC string) (p *PublisherTC, err error)`
|
||||||
```
|
```
|
||||||
var coreString, err = iabtcfv2.DecodeCoreString("COxR03kOxR1CqBcABCENAgCMAP_AAH_AAAqIF3EXySoGY2thI2YVFxBEIYwfJxyigMgChgQIsSwNQIeFLBoGLiAAHBGYJAQAGBAEEACBAQIkHGBMCQAAgAgBiRCMQEGMCzNIBIBAggEbY0FACCVmHkHSmZCY7064O__QLuIJEFQMAkSBAIACLECIQwAQDiAAAYAlAAABAhIaAAgIWBQEeAAAACAwAAgAAABBAAACAAQAAICIAAABAAAgAiAQAAAAGgIQAACBABACRIAAAEANCAAgiCEAQg4EAo4AAA")
|
var coreString, err = iabtcfv2.DecodeCoreString("COxR03kOxR1CqBcABCENAgCMAP_AAH_AAAqIF3EXySoGY2thI2YVFxBEIYwfJxyigMgChgQIsSwNQIeFLBoGLiAAHBGYJAQAGBAEEACBAQIkHGBMCQAAgAgBiRCMQEGMCzNIBIBAggEbY0FACCVmHkHSmZCY7064O__QLuIJEFQMAkSBAIACLECIQwAQDiAAAYAlAAABAhIaAAgIWBQEeAAAACAwAAgAAABBAAACAAQAAICIAAABAAAgAiAQAAAAGgIQAACBABACRIAAAEANCAAgiCEAQg4EAo4AAA")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -88,9 +88,9 @@ func main() {
|
|||||||
|
|
||||||
### Encode a TC String
|
### Encode a TC String
|
||||||
|
|
||||||
To encode a TC String, use the `ToTCString()` function on the `TCData` structure.
|
To encode a TC String, use `ToTCString() string` on the `TCData` structure.
|
||||||
|
|
||||||
To encode a single segment of a TC String, use the `Encode()` function on the appropriate segment.
|
To encode a single segment of a TC String, use `Encode() string` on the appropriate segment.
|
||||||
|
|
||||||
#### Example
|
#### Example
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user