schema

package
v1.5.20 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package schema implements schema for version v2.

Index

Constants

View Source
const Version types.Version = "v1"

Version ...

Variables

This section is empty.

Functions

func GetInvalidPDV added in v1.5.15

func GetInvalidPDV(b []byte) ([]int, error)

GetInvalidPDV returns indicies of invalid PDV.

Types

type AdvertiserID

type AdvertiserID struct {
	Advertiser string `json:"advertiser"`
	Name       string `json:"name"`
	Value      string `json:"value"`
}

AdvertiserID is id for advertiser..

func (AdvertiserID) MarshalJSON

func (d AdvertiserID) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (AdvertiserID) Type

func (AdvertiserID) Type() types.Type

Type ...

func (AdvertiserID) Validate

func (d AdvertiserID) Validate() bool

Validate ...

type Cookie struct {
	types.Timestamp

	Source types.Source `json:"source"`

	Name           string `json:"name"`
	Value          string `json:"value"`
	Domain         string `json:"domain"`
	Path           string `json:"path"`
	SameSite       string `json:"sameSite"`
	HostOnly       bool   `json:"hostOnly"`
	Secure         bool   `json:"secure"`
	ExpirationDate uint64 `json:"expirationDate,omitempty"`
}

Cookie is PDVData implementation for Cookies(according to https://developer.chrome.com/extensions/cookies).

func (Cookie) MarshalJSON

func (d Cookie) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (Cookie) Type

func (Cookie) Type() types.Type

Type ...

func (Cookie) Validate

func (d Cookie) Validate() bool

Validate ...

type Location

type Location struct {
	types.Timestamp

	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`

	RequestedBy *types.Source `json:"requestedBy"`
}

Location is user's geolocation.

func (Location) MarshalJSON

func (d Location) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (Location) Type

func (Location) Type() types.Type

Type ...

func (Location) Validate

func (d Location) Validate() bool

Validate ...

type PDV

type PDV []types.Data

PDV is PDVObject implementation with v2 version.

func (PDV) Data

func (o PDV) Data() []types.Data

Data returns slice of data.

func (PDV) MarshalJSON

func (o PDV) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (*PDV) UnmarshalJSON

func (o *PDV) UnmarshalJSON(b []byte) error

UnmarshalJSON ...

func (PDV) Validate

func (o PDV) Validate() bool

Validate ...

func (PDV) Version

func (PDV) Version() types.Version

Version returns version of PDV.

type Profile

type Profile struct {
	FirstName string       `json:"firstName"`
	LastName  string       `json:"lastName"`
	Emails    []string     `json:"emails"`
	Bio       string       `json:"bio"`
	Gender    types.Gender `json:"gender"`
	Avatar    string       `json:"avatar"`
	Birthday  *types.Date  `json:"birthday"`
}

Profile is PDVData implementation for profile's data.

func (Profile) MarshalJSON

func (d Profile) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (Profile) Type

func (Profile) Type() types.Type

Type ...

func (Profile) Validate

func (d Profile) Validate() bool

Validate ...

type SearchHistory

type SearchHistory struct {
	types.Timestamp

	Domain string `json:"domain"`
	Engine string `json:"engine"`
	Query  string `json:"query"`
}

SearchHistory is user's search history.

func (SearchHistory) MarshalJSON

func (d SearchHistory) MarshalJSON() ([]byte, error)

MarshalJSON ...

func (SearchHistory) Type

func (SearchHistory) Type() types.Type

Type ...

func (SearchHistory) Validate

func (d SearchHistory) Validate() bool

Validate ...

Jump to

Keyboard shortcuts

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