-
Notifications
You must be signed in to change notification settings - Fork 739
/
core.go
92 lines (79 loc) · 2.44 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
package analytics
import (
"time"
"github.com/mxmCherry/openrtb/v16/openrtb2"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/openrtb_ext"
)
/*
PBSAnalyticsModule must be implemented by any analytics module that does transactional logging.
New modules can use the /analytics/endpoint_data_objects, extract the
information required and are responsible for handling all their logging activities inside LogAuctionObject, LogAmpObject
LogCookieSyncObject and LogSetUIDObject method implementations.
*/
type PBSAnalyticsModule 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
Request *openrtb2.BidRequest
Response *openrtb2.BidResponse
Account *config.Account
StartTime time.Time
}
//Loggable object of a transaction at /openrtb2/amp endpoint
type AmpObject struct {
Status int
Errors []error
Request *openrtb2.BidRequest
AuctionResponse *openrtb2.BidResponse
AmpTargetingValues map[string]string
Origin string
StartTime time.Time
}
//Loggable object of a transaction at /openrtb2/video endpoint
type VideoObject struct {
Status int
Errors []error
Request *openrtb2.BidRequest
Response *openrtb2.BidResponse
VideoRequest *openrtb_ext.BidRequestVideo
VideoResponse *openrtb_ext.BidResponseVideo
StartTime time.Time
}
//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 is a loggable object
type NotificationEvent struct {
Request *EventRequest `json:"request"`
Account *config.Account `json:"account"`
}