combination

package
v1.200.0 Latest Latest
Warning

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

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

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

View Source
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

  1. Pod Min Max duration
  2. minAds <= size(combination) <= maxads
  3. 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

type ICombination

type ICombination interface {
	Get() []int
}

ICombination ...

Jump to

Keyboard shortcuts

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