adapters

package
v0.0.0-...-1e4272c Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_IMPRESSIONS_PUBMATIC = 30

Variables

View Source
var DefaultHTTPAdapterConfig = &HTTPAdapterConfig{
	MaxConns:        50,
	MaxConnsPerHost: 10,
	IdleConnTimeout: 60 * time.Second,
}

DefaultHTTPAdapterConfig is an HTTPAdapterConfig that chooses sensible default values.

Functions

func PrepareLogMessage

func PrepareLogMessage(tID, pubId, adUnitId, bidID, details string, args ...interface{}) string

Types

type Adapter

type Adapter interface {
	// Name uniquely identifies this adapter. This must be identical to the code in Prebid.js,
	// but cannot overlap with any other adapters in prebid-server.
	Name() string
	// FamilyName identifies the space of cookies which this adapter accesses. For example, an adapter
	// using the adnxs.com cookie space should return "adnxs".
	FamilyName() string
	// Determines whether this adapter should get callouts if there is not a synched user ID
	SkipNoCookies() bool
	// GetUsersyncInfo returns the parameters which are needed to do sync users with this bidder.
	// For more information, see http://clearcode.cc/2015/12/cookie-syncing/
	GetUsersyncInfo() *pbs.UsersyncInfo
	// Call produces bids which should be considered, given the auction params.
	//
	// In practice, implementations almost always make one call to an external server here.
	// However, that is not a requirement for satisfying this interface.
	Call(ctx context.Context, req *pbs.PBSRequest, bidder *pbs.PBSBidder) (pbs.PBSBidSlice, error)
}

Adapters connect prebid-server to a demand partner. Their primary purpose is to produce bids in response to Auction requests.

type AppNexusAdapter

type AppNexusAdapter struct {
	URI string
	// contains filtered or unexported fields
}

func NewAppNexusAdapter

func NewAppNexusAdapter(config *HTTPAdapterConfig, externalURL string) *AppNexusAdapter

func (*AppNexusAdapter) Call

func (a *AppNexusAdapter) Call(ctx context.Context, req *pbs.PBSRequest, bidder *pbs.PBSBidder) (pbs.PBSBidSlice, error)

func (*AppNexusAdapter) FamilyName

func (a *AppNexusAdapter) FamilyName() string

used for cookies and such

func (*AppNexusAdapter) GetUsersyncInfo

func (a *AppNexusAdapter) GetUsersyncInfo() *pbs.UsersyncInfo

func (*AppNexusAdapter) Name

func (a *AppNexusAdapter) Name() string

Name - export adapter name

func (*AppNexusAdapter) SkipNoCookies

func (a *AppNexusAdapter) SkipNoCookies() bool

type FacebookAdapter

type FacebookAdapter struct {
	URI string
	// contains filtered or unexported fields
}

func NewFacebookAdapter

func NewFacebookAdapter(config *HTTPAdapterConfig, partnerID string, usersyncURL string) *FacebookAdapter

func (*FacebookAdapter) Call

func (a *FacebookAdapter) Call(ctx context.Context, req *pbs.PBSRequest, bidder *pbs.PBSBidder) (pbs.PBSBidSlice, error)

func (*FacebookAdapter) FamilyName

func (a *FacebookAdapter) FamilyName() string

used for cookies and such

func (*FacebookAdapter) GenerateRequestsForFacebook

func (a *FacebookAdapter) GenerateRequestsForFacebook(req *pbs.PBSRequest, bidder *pbs.PBSBidder) ([]*openrtb.BidRequest, error)

func (*FacebookAdapter) GetUsersyncInfo

func (a *FacebookAdapter) GetUsersyncInfo() *pbs.UsersyncInfo

func (*FacebookAdapter) MakeOpenRtbBidRequest

func (a *FacebookAdapter) MakeOpenRtbBidRequest(req *pbs.PBSRequest, bidder *pbs.PBSBidder, placementId string, mtype pbs.MediaType, pubId string, unitInd int) (openrtb.BidRequest, error)

func (*FacebookAdapter) Name

func (a *FacebookAdapter) Name() string

Name - export adapter name

func (*FacebookAdapter) SkipNoCookies

func (a *FacebookAdapter) SkipNoCookies() bool

func (*FacebookAdapter) SplitAdUnits

func (a *FacebookAdapter) SplitAdUnits() bool

Facebook likes to parallelize to minimize latency

type HTTPAdapter

type HTTPAdapter struct {
	Transport *http.Transport
	Client    *http.Client
}

func NewHTTPAdapter

func NewHTTPAdapter(c *HTTPAdapterConfig) *HTTPAdapter

NewHTTPAdapter creates an HTTPAdapter which obeys the rules given by the config, and has all the available SSL certs available in the project.

type HTTPAdapterConfig

type HTTPAdapterConfig struct {
	// See IdleConnTimeout on https://golang.org/pkg/net/http/#Transport
	IdleConnTimeout time.Duration
	// See MaxIdleConns on https://golang.org/pkg/net/http/#Transport
	MaxConns int
	// See MaxIdleConnsPerHost on https://golang.org/pkg/net/http/#Transport
	MaxConnsPerHost int
}

HTTPAdapterConfig groups options which control how HTTP requests are made by adapters.

type IndexAdapter

