github.com/prebid/prebid-server/v2@v2.18.0/hooks/hookanalytics/analytics.go (about) 1 // Package hookanalytics provides basic primitives for use by the hook modules. 2 // 3 // Structures of the package allow modules to provide information 4 // about what activity has been performed against the hook payload. 5 package hookanalytics 6 7 type Analytics struct { 8 Activities []Activity `json:"activities,omitempty"` 9 } 10 11 type Activity struct { 12 Name string `json:"name"` 13 Status ActivityStatus `json:"status"` 14 Results []Result `json:"results,omitempty"` 15 } 16 17 type ActivityStatus string 18 19 const ( 20 ActivityStatusSuccess ActivityStatus = "success" 21 ActivityStatusError ActivityStatus = "error" 22 ) 23 24 type Result struct { 25 Status ResultStatus `json:"status,omitempty"` 26 Values map[string]interface{} `json:"values,omitempty"` 27 AppliedTo AppliedTo `json:"appliedto,omitempty"` 28 } 29 30 type AppliedTo struct { 31 Bidder string `json:"bidder,omitempty"` 32 BidIds []string `json:"bidids,omitempty"` 33 ImpIds []string `json:"impids,omitempty"` 34 Request bool `json:"request,omitempty"` 35 Response bool `json:"response,omitempty"` 36 } 37 38 type ResultStatus string 39 40 const ( 41 ResultStatusAllow ResultStatus = "success-allow" 42 ResultStatusBlock ResultStatus = "success-block" 43 ResultStatusModify ResultStatus = "success-modify" 44 ResultStatusError ResultStatus = "error" 45 )