Documentation ¶
Index ¶
- type AllProcessedBidResponses
- type AllProcessedBidResponsesPayload
- type AuctionResponse
- type AuctionResponsePayload
- type BidderRequest
- type BidderRequestPayload
- type ChangeSet
- type ChangeSetBAdv
- type ChangeSetBApp
- type ChangeSetBCat
- type ChangeSetBidderRequest
- type ChangeSetBids
- type ChangeSetCatTax
- type ChangeSetRawBidderResponse
- type Entrypoint
- type EntrypointPayload
- type HookResult
- type ModuleContext
- type ModuleInvocationContext
- type Mutation
- type MutationFunc
- type MutationType
- type ProcessedAuctionRequest
- type ProcessedAuctionRequestPayload
- type RawAuctionRequest
- type RawAuctionRequestPayload
- type RawBidderResponse
- type RawBidderResponsePayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllProcessedBidResponses ¶
type AllProcessedBidResponses interface { HandleAllProcessedBidResponsesHook( context.Context, ModuleInvocationContext, AllProcessedBidResponsesPayload, ) (HookResult[AllProcessedBidResponsesPayload], error) }
AllProcessedBidResponses hooks are invoked over a list of all processed responses received from bidders before a winner is chosen.
At this stage, account config is available, so it can be configured at the account-level execution plan, the account-level module config is passed to hooks.
Rejection has no effect and is completely ignored at this stage.
type AllProcessedBidResponsesPayload ¶
type AllProcessedBidResponsesPayload struct {
Responses map[openrtb_ext.BidderName]*entities.PbsOrtbSeatBid
}
AllProcessedBidResponsesPayload consists of a list of all processed responses received from bidders. Hooks are allowed to modify payload object and discard bids using mutations.
type AuctionResponse ¶
type AuctionResponse interface { HandleAuctionResponseHook( context.Context, ModuleInvocationContext, AuctionResponsePayload, ) (HookResult[AuctionResponsePayload], error) }
AuctionResponse hooks are invoked at the very end of request processing. The hooks are invoked even if the request was rejected at earlier stages.
At this stage, account config is available, so it can be configured at the account-level execution plan, the account-level module config is passed to hooks.
Rejection has no effect and is completely ignored at this stage.
type AuctionResponsePayload ¶
type AuctionResponsePayload struct {
BidResponse *openrtb2.BidResponse
}
AuctionResponsePayload consists of a final openrtb2.BidResponse object that will be sent back to the requester. Hooks are allowed to modify openrtb2.BidResponse object.
type BidderRequest ¶
type BidderRequest interface { HandleBidderRequestHook( context.Context, ModuleInvocationContext, BidderRequestPayload, ) (HookResult[BidderRequestPayload], error) }
BidderRequest hooks are invoked for each bidder participating in auction.
At this stage, account config is available, so it can be configured at the account-level execution plan, the account-level module config is passed to hooks.
Rejection results in skipping the bidder's request.
type BidderRequestPayload ¶
type BidderRequestPayload struct { BidRequest *openrtb2.BidRequest Bidder string }
BidderRequestPayload consists of the openrtb2.BidRequest object distilled for the particular bidder. Hooks are allowed to modify openrtb2.BidRequest using mutations.
type ChangeSet ¶
type ChangeSet[T any] struct { // contains filtered or unexported fields }
func (*ChangeSet[T]) AddMutation ¶
func (c *ChangeSet[T]) AddMutation(fn MutationFunc[T], t MutationType, k ...string) *ChangeSet[T]
func (*ChangeSet[T]) BidderRequest ¶
func (c *ChangeSet[T]) BidderRequest() ChangeSetBidderRequest[T]
func (*ChangeSet[T]) RawBidderResponse ¶
func (c *ChangeSet[T]) RawBidderResponse() ChangeSetRawBidderResponse[T]
type ChangeSetBAdv ¶
type ChangeSetBAdv[T any] struct { // contains filtered or unexported fields }
func (ChangeSetBAdv[T]) Update ¶
func (c ChangeSetBAdv[T]) Update(badv []string)
type ChangeSetBApp ¶
type ChangeSetBApp[T any] struct { // contains filtered or unexported fields }
func (ChangeSetBApp[T]) Update ¶
func (c ChangeSetBApp[T]) Update(bapp []string)
type ChangeSetBCat ¶
type ChangeSetBCat[T any] struct { // contains filtered or unexported fields }
func (ChangeSetBCat[T]) Update ¶
func (c ChangeSetBCat[T]) Update(bcat []string)
type ChangeSetBidderRequest ¶
type ChangeSetBidderRequest[T any] struct { // contains filtered or unexported fields }
func (ChangeSetBidderRequest[T]) BAdv ¶
func (c ChangeSetBidderRequest[T]) BAdv() ChangeSetBAdv[T]
func (ChangeSetBidderRequest[T]) BApp ¶
func (c ChangeSetBidderRequest[T]) BApp() ChangeSetBApp[T]
func (ChangeSetBidderRequest[T]) BCat ¶
func (c ChangeSetBidderRequest[T]) BCat() ChangeSetBCat[T]
func (ChangeSetBidderRequest[T]) CatTax ¶
func (c ChangeSetBidderRequest[T]) CatTax() ChangeSetCatTax[T]
type ChangeSetBids ¶
type ChangeSetBids[T any] struct { // contains filtered or unexported fields }
func (ChangeSetBids[T]) Update ¶
func (c ChangeSetBids[T]) Update(bids []*adapters.TypedBid)
type ChangeSetCatTax ¶
type ChangeSetCatTax[T any] struct { // contains filtered or unexported fields }
func (ChangeSetCatTax[T]) Update ¶
func (c ChangeSetCatTax[T]) Update(cattax adcom1.CategoryTaxonomy)
type ChangeSetRawBidderResponse ¶
type ChangeSetRawBidderResponse[T any] struct { // contains filtered or unexported fields }
func (ChangeSetRawBidderResponse[T]) Bids ¶
func (c ChangeSetRawBidderResponse[T]) Bids() ChangeSetBids[T]
type Entrypoint ¶
type Entrypoint interface { HandleEntrypointHook( context.Context, ModuleInvocationContext, EntrypointPayload, ) (HookResult[EntrypointPayload], error) }
Entrypoint hooks are invoked at the very beginning of request processing.
At this stage, account config is not yet available, so it can only be defined as part of the host-level execution plan, the account-level module config is not available.
Rejection results in sending an empty BidResponse with the NBR code indicating the rejection reason.
type EntrypointPayload ¶
EntrypointPayload consists of an HTTP request and a raw body of the openrtb2.BidRequest. For "/openrtb2/amp" endpoint the body is nil. Hooks are allowed to modify this data using mutations.
type HookResult ¶
type HookResult[T any] struct { Reject bool // true value indicates rejection of the program execution at the specific stage NbrCode int // hook must provide NbrCode if the field Reject set to true Message string // holds arbitrary message added by hook ChangeSet ChangeSet[T] // set of changes the module wants to apply to hook payload in case of successful execution Errors []string Warnings []string DebugMessages []string AnalyticsTags hookanalytics.Analytics ModuleContext ModuleContext // holds values that the module wants to pass to itself at later stages }
HookResult represents the result of execution the concrete hook instance.
type ModuleContext ¶
type ModuleContext map[string]interface{}
ModuleContext holds arbitrary data passed between module hooks at different stages. We use interface as we do not know exactly how the modules will use their inner context.
type ModuleInvocationContext ¶
type ModuleInvocationContext struct { // AccountConfig represents module config rewritten at the account-level. AccountConfig json.RawMessage // Endpoint represents the path of the current endpoint. Endpoint string // ModuleContext holds values that the module passes to itself from the previous stages. ModuleContext ModuleContext }
ModuleInvocationContext holds data passed to the module hook during invocation.
type Mutation ¶
type Mutation[T any] struct { // contains filtered or unexported fields }
func (Mutation[T]) Type ¶
func (m Mutation[T]) Type() MutationType
type MutationFunc ¶
type MutationType ¶
type MutationType int
const ( MutationAdd MutationType = iota MutationUpdate MutationDelete )
func (MutationType) String ¶
func (mt MutationType) String() string
type ProcessedAuctionRequest ¶
type ProcessedAuctionRequest interface { HandleProcessedAuctionHook( context.Context, ModuleInvocationContext, ProcessedAuctionRequestPayload, ) (HookResult[ProcessedAuctionRequestPayload], error) }
ProcessedAuctionRequest hooks are invoked after the request is parsed and enriched with additional data.
At this stage, account config is available, so it can be configured at the account-level execution plan, the account-level module config is passed to hooks.
Rejection results in sending an empty BidResponse with the NBR code indicating the rejection reason.
type ProcessedAuctionRequestPayload ¶
type ProcessedAuctionRequestPayload struct {
RequestWrapper *openrtb_ext.RequestWrapper
}
ProcessedAuctionRequestPayload consists of the openrtb_ext.RequestWrapper object. Hooks are allowed to modify openrtb_ext.RequestWrapper using mutations.
type RawAuctionRequest ¶
type RawAuctionRequest interface { HandleRawAuctionHook( context.Context, ModuleInvocationContext, RawAuctionRequestPayload, ) (HookResult[RawAuctionRequestPayload], error) }
RawAuctionRequest hooks are invoked only for "/openrtb2/auction" endpoint after retrieving the account config, but before the request is parsed and any additions are made.
At this stage, account config is available, so it can be configured at the account-level execution plan, the account-level module config is passed to hooks.
Rejection results in sending an empty BidResponse with the NBR code indicating the rejection reason.
type RawAuctionRequestPayload ¶
type RawAuctionRequestPayload []byte
RawAuctionRequestPayload represents a raw body of the openrtb2.BidRequest. Hooks are allowed to modify body using mutations.
type RawBidderResponse ¶
type RawBidderResponse interface { HandleRawBidderResponseHook( context.Context, ModuleInvocationContext, RawBidderResponsePayload, ) (HookResult[RawBidderResponsePayload], error) }
RawBidderResponse hooks are invoked for each bidder participating in auction.
At this stage, account config is available, so it can be configured at the account-level execution plan, the account-level module config is passed to hooks.
Rejection results in ignoring the bidder's response.
type RawBidderResponsePayload ¶
RawBidderResponsePayload consists of a list of adapters.TypedBid objects representing bids returned by a particular bidder. Hooks are allowed to modify bids using mutations.