bidresponse

package
v0.0.0-...-528926c Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReturnResponse

func ReturnResponse(o *Response)

ReturnResponse back to pool

Types

type Response

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

Response from different sources

func BorrowResponse

func BorrowResponse(request *adtype.BidRequest, source adtype.Source, items []adtype.ResponserItemCommon, err error) *Response

BorrowResponse object

func NewResponse

func NewResponse(request *adtype.BidRequest, source adtype.Source, items []adtype.ResponserItemCommon, err error) *Response

NewResponse common object

func (*Response) AddItem

func (r *Response) AddItem(it adtype.ResponserItemCommon)

AddItem to response

func (*Response) Ads

func (r *Response) Ads() []adtype.ResponserItemCommon

Ads list

func (*Response) AuctionID

func (r *Response) AuctionID() string

AuctionID response

func (*Response) AuctionType

func (r *Response) AuctionType() types.AuctionType

AuctionType of request

func (*Response) Context

func (r *Response) Context(ctx ...context.Context) context.Context

Context value

func (*Response) Count

func (r *Response) Count() int

Count of response items

func (*Response) Error

func (r *Response) Error() error

Error of the response

func (*Response) Get

func (r *Response) Get(key string) any

Get context item by key

func (*Response) Item

func (r *Response) Item(impid string) adtype.ResponserItemCommon

Item by impression code

func (*Response) IterAds

func (r *Response) IterAds() iter.Seq[adtype.ResponserItem]

IterAds returns an iterator over the response items.

func (*Response) Release

func (r *Response) Release()

Release response and all linked objects

func (*Response) Request

func (r *Response) Request() *adtype.BidRequest

Request information

func (*Response) Source

func (r *Response) Source() adtype.Source

Source of response

func (*Response) Validate

func (r *Response) Validate() (err error)

Validate response

type ResponseEmpty

type ResponseEmpty struct {
	ItemID string
	Req    *adtype.BidRequest
	Src    adtype.Source
	Imp    *adtype.Impression
	Bid    *openrtb.Bid
	Err    error
	// contains filtered or unexported fields
}

ResponseEmpty object represents empty response and response item

func NewEmptyResponse

func NewEmptyResponse(request *adtype.BidRequest, src adtype.Source, err error) *ResponseEmpty

NewEmptyResponse by bid request

func (ResponseEmpty) Ads

Ads list

func (ResponseEmpty) AuctionID

func (r ResponseEmpty) AuctionID() string

AuctionID returns ID of the current auction

func (ResponseEmpty) AuctionType

func (r ResponseEmpty) AuctionType() types.AuctionType

AuctionType returns type of the auction (first price, second price, etc)

func (*ResponseEmpty) Context

func (r *ResponseEmpty) Context(ctx ...context.Context) context.Context

Context value

func (ResponseEmpty) Count

func (r ResponseEmpty) Count() int

Count of response items

func (ResponseEmpty) Error

func (r ResponseEmpty) Error() error

Error of the response

func (ResponseEmpty) ExtImpressionID

func (r ResponseEmpty) ExtImpressionID() string

ExtImpressionID it's unique code of the auction bid impression

func (ResponseEmpty) ExtTargetID

func (r ResponseEmpty) ExtTargetID() string

ExtTargetID of the external network

func (*ResponseEmpty) Get

func (r *ResponseEmpty) Get(key string) (res any)

Get ext field

func (ResponseEmpty) ID

func (r ResponseEmpty) ID() string

ID of current response item (unique code of current response)

func (ResponseEmpty) Impression

func (r ResponseEmpty) Impression() *adtype.Impression

Impression place object

func (ResponseEmpty) ImpressionID

func (r ResponseEmpty) ImpressionID() string

ImpressionID unique code string

func (ResponseEmpty) InternalAuctionCPMBid

func (r ResponseEmpty) InternalAuctionCPMBid() billing.Money

InternalAuctionCPMBid value provides maximal possible price without any comission According to this value the system can choice the best item for the auction

func (ResponseEmpty) Item

Item by impression code

func (ResponseEmpty) IterAds

func (r ResponseEmpty) IterAds() iter.Seq[adtype.ResponserItem]

IterAds returns an iterator over the response items.

func (ResponseEmpty) PriorityFormatType

func (r ResponseEmpty) PriorityFormatType() types.FormatType

PriorityFormatType from current Ad

func (*ResponseEmpty) Release

func (r *ResponseEmpty) Release()

Release response and all linked objects

func (ResponseEmpty) Request

func (r ResponseEmpty) Request() *adtype.BidRequest

Request returns the original request object

func (ResponseEmpty) Source

