hookstage

package
v0.234.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllProcessedBidResponses

type AllProcessedBidResponses interface {
	HandleAllProcBidResponsesHook(
		context.Context,
		InvocationContext,
		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 {
}

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,
		InvocationContext,
		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 BidRequest

type BidRequest interface {
	HandleBidRequestHook(
		context.Context,
		InvocationContext,
		BidRequestPayload,
	) (HookResult[BidRequestPayload], error)
}

BidRequest 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 BidRequestPayload

type BidRequestPayload struct {
	BidRequest *openrtb2.BidRequest
}

BidRequestPayload consists of the openrtb2.BidRequest object distilled for the particular bidder. Hooks are allowed to modify openrtb2.BidRequest using mutations.

type Entrypoint

type Entrypoint interface {
	HandleEntrypointHook(
		context.Context,
		InvocationContext,
		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

type EntrypointPayload struct {
	Request *http.Request
	Body    []byte
}

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 indicates that the hook rejects execution of the program logic at the specific stage.
	Reject        bool
	AnalyticsTags hookanalytics.Analytics
}

HookResult represents the result of execution the concrete hook instance.

type InvocationContext

type InvocationContext struct {
}

InvocationContext holds information passed to module's hook during hook execution.

type ProcessedAuction

type ProcessedAuction interface {
	HandleProcessedAuctionHook(
		context.Context,
		InvocationContext,
		ProcessedAuctionPayload,
	) (HookResult[ProcessedAuctionPayload], error)
}

ProcessedAuction 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 ProcessedAuctionPayload

type ProcessedAuctionPayload struct {
	BidRequest *openrtb2.BidRequest
}

ProcessedAuctionPayload consists of the openrtb2.BidRequest object. Hooks are allowed to modify openrtb2.BidRequest using mutations.

type RawAuction

type RawAuction interface {
	HandleRawAuctionHook(
		context.Context,
		InvocationContext,
		RawAuctionPayload,
	) (HookResult[RawAuctionPayload], error)
}

RawAuction 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 RawAuctionPayload

type RawAuctionPayload []byte

RawAuctionPayload represents a raw body of the openrtb2.BidRequest. Hooks are allowed to modify body using mutations.

type RawBidResponse

type RawBidResponse interface {
	HandleRawBidResponseHook(
		context.Context,
		InvocationContext,
		RawBidResponsePayload,
	) (HookResult[RawBidResponsePayload], error)
}

RawBidResponse 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 RawBidResponsePayload

type RawBidResponsePayload struct {
	Bids []*adapters.TypedBid
}

RawBidResponsePayload consists of a list of adapters.TypedBid objects representing bids returned by a particular bidder. Hooks are allowed to modify bids using mutations.

Jump to

Keyboard shortcuts

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