From adbec5ce1937da8ea7f3fcde698aa7fc127482de Mon Sep 17 00:00:00 2001 From: Max Cherry Date: Mon, 13 Jun 2016 21:07:32 +0300 Subject: [PATCH] Switch from uint8 to int8 - https://github.com/mxmCherry/openrtb/issues/3 --- app.go | 4 ++-- banner.go | 12 ++++++------ bid_request.go | 6 +++--- bid_response.go | 2 +- content.go | 12 ++++++------ deal.go | 2 +- device.go | 10 +++++----- geo.go | 4 ++-- imp.go | 4 ++-- native.go | 4 ++-- pmp.go | 2 +- regs.go | 2 +- seat_bid.go | 2 +- site.go | 4 ++-- video.go | 22 +++++++++++----------- 15 files changed, 46 insertions(+), 46 deletions(-) diff --git a/app.go b/app.go index 16a6677..11b1cc0 100644 --- a/app.go +++ b/app.go @@ -88,7 +88,7 @@ type App struct { // integer // Description: // Indicates if the app has a privacy policy, where 0 = no, 1 = yes. - PrivacyPolicy uint8 `json:"privacypolicy,omitempty"` + PrivacyPolicy int8 `json:"privacypolicy,omitempty"` // Attribute: // paid @@ -96,7 +96,7 @@ type App struct { // integer // Description: // 0 = app is free, 1 = the app is a paid version. - Paid uint8 `json:"paid,omitempty"` + Paid int8 `json:"paid,omitempty"` // Attribute: // publisher diff --git a/banner.go b/banner.go index a0322c2..068991e 100644 --- a/banner.go +++ b/banner.go @@ -92,7 +92,7 @@ type Banner struct { // integer array // Description: // Blocked banner ad types. Refer to List 5.2. - BType []uint8 `json:"btype,omitempty"` + BType []int8 `json:"btype,omitempty"` // Attribute: // battr @@ -100,7 +100,7 @@ type Banner struct { // integer array // Description: // Blocked creative attributes. Refer to List 5.3. - BAttr []uint8 `json:"battr,omitempty"` + BAttr []int8 `json:"battr,omitempty"` // Attribute: // pos @@ -108,7 +108,7 @@ type Banner struct { // integer // Description: // Ad position on screen. Refer to List 5.4 - Pos uint8 `json:"pos,omitempty"` + Pos int8 `json:"pos,omitempty"` // Attribute: // mimes @@ -126,7 +126,7 @@ type Banner struct { // Description: // Indicates if the banner is in the top frame as opposed to an // iframe, where 0 = no, 1 = yes. - TopFrame uint8 `json:"topframe,omitempty"` + TopFrame int8 `json:"topframe,omitempty"` // Attribute: // expdir @@ -134,7 +134,7 @@ type Banner struct { // integer array // Description: // Directions in which the banner may expand. Refer to List 5.5. - ExpDir []uint8 `json:"expdir,omitempty"` + ExpDir []int8 `json:"expdir,omitempty"` // Attribute: // api @@ -143,7 +143,7 @@ type Banner struct { // Description: // List of supported API frameworks for this impression. Refer to // List 5.6. If an API is not explicitly listed, it is assumed not to be supported. - API []uint8 `json:"api,omitempty"` + API []int8 `json:"api,omitempty"` // Attribute: // ext diff --git a/bid_request.go b/bid_request.go index 2380844..7890932 100644 --- a/bid_request.go +++ b/bid_request.go @@ -69,7 +69,7 @@ type BidRequest struct { // integer; default 0 // Description: // Indicator of test mode in which auctions are not billable, where 0 = live mode, 1 = test mode. - Test uint8 `json:"test,omitempty"` + Test int8 `json:"test,omitempty"` // Attribute: // at @@ -79,7 +79,7 @@ type BidRequest struct { // Auction type, where 1 = First Price, 2 = Second Price Plus. // Exchange-specific auction types can be defined using values // greater than 500. - AT uint8 `json:"at,omitempty"` + AT int8 `json:"at,omitempty"` // Attribute: // tmax @@ -108,7 +108,7 @@ type BidRequest struct { // (e.g., all on the web page, all video spots such as pre/mid/post // roll) to support road-blocking. 0 = no or unknown, 1 = yes, the // impressions offered represent all that are available. - AllImps uint8 `json:"allimps,omitempty"` + AllImps int8 `json:"allimps,omitempty"` // Attribute: // cur diff --git a/bid_response.go b/bid_response.go index b11249e..550a1da 100644 --- a/bid_response.go +++ b/bid_response.go @@ -62,7 +62,7 @@ type BidResponse struct { // integer // Description: // Reason for not bidding. Refer to List 5.19. - NBR uint8 `json:"nbr,omitempty"` + NBR int8 `json:"nbr,omitempty"` // Attribute: // ext diff --git a/content.go b/content.go index 4993d30..fbf1cfe 100644 --- a/content.go +++ b/content.go @@ -87,7 +87,7 @@ type Content struct { // integer // Description: // Video quality per IAB’s classification. Refer to List 5.11. - VideoQuality uint8 `json:"videoquality,omitempty"` + VideoQuality int8 `json:"videoquality,omitempty"` // Attribute: // context @@ -95,7 +95,7 @@ type Content struct { // integer // Description: // Type of content (game, video, text, etc.). Refer to List 5.14. - Context uint8 `json:"context,omitempty"` + Context int8 `json:"context,omitempty"` // Attribute: // contentrating @@ -119,7 +119,7 @@ type Content struct { // integer // Description: // Media rating per QAG guidelines. Refer to List 5.15. - QAGMediaRating uint8 `json:"qagmediarating,omitempty"` + QAGMediaRating int8 `json:"qagmediarating,omitempty"` // Attribute: // keywords @@ -135,7 +135,7 @@ type Content struct { // integer // Description: // 0 = not live, 1 = content is live (e.g., stream, live blog). - LiveStream uint8 `json:"livestream,omitempty"` + LiveStream int8 `json:"livestream,omitempty"` // Attribute: // sourcerelationship @@ -143,7 +143,7 @@ type Content struct { // integer // Description: // 0 = indirect, 1 = direct. - SourceRelationship uint8 `json:"sourcerelationship,omitempty"` + SourceRelationship int8 `json:"sourcerelationship,omitempty"` // Attribute: // len @@ -168,7 +168,7 @@ type Content struct { // Description: // Indicator of whether or not the content is embeddable (e.g., // an embeddable video player), where 0 = no, 1 = yes. - Embeddable uint8 `json:"embeddable,omitempty"` + Embeddable int8 `json:"embeddable,omitempty"` // Attribute: // ext diff --git a/deal.go b/deal.go index 85de501..09d1e30 100644 --- a/deal.go +++ b/deal.go @@ -40,7 +40,7 @@ type Deal struct { // Optional override of the overall auction type of the bid request, where 1 = First Price, // 2 = Second Price Plus, 3 = the value passed in bidfloor is the agreed upon deal price. Additional // auction types can be defined by the exchange. - AT uint8 `json:"at,omitempty"` + AT int8 `json:"at,omitempty"` // Attribute: // wseat diff --git a/device.go b/device.go index c91ce75..67ca947 100644 --- a/device.go +++ b/device.go @@ -31,7 +31,7 @@ type Device struct { // Description: // Standard “Do Not Track” flag as set in the header by the // browser, where 0 = tracking is unrestricted, 1 = do not track. - DNT uint8 `json:"dnt,omitempty"` + DNT int8 `json:"dnt,omitempty"` // Attribute: // lmt @@ -41,7 +41,7 @@ type Device struct { // “Limit Ad Tracking” signal commercially endorsed (e.g., iOS, // Android), where 0 = tracking is unrestricted, 1 = tracking must // be limited per commercial guidelines. - Lmt uint8 `json:"lmt,omitempty"` + Lmt int8 `json:"lmt,omitempty"` // Attribute: // ip @@ -65,7 +65,7 @@ type Device struct { // integer // Description: // The general type of device. Refer to List 5.17. - DeviceType uint8 `json:"devicetype,omitempty"` + DeviceType int8 `json:"devicetype,omitempty"` // Attribute: // make @@ -145,7 +145,7 @@ type Device struct { // integer // Description: // Support for JavaScript, where 0 = no, 1 = yes. - JS uint8 `json:"js,omitempty"` + JS int8 `json:"js,omitempty"` // Attribute: // flashver @@ -179,7 +179,7 @@ type Device struct { // integer // Description: // Network connection type. Refer to List 5.18. - Connectiontype uint8 `json:"connectiontype,omitempty"` + Connectiontype int8 `json:"connectiontype,omitempty"` // Attribute: // ifa diff --git a/geo.go b/geo.go index f6869d9..c599095 100644 --- a/geo.go +++ b/geo.go @@ -33,7 +33,7 @@ type Geo struct { // Description: // Source of location data; recommended when passing // lat/lon. Refer to List 5.16. - Type uint8 `json:"type,omitempty"` + Type int8 `json:"type,omitempty"` // Attribute: // country @@ -92,7 +92,7 @@ type Geo struct { // integer // Description: // Local time as the number +/- of minutes from UTC. - UTCOffset int8 `json:"utcoffset,omitempty"` + UTCOffset int16 `json:"utcoffset,omitempty"` // Attribute: // ext diff --git a/imp.go b/imp.go index e9ae6b6..8995585 100644 --- a/imp.go +++ b/imp.go @@ -65,7 +65,7 @@ type Imp struct { // int; default 0 // Description: // 1 = the ad is interstitial or full screen, 0 = not interstitial. - Instl uint8 `json:"instl,omitempty"` + Instl int8 `json:"instl,omitempty"` // Attribute: // tagid @@ -104,7 +104,7 @@ type Imp struct { // creative assets and markup, where 0 = non-secure, 1 = secure. // If omitted, the secure state is unknown, but non-secure HTTP // support can be assumed. - Secure uint8 `json:"secure,omitempty"` + Secure int8 `json:"secure,omitempty"` // Attribute: // iframebuster diff --git a/native.go b/native.go index d37c162..ddb122f 100644 --- a/native.go +++ b/native.go @@ -41,7 +41,7 @@ type Native struct { // Description: // List of supported API frameworks for this impression. Refer to // List 5.6. If an API is not explicitly listed, it is assumed not to be supported. - API []uint8 `json:"api,omitempty"` + API []int8 `json:"api,omitempty"` // Attribute: // sequence @@ -49,7 +49,7 @@ type Native struct { // integer array // Description: // Blocked creative attributes. Refer to List 5.3. - BAttr []uint8 `json:"battr,omitempty"` + BAttr []int8 `json:"battr,omitempty"` // Attribute: // ext diff --git a/pmp.go b/pmp.go index 8ff1310..7d4b2f2 100644 --- a/pmp.go +++ b/pmp.go @@ -14,7 +14,7 @@ type PMP struct { // Description: // Indicator of auction eligibility to seats named in the Direct Deals object, where 0 = all bids are accepted, // 1 = bids are restricted to the deals specified and the terms thereof. - PrivateAuction uint8 `json:"private_auction,omitempty"` + PrivateAuction int8 `json:"private_auction,omitempty"` // Attribute: // id diff --git a/regs.go b/regs.go index 50b8cb8..dd934fd 100644 --- a/regs.go +++ b/regs.go @@ -14,7 +14,7 @@ type Regs struct { // Description: // Flag indicating if this request is subject to the COPPA // regulations established by the USA FTC, where 0 = no, 1 = yes. - COPPA uint8 `json:"coppa,omitempty"` + COPPA int8 `json:"coppa,omitempty"` // Attribute: // ext diff --git a/seat_bid.go b/seat_bid.go index 8849c21..87025de 100644 --- a/seat_bid.go +++ b/seat_bid.go @@ -32,7 +32,7 @@ type SeatBid struct { // Description: // 0 = impressions can be won individually; 1 = impressions must // be won or lost as a group. - Group uint8 `json:"group,omitempty"` + Group int8 `json:"group,omitempty"` // Attribute: // ext diff --git a/site.go b/site.go index 1439716..0dd13e1 100644 --- a/site.go +++ b/site.go @@ -87,7 +87,7 @@ type Site struct { // integer // Description: // Mobile-optimized signal, where 0 = no, 1 = yes. - Mobile uint8 `json:"mobile,omitempty"` + Mobile int8 `json:"mobile,omitempty"` // Attribute: // privacypolicy @@ -95,7 +95,7 @@ type Site struct { // integer // Description: // Indicates if the site has a privacy policy, where 0 = no, 1 = yes. - PrivacyPolicy uint8 `json:"privacypolicy,omitempty"` + PrivacyPolicy int8 `json:"privacypolicy,omitempty"` // Attribute: // publisher diff --git a/video.go b/video.go index 4226957..df1240c 100644 --- a/video.go +++ b/video.go @@ -48,7 +48,7 @@ type Video struct { // Supported video bid response protocol. Refer to List 5.8. At // least one supported protocol must be specified in either the // protocol or protocols attribute. - Protocol []uint8 `json:"protocol,omitempty"` + Protocol []int8 `json:"protocol,omitempty"` // Attribute: // protocols @@ -58,7 +58,7 @@ type Video struct { // Array of supported video bid response protocols. Refer to List // 5.8. At least one supported protocol must be specified in // either the protocol or protocols attribute. - Protocols []uint8 `json:"protocols,omitempty"` + Protocols []int8 `json:"protocols,omitempty"` // Attribute: // w @@ -93,7 +93,7 @@ type Video struct { // Description: // Indicates if the impression must be linear, nonlinear, etc. If // none specified, assume all are allowed. Refer to List 5.7. - Linearity uint8 `json:"linearity,omitempty"` + Linearity int8 `json:"linearity,omitempty"` // Attribute: // sequence @@ -103,7 +103,7 @@ type Video struct { // If multiple ad impressions are offered in the same bid request, // the sequence number will allow for the coordinated delivery // of multiple creatives. - Sequence uint8 `json:"sequence,omitempty"` + Sequence int8 `json:"sequence,omitempty"` // Attribute: // battr @@ -111,7 +111,7 @@ type Video struct { // integer array // Description: // Blocked creative attributes. Refer to List 5.3. - BAttr []uint8 `json:"battr,omitempty"` + BAttr []int8 `json:"battr,omitempty"` // Attribute: // maxextended @@ -150,7 +150,7 @@ type Video struct { // Description: // Indicates if letter-boxing of 4:3 content into a 16:9 window is // allowed, where 0 = no, 1 = yes. - BoxingAllowed uint8 `json:"boxingallowed,omitempty"` + BoxingAllowed int8 `json:"boxingallowed,omitempty"` // Attribute: // playbackmethod @@ -159,7 +159,7 @@ type Video struct { // Description: // Allowed playback methods. If none specified, assume all are // allowed. Refer to List 5.9. - PlaybackMethod []uint8 `json:"playbackmethod,omitempty"` + PlaybackMethod []int8 `json:"playbackmethod,omitempty"` // Attribute: // delivery @@ -168,7 +168,7 @@ type Video struct { // Description: // Supported delivery methods (e.g., streaming, progressive). If // none specified, assume all are supported. Refer to List 5.13. - Delivery []uint8 `json:"delivery,omitempty"` + Delivery []int8 `json:"delivery,omitempty"` // Attribute: // pos @@ -176,7 +176,7 @@ type Video struct { // integer // Description: // Ad position on screen. Refer to List 5.4 - Pos uint8 `json:"pos,omitempty"` + Pos int8 `json:"pos,omitempty"` // Attribute: // companionad @@ -194,7 +194,7 @@ type Video struct { // Description: // List of supported API frameworks for this impression. Refer to // List 5.6. If an API is not explicitly listed, it is assumed not to be supported. - API []uint8 `json:"api,omitempty"` + API []int8 `json:"api,omitempty"` // Attribute: // companiontype @@ -204,7 +204,7 @@ type Video struct { // Supported VAST companion ad types. Refer to List 5.12. // Recommended if companion Banner objects are included via // the companionad array. - CompanionType []uint8 `json:"companiontype,omitempty"` + CompanionType []int8 `json:"companiontype,omitempty"` // Attribute: // ext