Documentation ¶
Overview ¶
Package schema provides schemas and validation functions for it.
Index ¶
Constants ¶
View Source
const ( // DataPerPDVLimit is limit how much data we allow per PDV. DataPerPDVLimit = 20 // PDVDataSizeLimit is limit to PDVData's size. PDVDataSizeLimit = 8 * 1024 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PDV ¶
type PDV struct { Version PDVVersion `json:"version"` PDV PDVObject `json:"pdv"` }
PDV is main data object.
type PDVData ¶
type PDVData interface { Validate Version() PDVVersion Type() PDVType }
PDVData is interface for all data types.
type PDVDataCookieV1 ¶
type PDVDataCookieV1 struct { Name string `json:"name"` Value string `json:"value"` Domain string `json:"domain"` Path string `json:"path"` SameSite string `json:"same_site"` HostOnly bool `json:"host_only"` Secure bool `json:"secure"` ExpirationDate uint64 `json:"expiration_date,omitempty"` }
PDVDataCookieV1 is PDVData implementation for Cookies(according to https://developer.chrome.com/extensions/cookies) with version v1.
func (PDVDataCookieV1) MarshalJSON ¶
func (d PDVDataCookieV1) MarshalJSON() ([]byte, error)
MarshalJSON ...
type PDVDataMeta ¶
type PDVDataMeta struct { PDVVersion PDVVersion `json:"version"` PDVType PDVType `json:"type"` }
PDVDataMeta contains common information about data.
type PDVObject ¶
type PDVObject interface { Validate Version() PDVVersion }
PDVObject is interface for all versions objects.
type PDVObjectMetaV1 ¶
type PDVObjectMetaV1 struct { // Website information Host string `json:"domain"` Path string `json:"path"` }
PDVObjectMetaV1 is PDVObjectV1 meta data.
type PDVObjectV1 ¶
type PDVObjectV1 struct { PDVObjectMetaV1 Data []PDVData `json:"data"` }
PDVObjectV1 is PDVObject implementation with v1 version.
func (*PDVObjectV1) UnmarshalJSON ¶
func (o *PDVObjectV1) UnmarshalJSON(b []byte) error
UnmarshalJSON ...
type PDVType ¶
type PDVType string
PDVType represents data type.
const ( // PDVCookieType ... PDVCookieType PDVType = "cookie" )
type PDVVersion ¶
type PDVVersion string
PDVVersion represents version.
const ( // PDVv1 ... PDVv1 PDVVersion = "v1" )
Click to show internal directories.
Click to hide internal directories.