forked from prebid/prebid-server
-
Notifications
You must be signed in to change notification settings - Fork 5
/
ibidder_macro.go
201 lines (178 loc) · 5.5 KB
/
ibidder_macro.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
package vastbidder
import (
"net/http"
"github.com/prebid/openrtb/v20/openrtb2"
"github.com/prebid/prebid-server/v2/config"
"github.com/prebid/prebid-server/v2/openrtb_ext"
)
// IBidderMacro interface will capture all macro definition
type IBidderMacro interface {
//Helper Function
InitBidRequest(request *openrtb2.BidRequest)
LoadImpression(imp *openrtb2.Imp) (*openrtb_ext.ExtImpVASTBidder, error)
LoadVASTTag(tag *openrtb_ext.ExtImpVASTBidderTag)
GetBidderKeys() map[string]string
SetAdapterConfig(*config.Adapter)
GetURI() string
GetHeaders() http.Header
GetValue(string) (string, bool)
//getAllHeaders returns default and custom heades
getAllHeaders() http.Header
//Request
MacroTest(string) string
MacroTimeout(string) string
MacroWhitelistSeat(string) string
MacroWhitelistLang(string) string
MacroBlockedSeat(string) string
MacroCurrency(string) string
MacroBlockedCategory(string) string
MacroBlockedAdvertiser(string) string
MacroBlockedApp(string) string
//Source
MacroFD(string) string
MacroTransactionID(string) string
MacroPaymentIDChain(string) string
MacroSchain(string) string
//Regs
MacroCoppa(string) string
//Impression
MacroDisplayManager(string) string
MacroDisplayManagerVersion(string) string
MacroInterstitial(string) string
MacroTagID(string) string
MacroBidFloor(string) string
MacroBidFloorCurrency(string) string
MacroSecure(string) string
MacroPMP(string) string
//Video
MacroVideoMIMES(string) string
MacroVideoMinimumDuration(string) string
MacroVideoMaximumDuration(string) string
MacroVideoProtocols(string) string
MacroVideoPlayerWidth(string) string
MacroVideoPlayerHeight(string) string
MacroVideoStartDelay(string) string
MacroVideoPlacement(string) string
MacroVideoLinearity(string) string
MacroVideoSkip(string) string
MacroVideoSkipMinimum(string) string
MacroVideoSkipAfter(string) string
MacroVideoSequence(string) string
MacroVideoBlockedAttribute(string) string
MacroVideoMaximumExtended(string) string
MacroVideoMinimumBitRate(string) string
MacroVideoMaximumBitRate(string) string
MacroVideoBoxing(string) string
MacroVideoPlaybackMethod(string) string
MacroVideoDelivery(string) string
MacroVideoPosition(string) string
MacroVideoAPI(string) string
//Site
MacroSiteID(string) string
MacroSiteName(string) string
MacroSitePage(string) string
MacroSiteReferrer(string) string
MacroSiteSearch(string) string
MacroSiteMobile(string) string
//App
MacroAppID(string) string
MacroAppName(string) string
MacroAppBundle(string) string
MacroAppStoreURL(string) string
MacroAppVersion(string) string
MacroAppPaid(string) string
//SiteAppCommon
MacroCategory(string) string
MacroDomain(string) string
MacroSectionCategory(string) string
MacroPageCategory(string) string
MacroPrivacyPolicy(string) string
MacroKeywords(string) string
//Publisher
MacroPubID(string) string
MacroPubName(string) string
MacroPubDomain(string) string
//Content
MacroContentID(string) string
MacroContentEpisode(string) string
MacroContentTitle(string) string
MacroContentSeries(string) string
MacroContentSeason(string) string
MacroContentArtist(string) string
MacroContentGenre(string) string
MacroContentAlbum(string) string
MacroContentISrc(string) string
MacroContentURL(string) string
MacroContentCategory(string) string
MacroContentProductionQuality(string) string
MacroContentVideoQuality(string) string
MacroContentContext(string) string
MacroContentContentRating(string) string
MacroContentUserRating(string) string
MacroContentQAGMediaRating(string) string
MacroContentKeywords(string) string
MacroContentLiveStream(string) string
MacroContentSourceRelationship(string) string
MacroContentLength(string) string
MacroContentLanguage(string) string
MacroContentEmbeddable(string) string
//Producer
MacroProducerID(string) string
MacroProducerName(string) string
//Device
MacroUserAgent(string) string
MacroDNT(string) string
MacroLMT(string) string
MacroIP(string) string
MacroDeviceType(string) string
MacroMake(string) string
MacroModel(string) string
MacroDeviceOS(string) string
MacroDeviceOSVersion(string) string
MacroDeviceWidth(string) string
MacroDeviceHeight(string) string
MacroDeviceJS(string) string
MacroDeviceLanguage(string) string
MacroDeviceIFA(string) string
MacroDeviceIFAType(string) string
MacroDeviceDIDSHA1(string) string
MacroDeviceDIDMD5(string) string
MacroDeviceDPIDSHA1(string) string
MacroDeviceDPIDMD5(string) string
MacroDeviceMACSHA1(string) string
MacroDeviceMACMD5(string) string
//Geo
MacroLatitude(string) string
MacroLongitude(string) string
MacroCountry(string) string
MacroRegion(string) string
MacroCity(string) string
MacroZip(string) string
MacroUTCOffset(string) string
//User
MacroUserID(string) string
MacroYearOfBirth(string) string
MacroGender(string) string
//Extension
MacroGDPRConsent(string) string
MacroGDPR(string) string
MacroUSPrivacy(string) string
//Additional
MacroCacheBuster(string) string
//Keyval
MacroKV(string) string
MacroKVM(string) string
}
var bidderMacroMap = map[openrtb_ext.BidderName]func() IBidderMacro{}
// RegisterNewBidderMacro will be used by each bidder to set its respective macro IBidderMacro
func RegisterNewBidderMacro(bidder openrtb_ext.BidderName, macro func() IBidderMacro) {
bidderMacroMap[bidder] = macro
}
// GetNewBidderMacro will return IBidderMacro of specific bidder
func GetNewBidderMacro(bidder openrtb_ext.BidderName) IBidderMacro {
callback, ok := bidderMacroMap[bidder]
if ok {
return callback()
}
return NewBidderMacro()
}