Documentation ¶
Index ¶
- Variables
- type Metrics
- type MultisourceWrapper
- func (wrp *MultisourceWrapper) Bid(request *adtype.BidRequest) (response adtype.Responser)
- func (wrp *MultisourceWrapper) ID() uint64
- func (wrp *MultisourceWrapper) ObjectKey() uint64
- func (wrp *MultisourceWrapper) PriceCorrectionReduceFactor() float64
- func (wrp *MultisourceWrapper) ProcessResponse(response adtype.Responser)
- func (wrp *MultisourceWrapper) ProcessResponseItem(response adtype.Responser, item adtype.ResponserItem)
- func (wrp *MultisourceWrapper) Protocol() string
- func (wrp *MultisourceWrapper) RequestStrategy() adtype.RequestStrategy
- func (wrp *MultisourceWrapper) RevenueShareReduceFactor() float64
- func (wrp *MultisourceWrapper) SetRequestTimeout(timeout time.Duration)
- func (wrp *MultisourceWrapper) Sources() adtype.SourceAccessor
- func (wrp *MultisourceWrapper) Test(request *adtype.BidRequest) bool
- type Option
- type SourceError
Constants ¶
This section is empty.
Variables ¶
var (
ErrSourcesCantBeNil = errors.New("[SSP] seurces can`t be nil")
)
Error set...
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics wrapper
func (*Metrics) IncrementBidErrorCount ¶
func (m *Metrics) IncrementBidErrorCount(source adtype.Source, request *adtype.BidRequest, err error)
IncrementBidErrorCount metric
func (*Metrics) IncrementBidRequestCount ¶
func (m *Metrics) IncrementBidRequestCount(source adtype.Source, request *adtype.BidRequest, duration time.Duration)
IncrementBidRequestCount metric
type MultisourceWrapper ¶
type MultisourceWrapper struct {
// contains filtered or unexported fields
}
MultisourceWrapper describes the abstraction which can control where to send requests and how to handle responses from different sources.
func NewMultisourceWrapper ¶
func NewMultisourceWrapper(options ...Option) (*MultisourceWrapper, error)
NewMultisourceWrapper initializes a new MultisourceWrapper with the given options
func (*MultisourceWrapper) Bid ¶
func (wrp *MultisourceWrapper) Bid(request *adtype.BidRequest) (response adtype.Responser)
Bid handles a bid request and processes it through the appropriate sources
func (*MultisourceWrapper) ID ¶
func (wrp *MultisourceWrapper) ID() uint64
ID returns the ID of the source driver
func (*MultisourceWrapper) ObjectKey ¶
func (wrp *MultisourceWrapper) ObjectKey() uint64
ObjectKey returns the object key of the source driver
func (*MultisourceWrapper) PriceCorrectionReduceFactor ¶
func (wrp *MultisourceWrapper) PriceCorrectionReduceFactor() float64
PriceCorrectionReduceFactor returns the price correction reduce factor If there is a 10% price correction, it means that 10% of the final price must be ignored
func (*MultisourceWrapper) ProcessResponse ¶
func (wrp *MultisourceWrapper) ProcessResponse(response adtype.Responser)
ProcessResponse processes the response to update metrics and log information
func (*MultisourceWrapper) ProcessResponseItem ¶
func (wrp *MultisourceWrapper) ProcessResponseItem(response adtype.Responser, item adtype.ResponserItem)
ProcessResponseItem processes an individual response item
func (*MultisourceWrapper) Protocol ¶
func (wrp *MultisourceWrapper) Protocol() string
Protocol returns the protocol of the source driver
func (*MultisourceWrapper) RequestStrategy ¶
func (wrp *MultisourceWrapper) RequestStrategy() adtype.RequestStrategy
RequestStrategy returns the request strategy
func (*MultisourceWrapper) RevenueShareReduceFactor ¶
func (wrp *MultisourceWrapper) RevenueShareReduceFactor() float64
RevenueShareReduceFactor returns the revenue share reduce factor
func (*MultisourceWrapper) SetRequestTimeout ¶
func (wrp *MultisourceWrapper) SetRequestTimeout(timeout time.Duration)
SetRequestTimeout sets the request timeout, ensuring it is not below the minimal timeout
func (*MultisourceWrapper) Sources ¶
func (wrp *MultisourceWrapper) Sources() adtype.SourceAccessor
Sources returns the source accessor
func (*MultisourceWrapper) Test ¶
func (wrp *MultisourceWrapper) Test(request *adtype.BidRequest) bool
Test validates the request before processing
type Option ¶
type Option func(wrp *MultisourceWrapper)
Option sets some property of the server
func WithMaxParallelRequests ¶
WithMaxParallelRequests returns count of requests to external sources by one request
func WithSourceAccessor ¶
func WithSourceAccessor(sources adtype.SourceAccessor) Option
WithSourceAccessor for the server
type SourceError ¶
SourceError contains only errors from some source drivers
func (*SourceError) Error ¶
func (e *SourceError) Error() string