exchange

package
v0.180.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 172 Imported by: 12

Documentation

Index

Constants

View Source
const (
	DebugOverrideHeader string = "x-pbs-debug-override"
)
View Source
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 GetValidBidders(aliases map[string]string) map[string]struct{}

func IsDebugOverrideEnabled added in v0.163.0

func IsDebugOverrideEnabled(debugHeader, configOverrideToken string) bool

Types

type AuctionRequest

type AuctionRequest struct {
	BidRequest                 *openrtb2.BidRequest
	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 compatability with cleanOpenRTBRequests
	// in HoldAuction until we get to factoring it away. Do not use for anything new.
	LegacyLabels metrics.Labels
}

AuctionRequest holds the bid request for the auction and all other information needed to process that request

type BidIDGenerator

type BidIDGenerator interface {
	New() (string, error)
	Enabled() bool
}

type BidderRequest

type BidderRequest struct {
	BidRequest     *openrtb2.BidRequest
	BidderName     openrtb_ext.BidderName
	BidderCoreName openrtb_ext.BidderName
	BidderLabels   metrics.AdapterLabels
}

BidderRequest holds the bidder specific request and all other information needed to process that bidder request.

type DebugData

type DebugData struct {
	Request  string
	Headers  string
	Response string
}

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

func (d *DebugLog) PutDebugLogError(cache prebid_cache_client.Client, timeout int, errors []error) error

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, gDPR gdpr.Permissions, 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.

type ImpExtInfo added in v0.172.0

type ImpExtInfo struct {
	EchoVideoAttrs bool
	StoredImp      []byte
}

Jump to

Keyboard shortcuts

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