-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbidlogger.go
28 lines (24 loc) · 960 Bytes
/
bidlogger.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
package rtb
// BidLogItem defines the structure of a bidder log
type BidLogItem struct {
Domain string `json:"d,omitempty"`
BidRequest *BidRequest `json:"rq,omitempty"`
BidResponse *BidResponse `json:"rp,omitempty"`
RemainingDailyBudgetsInMicroCents map[string]int64 `json:"b,omitempty"`
StartTimestampInNanoseconds int64 `json:"sts,omitempty"`
EndTimestampInNanoseconds int64 `json:"ets,omitempty"`
}
// BidLogProducer defines a type that can log bid requests
type BidLogProducer interface {
// Safe inside goroutine
LogItem(logItem *BidLogItem)
}
// BidLogConsumer defines a type that can consume bid log requests
type BidLogConsumer interface {
LogChannel() chan *BidLogItem
}
// BidLogger defines a type that can both produce and consume bid log requests
type BidLogger interface {
BidLogProducer
BidLogConsumer
}