func (r ResponseEmpty) Source() adtype.Source

Source returns source of the response

func (ResponseEmpty) Validate

func (r ResponseEmpty) Validate() error

Validate response

type ResponseItemBlank

type ResponseItemBlank struct {
	ItemID string
	Imp    *adtype.Impression
	Src    adtype.Source

	FormatVal *types.Format

	PricingModelVal types.PricingModel
	PriceScope      price.PriceScope
}

ResponseItemBlank value

func (*ResponseItemBlank) AccountID

func (*ResponseItemBlank) AccountID() uint64

AccountID number

func (*ResponseItemBlank) ActionURL

func (*ResponseItemBlank) ActionURL() string

ActionURL returns target resource link for direct and banner click as well

func (*ResponseItemBlank) AdID

func (*ResponseItemBlank) AdID() uint64

AdID number

func (*ResponseItemBlank) Asset

func (*ResponseItemBlank) Asset(name string) *admodels.AdAsset

Asset by name

func (*ResponseItemBlank) Assets

Assets list

func (*ResponseItemBlank) BidImpressionPrice

func (it *ResponseItemBlank) BidImpressionPrice() billing.Money

BidImpressionPrice returns bid price for the external auction source. The current bid price will be adjusted according to the source correction factor and the commission share factor

func (*ResponseItemBlank) CampaignID

func (*ResponseItemBlank) CampaignID() uint64

CampaignID number

func (*ResponseItemBlank) ClickTrackerLinks() []string

ClickTrackerLinks returns traking links for click action

func (*ResponseItemBlank) CommissionShareFactor

func (it *ResponseItemBlank) CommissionShareFactor() float64

CommissionShareFactor returns the commission share percentage which system gets from publisher.

func (*ResponseItemBlank) ContentFields

func (*ResponseItemBlank) ContentFields() map[string]any

ContentFields from advertisement object

func (*ResponseItemBlank) ContentItem

func (*ResponseItemBlank) ContentItem(name string) any

ContentItem returns the ad response data

func (*ResponseItemBlank) ContentItemString

func (*ResponseItemBlank) ContentItemString(name string) string

ContentItemString from the ad

func (*ResponseItemBlank) Context

func (*ResponseItemBlank) Context(ctx ...context.Context) context.Context

Context value

func (*ResponseItemBlank) ECPM

func (it *ResponseItemBlank) ECPM() billing.Money

ECPM returns the effective cost per mille of the item.

func (*ResponseItemBlank) ExtImpressionID

func (it *ResponseItemBlank) ExtImpressionID() string

ExtImpressionID it's unique code of the auction bid impression

func (*ResponseItemBlank) ExtTargetID

func (it *ResponseItemBlank) ExtTargetID() string

ExtTargetID of the external network

func (*ResponseItemBlank) FinalPrice

func (it *ResponseItemBlank) FinalPrice(action adtype.Action) billing.Money

FinalPrice returns final price for the item which is including all possible commissions with all corrections

func (*ResponseItemBlank) FixedPurchasePrice

func (it *ResponseItemBlank) FixedPurchasePrice(action adtype.Action) billing.Money

FixedPurchasePrice returns the fixed price of the action

func (*ResponseItemBlank) Format

func (it *ResponseItemBlank) Format() *types.Format

Format object

func (*ResponseItemBlank) Get

func (*ResponseItemBlank) Get(key string) any

Get ext field

func (*ResponseItemBlank) Height

func (*ResponseItemBlank) Height() int

Height of item

func (*ResponseItemBlank) ID

func (it *ResponseItemBlank) ID() string

ID of current response item (unique code of current response)

func (*ResponseItemBlank) Impression

func (it *ResponseItemBlank) Impression() *adtype.Impression

Impression place object

func (*ResponseItemBlank) ImpressionID

func (it *ResponseItemBlank) ImpressionID() string

ImpressionID unique code string

func (*ResponseItemBlank) ImpressionTrackerLinks() []string

ImpressionTrackerLinks returns traking links for impression action

func (*ResponseItemBlank) InternalAuctionCPMBid

func (it *ResponseItemBlank) InternalAuctionCPMBid() billing.Money

InternalAuctionCPMBid value provides maximal possible price without any comission According to this value the system can choice the best item for the auction

func (*ResponseItemBlank) IsBackup

func (*ResponseItemBlank) IsBackup() bool

IsBackup indicates whether the advertisement is a backup ad type.

func (*ResponseItemBlank) IsDirect

func (*ResponseItemBlank) IsDirect() bool

IsDirect AD type

func (*ResponseItemBlank) MainAsset

func (*ResponseItemBlank) MainAsset() *admodels.AdAsset

