Documentation ¶
Overview ¶
Package combination generates possible ad pod response based on bid response durations. It ensures that generated combination is satifying ad pod request configurations like Min Pod Duation, Maximum Pod Duration, Minimum number of ads, Maximum number of Ads. It also considers number of bids received for given duration For Example, if for 60 second duration we have 2 bids then then it will ensure combination contains at most 2 repeatations of 60 sec; not more than that
Index ¶
Constants ¶
const ( // MinToMax tells combination generator to generate combinations // starting from Min Ads to Max Ads MinToMax = iota // MaxToMin tells combination generator to generate combinations // starting from Max Ads to Min Ads MaxToMin )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Combination ¶
type Combination struct { ICombination // contains filtered or unexported fields }
Combination ...
func NewCombination ¶
func NewCombination(buckets types.BidsBuckets, podMinDuration, podMaxDuration uint64, config *openrtb_ext.VideoAdPod) *Combination
NewCombination ... Generates on demand valid combinations Valid combinations are those who satisifies
- Pod Min Max duration
- minAds <= size(combination) <= maxads
- If Combination contains repeatition for given duration then repeatitions are <= no of ads received for the duration
Use Get method to start getting valid combinations
func (*Combination) Get ¶
func (c *Combination) Get() []int
Get next valid combination Retuns empty slice if all combinations are generated