Documentation
¶
Index ¶
- Constants
- func BuildAdapters(client *http.Client, cfg *config.Configuration, infos config.BidderInfos, ...) (map[openrtb_ext.BidderName]AdaptedBidder, []error)
- func GetActiveBidders(infos config.BidderInfos) map[string]openrtb_ext.BidderName
- func GetDisabledBiddersErrorMessages(infos config.BidderInfos) map[string]string
- func GetPriceBucket(cpm float64, config openrtb_ext.PriceGranularity) string
- func GetValidBidders(aliases map[string]string) map[string]struct{}
- func IsDebugOverrideEnabled(debugHeader, configOverrideToken string) bool
- type AdaptedBidder
- type AuctionRequest
- type BidIDGenerator
- type BidderRequest
- type DebugData
- type DebugLog
- type Exchange
- type IdFetcher
- type ImpExtInfo
Constants ¶
const (
DebugOverrideHeader string = "x-pbs-debug-override"
)
const ImpIdReqBody = "Stored bid response for impression id: "
const MaxKeyLength = 20
Variables ¶
This section is empty.
Functions ¶
func BuildAdapters ¶
func BuildAdapters(client *http.Client, cfg *config.Configuration, infos config.BidderInfos, me metrics.MetricsEngine) (map[openrtb_ext.BidderName]AdaptedBidder, []error)
func GetActiveBidders ¶
func GetActiveBidders(infos config.BidderInfos) map[string]openrtb_ext.BidderName
GetActiveBidders returns a map of all active bidder names.
func GetDisabledBiddersErrorMessages ¶
func GetDisabledBiddersErrorMessages(infos config.BidderInfos) map[string]string
GetDisabledBiddersErrorMessages returns a map of error messages for disabled bidders.
func GetPriceBucket ¶
func GetPriceBucket(cpm float64, config openrtb_ext.PriceGranularity) string
GetPriceBucket is the externally facing function for computing CPM buckets
func GetValidBidders ¶
func IsDebugOverrideEnabled ¶ added in v0.163.0
Types ¶
type AdaptedBidder ¶ added in v0.210.0
type AdaptedBidder interface {
// contains filtered or unexported methods
}
AdaptedBidder defines the contract needed to participate in an Auction within an Exchange.
This interface exists to help segregate core auction logic.
Any logic which can be done _within a single Seat_ goes inside one of these. Any logic which _requires responses from all Seats_ goes inside the Exchange.
This interface differs from adapters.Bidder to help minimize code duplication across the adapters.Bidder implementations.
func AdaptBidder ¶ added in v0.210.0
func AdaptBidder(bidder adapters.Bidder, client *http.Client, cfg *config.Configuration, me metrics.MetricsEngine, name openrtb_ext.BidderName, debugInfo *config.DebugInfo) AdaptedBidder
AdaptBidder converts an adapters.Bidder into an exchange.AdaptedBidder.
The name refers to the "Adapter" architecture pattern, and should not be confused with a Prebid "Adapter" (which is being phased out and replaced by Bidder for OpenRTB auctions)
type AuctionRequest ¶
type AuctionRequest struct {
BidRequestWrapper *openrtb_ext.RequestWrapper
ResolvedBidRequest json.RawMessage
Account config.Account
UserSyncs IdFetcher
RequestType metrics.RequestType
StartTime time.Time
Warnings []error
GlobalPrivacyControlHeader string
ImpExtInfoMap map[string]ImpExtInfo
// LegacyLabels is included here for temporary compatibility with cleanOpenRTBRequests
// in HoldAuction until we get to factoring it away. Do not use for anything new.
LegacyLabels metrics.Labels
FirstPartyData map[openrtb_ext.BidderName]*firstpartydata.ResolvedFirstPartyData
// map of imp id to stored response
StoredAuctionResponses stored_responses.ImpsWithBidResponses
// map of imp id to bidder to stored response
StoredBidResponses stored_responses.ImpBidderStoredResp
PubID string
}
AuctionRequest holds the bid request for the auction and all other information needed to process that request
type BidIDGenerator ¶
type BidderRequest ¶
type BidderRequest struct {
BidRequest *openrtb2.BidRequest
BidderName openrtb_ext.BidderName
BidderCoreName openrtb_ext.BidderName
BidderLabels metrics.AdapterLabels
BidderStoredResponses map[string]json.RawMessage
}
BidderRequest holds the bidder specific request and all other information needed to process that bidder request.
type DebugLog ¶
type DebugLog struct {
Enabled bool
CacheType prebid_cache_client.PayloadType
Data DebugData
TTL int64
CacheKey string
CacheString string
Regexp *regexp.Regexp
DebugOverride bool
//little optimization, it stores value of debugLog.Enabled || debugLog.DebugOverride
DebugEnabledOrOverridden bool
}
func (*DebugLog) BuildCacheString ¶
func (d *DebugLog) BuildCacheString()
func (*DebugLog) PutDebugLogError ¶
type Exchange ¶
type Exchange interface {
// HoldAuction executes an OpenRTB v2.5 Auction.
HoldAuction(ctx context.Context, r AuctionRequest, debugLog *DebugLog) (*openrtb2.BidResponse, error)
}
Exchange runs Auctions. Implementations must be threadsafe, and will be shared across many goroutines.
func NewExchange ¶
func NewExchange(adapters map[openrtb_ext.BidderName]AdaptedBidder, cache prebid_cache_client.Client, cfg *config.Configuration, syncersByBidder map[string]usersync.Syncer, metricsEngine metrics.MetricsEngine, infos config.BidderInfos, gdprPermsBuilder gdpr.PermissionsBuilder, tcf2CfgBuilder gdpr.TCF2ConfigBuilder, currencyConverter *currency.RateConverter, categoriesFetcher stored_requests.CategoryFetcher) Exchange
type IdFetcher ¶
type IdFetcher interface {
GetUID(key string) (uid string, exists bool, notExpired bool)
HasAnyLiveSyncs() bool
}
IdFetcher can find the user's ID for a specific Bidder.