-
Notifications
You must be signed in to change notification settings - Fork 715
/
core.go
93 lines (82 loc) · 2.75 KB
/
core.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
package analytics
import (
"time"
"github.com/prebid/openrtb/v20/openrtb2"
"github.com/prebid/prebid-server/v2/config"
"github.com/prebid/prebid-server/v2/hooks/hookexecution"
"github.com/prebid/prebid-server/v2/openrtb_ext"
)
// Module must be implemented by analytics modules to extract the required information and logging
// activities. Do not use marshal the parameter objects directly as they can change over time. Use a separate
// model for each analytics module and transform as appropriate.
type Module interface {
LogAuctionObject(*AuctionObject)
LogVideoObject(*VideoObject)
LogCookieSyncObject(*CookieSyncObject)
LogSetUIDObject(*SetUIDObject)
LogAmpObject(*AmpObject)
LogNotificationEventObject(*NotificationEvent)
}
// Loggable object of a transaction at /openrtb2/auction endpoint
type AuctionObject struct {
Status int
Errors []error
Response *openrtb2.BidResponse
Account *config.Account
StartTime time.Time
HookExecutionOutcome []hookexecution.StageOutcome
SeatNonBid []openrtb_ext.SeatNonBid
RequestWrapper *openrtb_ext.RequestWrapper
}
// Loggable object of a transaction at /openrtb2/amp endpoint
type AmpObject struct {
Status int
Errors []error
AuctionResponse *openrtb2.BidResponse
AmpTargetingValues map[string]string
Origin string
StartTime time.Time
HookExecutionOutcome []hookexecution.StageOutcome
SeatNonBid []openrtb_ext.SeatNonBid
RequestWrapper *openrtb_ext.RequestWrapper
}
// Loggable object of a transaction at /openrtb2/video endpoint
type VideoObject struct {
Status int
Errors []error
Response *openrtb2.BidResponse
VideoRequest *openrtb_ext.BidRequestVideo
VideoResponse *openrtb_ext.BidResponseVideo
StartTime time.Time
SeatNonBid []openrtb_ext.SeatNonBid
RequestWrapper *openrtb_ext.RequestWrapper
}
// Loggable object of a transaction at /setuid
type SetUIDObject struct {
Status int
Bidder string
UID string
Errors []error
Success bool
}
// Loggable object of a transaction at /cookie_sync
type CookieSyncObject struct {
Status int
Errors []error
BidderStatus []*CookieSyncBidder
}
type CookieSyncBidder struct {
BidderCode string `json:"bidder"`
NoCookie bool `json:"no_cookie,omitempty"`
UsersyncInfo *UsersyncInfo `json:"usersync,omitempty"`
}
type UsersyncInfo struct {
URL string `json:"url,omitempty"`
Type string `json:"type,omitempty"`
SupportCORS bool `json:"supportCORS,omitempty"`
}
// NotificationEvent object of a transaction at /event
type NotificationEvent struct {
Request *EventRequest `json:"request"`
Account *config.Account `json:"account"`
}