Documentation
¶
Index ¶
- Constants
- func Builder(cfg json.RawMessage, deps moduledeps.ModuleDeps) (interface{}, error)
- func NewBidderConfigRuleSetBuilder[T1 RequestWrapper, T2 ProcessedAuctionHookResult](geoscopeConfig map[string][]string, setDefinitions map[string][]string) *bidderConfigRuleSetBuilder[T1, T2]
- func NewCache(refreshRateSeconds int) *cache
- func NewCacheEntry(cfg *config.PbRulesEngine, cfgRaw *json.RawMessage, ...) (cacheEntry, error)
- type CountryExclusions
- type CountryGroups
- type ExcludeBidders
- type IncludeBidders
- type ModelGroup
- type Module
- type ProcessedAuctionHookResult
- type ProcessedAuctionResultFunc
- type RequestWrapper
- type RulesEngineObserver
Constants ¶
const ( ExcludeBiddersName = "excludeBidders" IncludeBiddersName = "includeBidders" )
Variables ¶
This section is empty.
Functions ¶
func Builder ¶
func Builder(cfg json.RawMessage, deps moduledeps.ModuleDeps) (interface{}, error)
Builder configures the rules engine module initiating an in-memory cache and kicking off a go routine that builds tree structures that represent rule sets optimized for finding a rule to applies for a given request.
func NewBidderConfigRuleSetBuilder ¶
func NewBidderConfigRuleSetBuilder[T1 RequestWrapper, T2 ProcessedAuctionHookResult]( geoscopeConfig map[string][]string, setDefinitions map[string][]string, ) *bidderConfigRuleSetBuilder[T1, T2]
NewBidderConfigRuleSetBuilder creates a new instance of bidderConfigRuleSetBuilder
func NewCacheEntry ¶
func NewCacheEntry(cfg *config.PbRulesEngine, cfgRaw *json.RawMessage, geoscopes map[string][]string) (cacheEntry, error)
NewCacheEntry creates a new cache object for the given configuration It builds the tree structures for the rule sets for the processed auction request stage and stores them in the cache object
Types ¶
type CountryExclusions ¶
type CountryGroups ¶
type ExcludeBidders ¶
type ExcludeBidders struct {
Args config.ResultFuncParams
}
ExcludeBidders is a struct that holds parameters for excluding bidders in the rules engine.
func (*ExcludeBidders) Call ¶
func (eb *ExcludeBidders) Call(req *openrtb_ext.RequestWrapper, result *ProcessedAuctionHookResult, meta rules.ResultFunctionMeta) error
Call is a method that applies the changes specified in the ExcludeBidders instance to the provided ChangeSet by creating a mutation.
func (*ExcludeBidders) Name ¶
func (eb *ExcludeBidders) Name() string
type IncludeBidders ¶
type IncludeBidders struct {
Args config.ResultFuncParams
}
IncludeBidders is a struct that holds parameters for including bidders in the rules engine.
func (*IncludeBidders) Call ¶
func (ib *IncludeBidders) Call(req *openrtb_ext.RequestWrapper, result *ProcessedAuctionHookResult, meta rules.ResultFunctionMeta) error
Call is a method that applies the changes specified in the IncludeBidders instance to the provided ChangeSet by creating a mutation.
func (*IncludeBidders) Name ¶
func (ib *IncludeBidders) Name() string
type ModelGroup ¶
type ModelGroup = cacheModelGroup[RequestWrapper, ProcessedAuctionHookResult]
type Module ¶
type Module struct {
Cache cacher
TreeManager *treeManager
}
Module represents the rules engine module
func (Module) HandleProcessedAuctionHook ¶
func (m Module) HandleProcessedAuctionHook( _ context.Context, miCtx hs.ModuleInvocationContext, payload hs.ProcessedAuctionRequestPayload, ) (hs.HookResult[hs.ProcessedAuctionRequestPayload], error)
HandleProcessedAuctionHook updates field on openrtb2.BidRequest. Fields are updated only if request satisfies conditions provided by the module config.
type ProcessedAuctionHookResult ¶
type ProcessedAuctionHookResult struct {
HookResult hs.HookResult[hs.ProcessedAuctionRequestPayload]
AllowedBidders map[string]struct{}
}
type ProcessedAuctionResultFunc ¶
type ProcessedAuctionResultFunc = rules.ResultFunction[openrtb_ext.RequestWrapper, ProcessedAuctionHookResult]
ProcessedAuctionResultFunc is a type alias for a result function that runs in the processed auction request stage.
func NewExcludeBidders ¶
func NewExcludeBidders(params json.RawMessage) (ProcessedAuctionResultFunc, error)
NewExcludeBidders is a factory function that creates a new ExcludeBidders result function. It takes a JSON raw message as input, unmarshals it into a slice of ResultFuncParams, and returns an ExcludeBidders instance. The function returns an error if there is an issue with the unmarshalling process. The ExcludeBidders function is used to modify the ProcessedAuctionRequestPayload in the ChangeSet.
func NewIncludeBidders ¶
func NewIncludeBidders(params json.RawMessage) (ProcessedAuctionResultFunc, error)
NewIncludeBidders is a factory function that creates a new IncludeBidders result function. It takes a JSON raw message as input, unmarshals it into a slice of ResultFuncParams, and returns an IncludeBidders instance. The function returns an error if there is an issue with the unmarshalling process. The IncludeBidders function is used to modify the ProcessedAuctionRequestPayload in the ChangeSet.
func NewProcessedAuctionRequestResultFunction ¶
func NewProcessedAuctionRequestResultFunction(name string, params json.RawMessage) (ProcessedAuctionResultFunc, error)
NewProcessedAuctionRequestResultFunction is a factory function that creates a new result function based on the provided name and parameters. It returns an error if the function name is not recognized or if there is an issue with the parameters. The function name is case insensitive. The parameters are expected to be in JSON format and will be unmarshalled into the appropriate struct. The function returns a rules.ResultFunction that can be used to modify the ProcessedAuctionRequestPayload in the ChangeSet. The function is used to create result functions for the rules engine in the Prebid Server.
type RequestWrapper ¶
type RequestWrapper = openrtb_ext.RequestWrapper
type RulesEngineObserver ¶
type RulesEngineObserver interface {
// contains filtered or unexported methods
}