request

package
v0.0.0-...-9c64db6 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1.1"

Version of the request string

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	ID       int   `json:"id"`
	Img      Img   `json:"img"`
	Title    Title `json:"title"`
	Data     Data  `json:"data"`
	Required int   `json:"required"` // should default to 1
}

Asset requesting Native assests

func (*Asset) IsNil

func (a *Asset) IsNil() bool

IsNil checks if instance is nil

func (*Asset) MarshalJSONObject

func (a *Asset) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

type Assets

type Assets []Asset

Assets ...

func (Assets) IsNil

func (s Assets) IsNil() bool

IsNil ...

func (Assets) MarshalJSONArray

func (s Assets) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray ...

type Data

type Data struct {
	Type int `json:"type"` // should be 2 for most cases
	Len  int `json:"len"`
}

Data .Type 1 sponsored Sponsored By message whereresponse should contain the brandname of the sponsor.text Required. Max 25or longer. 2 desc Descriptive text associated with theproduct or service being advertised.Longer length of text in responsemay be truncated or ellipsed by theexchange. text Recommended. Max 140 or longer. 3 rating Rating of the product being offeredto the user. For example an app’srating in an app store from 0-5.numberformatted asstringOptional. 0-5integer formattedas string. 4 likes Number of social ratings or “likes” ofthe product being offered to theuser.numberformatted asstring 5 downloads Number downloads/installs of thisproductnumberformatted asstring Data returns contextual data about the Native asset

func (*Data) IsNil

func (d *Data) IsNil() bool

IsNil checks if instance is nil

func (*Data) MarshalJSONObject

func (d *Data) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

type Img

type Img struct {
	Hmin  int      `json:"hmin"`
	Type  int      `json:"type"` // should be 3 for most cases
	Wmin  int      `json:"wmin"`
	Mimes []string `json:"mimes"`
}

Img .Type 1 Icon Icon image Optional.max height: at least 50aspect ratio: 1:1 2 Logo Logo image for thebrand/app.To be deprecated in future version- use type 1 Icon. 3 Main Large image preview for theadAt least one of 2 size variantsrequired:Small Variant:max height: at least 200max width: at least 200,267, or 382aspect ratio: 1:1, 4:3, or1.91:1Large Variant:max height: at least 627max width: at least 627,836, or 1198aspect ratio: 1:1, 4:3, or1.91:1 500+ XXX Reserved for Exchangespecific usage numberedabove 500 No recommendations Img requesting types

func (*Img) IsNil

func (i *Img) IsNil() bool

IsNil checks if instance is nil

func (*Img) MarshalJSONObject

func (i *Img) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

type Request

type Request struct {
	Assets    []Asset `json:"assets"`
	Plcmttype int     `json:"plcmttype"`
	Plcmtcnt  int     `json:"plcmtcnt"`
	Required  int     `json:"required"` // should default to 1
	Ver       string  `json:"ver"`
}

Request is the structure for the 1.1 json string request in the RTB spec

func (*Request) IsNil

func (r *Request) IsNil() bool

IsNil checks if instance is nil

func (*Request) MarshalJSONObject

func (r *Request) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

type Strings

type Strings []string

Strings ...

func (Strings) IsNil

func (a Strings) IsNil() bool

IsNil checks if array is nil

func (Strings) MarshalJSONArray

func (a Strings) MarshalJSONArray(enc *gojay.Encoder)

MarshalJSONArray encodes arrays into JSON

type Title

type Title struct {
	Len int `json:"len"`
}

Title being represent ensure Title metadata on the image

func (*Title) IsNil

func (t *Title) IsNil() bool

IsNil checks if instance is nil

func (*Title) MarshalJSONObject

func (t *Title) MarshalJSONObject(enc *gojay.Encoder)

MarshalJSONObject implements MarshalerJSONObject

Jump to

Keyboard shortcuts

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