type IndexAdapter struct {
	URI string
	// contains filtered or unexported fields
}

func NewIndexAdapter

func NewIndexAdapter(config *HTTPAdapterConfig, uri string, userSyncURL string) *IndexAdapter

func (*IndexAdapter) Call

func (a *IndexAdapter) Call(ctx context.Context, req *pbs.PBSRequest, bidder *pbs.PBSBidder) (pbs.PBSBidSlice, error)

func (*IndexAdapter) FamilyName

func (a *IndexAdapter) FamilyName() string

used for cookies and such

func (*IndexAdapter) GetUsersyncInfo

func (a *IndexAdapter) GetUsersyncInfo() *pbs.UsersyncInfo

func (*IndexAdapter) Name

func (a *IndexAdapter) Name() string

Name - export adapter name

func (*IndexAdapter) SkipNoCookies

func (a *IndexAdapter) SkipNoCookies() bool

type KeyVal

type KeyVal struct {
	Key    string   `json:"key,omitempty"`
	Values []string `json:"value,omitempty"`
}

type LifestreetAdapter

type LifestreetAdapter struct {
	URI string
	// contains filtered or unexported fields
}

func NewLifestreetAdapter

func NewLifestreetAdapter(config *HTTPAdapterConfig, externalURL string) *LifestreetAdapter

func (*LifestreetAdapter) Call

func (*LifestreetAdapter) FamilyName

func (a *LifestreetAdapter) FamilyName() string

used for cookies and such

func (*LifestreetAdapter) GetUsersyncInfo

func (a *LifestreetAdapter) GetUsersyncInfo() *pbs.UsersyncInfo

func (*LifestreetAdapter) MakeOpenRtbBidRequest

func (a *LifestreetAdapter) MakeOpenRtbBidRequest(req *pbs.PBSRequest, bidder *pbs.PBSBidder, slotTag string, mtype pbs.MediaType, unitInd int) (openrtb.BidRequest, error)

func (*LifestreetAdapter) Name

func (a *LifestreetAdapter) Name() string

Name - export adapter name

func (*LifestreetAdapter) SkipNoCookies

func (a *LifestreetAdapter) SkipNoCookies() bool

type PubmaticAdapter

type PubmaticAdapter struct {
	URI string
	// contains filtered or unexported fields
}

func NewPubmaticAdapter

func NewPubmaticAdapter(config *HTTPAdapterConfig, uri string, externalURL string) *PubmaticAdapter

func (*PubmaticAdapter) Call

func (a *PubmaticAdapter) Call(ctx context.Context, req *pbs.PBSRequest, bidder *pbs.PBSBidder) (pbs.PBSBidSlice, error)

func (*PubmaticAdapter) FamilyName

func (a *PubmaticAdapter) FamilyName() string

used for cookies and such

func (*PubmaticAdapter) GetUsersyncInfo

func (a *PubmaticAdapter) GetUsersyncInfo() *pbs.UsersyncInfo

func (*PubmaticAdapter) Name

func (a *PubmaticAdapter) Name() string

Name - export adapter name

func (*PubmaticAdapter) SkipNoCookies

func (a *PubmaticAdapter) SkipNoCookies() bool

type PulsePointAdapter

type PulsePointAdapter struct {
	URI string
	// contains filtered or unexported fields
}

func NewPulsePointAdapter

func NewPulsePointAdapter(config *HTTPAdapterConfig, uri string, externalURL string) *PulsePointAdapter

func (*PulsePointAdapter) Call

func (*PulsePointAdapter) FamilyName

func (a *PulsePointAdapter) FamilyName() string

used for cookies and such

func (*PulsePointAdapter) GetUsersyncInfo

func (a *PulsePointAdapter) GetUsersyncInfo() *pbs.UsersyncInfo

func (*PulsePointAdapter) Name

func (a *PulsePointAdapter) Name() string

adapter name

func (*PulsePointAdapter) SkipNoCookies

func (a *PulsePointAdapter) SkipNoCookies() bool

type PulsepointParams

type PulsepointParams struct {
	PublisherId int    `json:"cp"`
	TagId       int    `json:"ct"`
	AdSize      string `json:"cf"`
}

parameters for pulsepoint adapter.

type RubiconAdapter

type RubiconAdapter struct {
	URI string

	XAPIUsername string
	XAPIPassword string
	// contains filtered or unexported fields
}

func NewRubiconAdapter

func NewRubiconAdapter(config *HTTPAdapterConfig, uri string, xuser string, xpass string, tracker string, usersyncURL string) *RubiconAdapter

func (*RubiconAdapter) Call

func (a *RubiconAdapter) Call(ctx context.Context, req *pbs.PBSRequest, bidder *pbs.PBSBidder) (pbs.PBSBidSlice, error)

func (*RubiconAdapter) FamilyName

func (a *RubiconAdapter) FamilyName() string

used for cookies and such

func (*RubiconAdapter) GetUsersyncInfo

func (a *RubiconAdapter) GetUsersyncInfo() *pbs.UsersyncInfo

func (*RubiconAdapter) Name

func (a *RubiconAdapter) Name() string

Name - export adapter name

func (*RubiconAdapter) SkipNoCookies

func (a *RubiconAdapter) SkipNoCookies() bool

Jump to

Keyboard shortcuts

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