MainAsset from response

func (*ResponseItemBlank) NetworkName

func (*ResponseItemBlank) NetworkName() string

NetworkName by source

func (*ResponseItemBlank) PotentialPrice

func (it *ResponseItemBlank) PotentialPrice(action adtype.Action) billing.Money

PotentialPrice wich can be received from source but was marked as descrepancy

func (*ResponseItemBlank) PrepareBidImpressionPrice

func (it *ResponseItemBlank) PrepareBidImpressionPrice(price billing.Money) billing.Money

PrepareBidImpressionPrice prepares the price for the action The price is adjusted according to the source correction factor and the commission share factor

func (*ResponseItemBlank) Price

func (it *ResponseItemBlank) Price(action adtype.Action) billing.Money

Price per specific action type (view, click, lead, etc)

func (*ResponseItemBlank) PriceTestMode

func (it *ResponseItemBlank) PriceTestMode() bool

PriceTestMode returns true if the price is in test mode

func (*ResponseItemBlank) PricingModel

func (it *ResponseItemBlank) PricingModel() types.PricingModel

PricingModel of advertisement

func (*ResponseItemBlank) PriorityFormatType

func (it *ResponseItemBlank) PriorityFormatType() types.FormatType

PriorityFormatType from current Ad

func (*ResponseItemBlank) PurchasePrice

func (it *ResponseItemBlank) PurchasePrice(action adtype.Action) billing.Money

PurchasePrice gives the price of view from external resource. The cost of this request.

func (*ResponseItemBlank) Second

func (*ResponseItemBlank) Second() *adtype.SecondAd

Second campaigns

func (*ResponseItemBlank) SetBidImpressionPrice

func (it *ResponseItemBlank) SetBidImpressionPrice(bid billing.Money) error

SetBidImpressionPrice value for external sources auction the system will pay

func (*ResponseItemBlank) Source

func (it *ResponseItemBlank) Source() adtype.Source

Source of response

func (*ResponseItemBlank) SourceCorrectionFactor

func (it *ResponseItemBlank) SourceCorrectionFactor() float64

SourceCorrectionFactor value for the source

func (*ResponseItemBlank) TargetCorrectionFactor

func (it *ResponseItemBlank) TargetCorrectionFactor() float64

TargetCorrectionFactor value for the target

func (*ResponseItemBlank) Validate

func (*ResponseItemBlank) Validate() error

Validate item

func (*ResponseItemBlank) ViewTrackerLinks() []string

ViewTrackerLinks returns traking links for view action

func (*ResponseItemBlank) Width

func (*ResponseItemBlank) Width() int

Width of item

type ResponseItemBlock

type ResponseItemBlock struct {
	Items []adtype.ResponserItem
	// contains filtered or unexported fields
}

ResponseItemBlock group of simple items

func (*ResponseItemBlock) Ads

Ads list

func (*ResponseItemBlock) Context

func (i *ResponseItemBlock) Context(ctx ...context.Context) context.Context

Context value

func (*ResponseItemBlock) Count

func (i *ResponseItemBlock) Count() int

Count of response items

func (*ResponseItemBlock) ExtImpressionID

func (i *ResponseItemBlock) ExtImpressionID() string

ExtImpressionID it's unique code of the auction bid impression

func (*ResponseItemBlock) ExtTargetID

func (i *ResponseItemBlock) ExtTargetID() string

ExtTargetID of the external network

func (*ResponseItemBlock) Get

func (i *ResponseItemBlock) Get(key string) any

Get ext field

func (*ResponseItemBlock) ID

func (i *ResponseItemBlock) ID() string

ID of current response item (unique code of current response)

func (*ResponseItemBlock) Impression

func (i *ResponseItemBlock) Impression() *adtype.Impression

Impression place object

func (*ResponseItemBlock) ImpressionID

func (i *ResponseItemBlock) ImpressionID() string

ImpressionID code

func (*ResponseItemBlock) InternalAuctionCPMBid

func (i *ResponseItemBlock) InternalAuctionCPMBid() (bid billing.Money)

InternalAuctionCPMBid value provides maximal possible price without any comission According to this value the system can choice the best item for the auction

func (*ResponseItemBlock) Price

func (i *ResponseItemBlock) Price(action adtype.Action) (price billing.Money)

Price of whole response

func (*ResponseItemBlock) PriorityFormatType

func (i *ResponseItemBlock) PriorityFormatType() types.FormatType

PriorityFormatType from current Ad

func (*ResponseItemBlock) Validate

func (i *ResponseItemBlock) Validate() (err error)

Validate response

Jump to

Keyboard shortcuts

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