From 768e1b18756adca6ac059a8b335f97da4facfe54 Mon Sep 17 00:00:00 2001 From: Max Cherry Date: Sun, 17 May 2015 14:32:56 +0300 Subject: [PATCH] Dropped constants (if constants will ever return - they should be kept outside of main 'rtb' package, which should be as minimalistic as possible) --- 2.3/rtb/ad_position.go | 21 ----------------- 2.3/rtb/api_frameworks.go | 15 ------------- 2.3/rtb/app.go | 6 ----- 2.3/rtb/banner.go | 7 ------ 2.3/rtb/banner_ad_types.go | 12 ---------- 2.3/rtb/bid_request.go | 24 -------------------- 2.3/rtb/content.go | 19 ---------------- 2.3/rtb/creative_attributes.go | 26 --------------------- 2.3/rtb/deal.go | 9 -------- 2.3/rtb/device.go | 21 ----------------- 2.3/rtb/expandable_direction.go | 13 ----------- 2.3/rtb/geo.go | 8 ------- 2.3/rtb/imp.go | 15 ------------- 2.3/rtb/pmp.go | 7 ------ 2.3/rtb/regs.go | 7 ------ 2.3/rtb/rtb.go | 2 +- 2.3/rtb/seat_bid.go | 7 ------ 2.3/rtb/site.go | 12 ---------- 2.3/rtb/user.go | 9 -------- 2.3/rtb/video.go | 17 -------------- 2.3/rtb/video_bid_response_protocols.go | 14 ------------ 2.3/rtb/video_linearity.go | 19 ---------------- 2.3/rtb/video_playback_methods.go | 11 --------- 2.3/rtb/video_quality.go | 12 ---------- 2.3/rtb/video_start_delay.go | 12 ---------- README.md | 30 +++---------------------- 26 files changed, 4 insertions(+), 351 deletions(-) delete mode 100644 2.3/rtb/ad_position.go delete mode 100644 2.3/rtb/api_frameworks.go delete mode 100644 2.3/rtb/banner_ad_types.go delete mode 100644 2.3/rtb/creative_attributes.go delete mode 100644 2.3/rtb/expandable_direction.go delete mode 100644 2.3/rtb/video_bid_response_protocols.go delete mode 100644 2.3/rtb/video_linearity.go delete mode 100644 2.3/rtb/video_playback_methods.go delete mode 100644 2.3/rtb/video_quality.go delete mode 100644 2.3/rtb/video_start_delay.go diff --git a/2.3/rtb/ad_position.go b/2.3/rtb/ad_position.go deleted file mode 100644 index a5c9797..0000000 --- a/2.3/rtb/ad_position.go +++ /dev/null @@ -1,21 +0,0 @@ -package rtb - -// 5.4 Ad Position -// -// The following table specifies the position of the ad as a relative measure of visibility or prominence. -// -// This OpenRTB table has values derived from the IAB Quality Assurance Guidelines (QAG). Practitioners -// should keep in sync with updates to the QAG values as published on IAB.net. Values “3” – “6” apply to -// apps per the mobile addendum to QAG version 1.5. -// -// TODO: review and rename -const ( - AdPositionUnknown uint8 = 0 // 0 Unknown - AdPositionAboveTheFold uint8 = 1 // 1 Above the Fold - AdPositionMayBeInitiallyVisible uint8 = 2 // 2 DEPRECATED - May or may not be initially visible depending on screen size/resolution. - AdPositionBelowTheFold uint8 = 3 // 3 Below the Fold - AdPositionHeader uint8 = 4 // 4 Header - AdPositionFooter uint8 = 5 // 5 Footer - AdPositionSidebar uint8 = 6 // 6 Sidebar - AdPositionFullScreen uint8 = 7 // 7 Full Screen -) diff --git a/2.3/rtb/api_frameworks.go b/2.3/rtb/api_frameworks.go deleted file mode 100644 index 3b80d9e..0000000 --- a/2.3/rtb/api_frameworks.go +++ /dev/null @@ -1,15 +0,0 @@ -package rtb - -// 5.6 API Frameworks -// -// The following table is a list of API frameworks supported by the publisher. Note that MRAID-1 is a -// subset of MRAID-2. In OpenRTB 2.1 and prior, value “3” was “MRAID”. However, not all MRAID capable -// APIs understand MRAID-2 features and as such the only safe interpretation of value “3” is MRAID-1. In -// OpenRTB 2.2, this was made explicit and MRAID-2 has been added as value “5”. -const ( - APIFrameworkVPAID10 = 1 // 1 VPAID 1.0 - APIFrameworkVPAID20 = 2 // 2 VPAID 2.0 - APIFrameworkMRAID1 = 3 // 3 MRAID-1 - APIFrameworkORMMA = 4 // 4 ORMMA - APIFrameworkMRAID2 = 5 // 5 MRAID-2 -) diff --git a/2.3/rtb/app.go b/2.3/rtb/app.go index c278848..10af7d5 100644 --- a/2.3/rtb/app.go +++ b/2.3/rtb/app.go @@ -1,11 +1,5 @@ package rtb -// Indicates if the app has a privacy policy, where 0 = no, 1 = yes. -const ( - AppPrivacyPolicyNo uint8 = 0 // 0 = no - AppPrivacyPolicyYes uint8 = 1 // 1 = yes -) - // 3.2.7 Object: App // // This object should be included if the ad supported content is a non-browser application (typically in diff --git a/2.3/rtb/banner.go b/2.3/rtb/banner.go index a717c09..322d6af 100644 --- a/2.3/rtb/banner.go +++ b/2.3/rtb/banner.go @@ -1,12 +1,5 @@ package rtb -// Indicates if the banner is in the top frame as opposed to an -// iframe, where 0 = no, 1 = yes. -const ( - BannerTopFrameNo uint8 = 0 // 0 = no - BannerTopFrameYes uint8 = 1 // 1 = yes -) - // 3.2.3 Object: Banner // // This object represents the most general type of impression. Although the term “banner” may have very diff --git a/2.3/rtb/banner_ad_types.go b/2.3/rtb/banner_ad_types.go deleted file mode 100644 index 005e90c..0000000 --- a/2.3/rtb/banner_ad_types.go +++ /dev/null @@ -1,12 +0,0 @@ -package rtb - -// 5.2 Banner Ad Types -// -// The following table indicates the types of ads that can be accepted by the exchange unless restricted by -// publisher site settings. -const ( - BannerAdTypeXHTMLText uint8 = 1 // 1 XHTML Text Ad (usually mobile) - BannerAdTypeXHTMLBanner uint8 = 2 // 2 XHTML Banner Ad. (usually mobile) - BannerAdTypeJavaScript uint8 = 3 // 3 JavaScript Ad; must be valid XHTML (i.e., Script Tags Included) - BannerAdTypeIframe uint8 = 4 // 4 iframe -) diff --git a/2.3/rtb/bid_request.go b/2.3/rtb/bid_request.go index bb73ba7..1ca3134 100644 --- a/2.3/rtb/bid_request.go +++ b/2.3/rtb/bid_request.go @@ -1,29 +1,5 @@ package rtb -// Indicator of test mode in which auctions are not billable, where 0 = live mode, 1 = test mode. -const ( - BidRequestTestLive = 0 // 0 = live mode - BidRequestTestTest = 1 // 1 = test mode -) - -// Auction type, where 1 = First Price, 2 = Second Price Plus. -// Exchange-specific auction types can be defined using values -// greater than 500. -const ( - BidRequestATFirstPrice uint8 = 1 // 1 = First Price - BidRequestATSecondPricePlus uint8 = 2 // 2 = Second Price Plus (default) -) - -// Flag to indicate if Exchange can verify that the impressions -// offered represent all of the impressions available in context -// (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. -const ( - BidRequestAllImpsNo uint8 = 0 // 0 = no or unknown - BidRequestAllImpsYes uint8 = 1 // 1 = yes, the impressions offered represent all that are available. -) - // 3.2.1 Object: BidRequest // // The top-level bid request object contains a globally unique bid request or auction ID. This id attribute is diff --git a/2.3/rtb/content.go b/2.3/rtb/content.go index 31cab42..a20c5a9 100644 --- a/2.3/rtb/content.go +++ b/2.3/rtb/content.go @@ -1,24 +1,5 @@ package rtb -// 0 = not live, 1 = content is live (e.g., stream, live blog). -const ( - ContentLiveStreamNo uint8 = 0 // 0 = not live - ContentLiveStreamYes uint8 = 1 // 1 = content is live (e.g., stream, live blog) -) - -// 0 = indirect, 1 = direct. -const ( - ContentSourceRelationshipIndirect uint8 = 0 // 0 = indirect - ContentSourceRelationshipDirect uint8 = 1 // 1 = direct -) - -// Indicator of whether or not the content is embeddable (e.g., -// an embeddable video player), where 0 = no, 1 = yes. -const ( - ContentEmbeddableNo uint8 = 0 // 0 = no - ContentEmbeddableYes uint8 = 1 // 1 = yes -) - // 3.2.9 Object: Content // // This object describes the content in which the impression will appear, which may be syndicated or nonsyndicated diff --git a/2.3/rtb/creative_attributes.go b/2.3/rtb/creative_attributes.go deleted file mode 100644 index a1bab98..0000000 --- a/2.3/rtb/creative_attributes.go +++ /dev/null @@ -1,26 +0,0 @@ -package rtb - -// 5.3 Creative Attributes -// -// The following table specifies a standard list of creative attributes that can describe an ad being served or -// serve as restrictions of thereof. -// -// TODO: review and rename -const ( - CreativeAttributeAudioAutoPlay uint8 = 1 // 1 Audio Ad (Auto-Play) - CreativeAttributeAudioUserInitiated uint8 = 2 // 2 Audio Ad (User Initiated) - CreativeAttributeExpandableAutomatic uint8 = 3 // 3 Expandable (Automatic) - CreativeAttributeExpandableUserInitiatedClick uint8 = 4 // 4 Expandable (User Initiated - Click) - CreativeAttributeExpandableUserInitiatedRollover uint8 = 5 // 5 Expandable (User Initiated - Rollover) - CreativeAttributeInBannerVideoAutoPlay uint8 = 6 // 6 In-Banner Video Ad (Auto-Play) - CreativeAttributeInBannerVideoUserInitiated uint8 = 7 // 7 In-Banner Video Ad (User Initiated) - CreativeAttributePop uint8 = 8 // 8 Pop (e.g., Over, Under, or Upon Exit) - CreativeAttributeProvocative uint8 = 9 // 9 Provocative or Suggestive Imagery - CreativeAttributeExtremeAnimation uint8 = 10 // 10 Shaky, Flashing, Flickering, Extreme Animation, Smileys - CreativeAttributeSurvey uint8 = 11 // 11 Surveys - CreativeAttributeTextOnly uint8 = 12 // 12 Text Only - CreativeAttributeUserInteractive uint8 = 13 // 13 User Interactive (e.g., Embedded Games) - CreativeAttributeNativeStyle uint8 = 14 // 14 Windows Dialog or Alert Style - CreativeAttributeHasAudioOnOffButton uint8 = 15 // 15 Has Audio On/Off Button - CreativeAttributeCanBeSkipped uint8 = 16 // 16 Ad Can be Skipped (e.g., Skip Button on Pre-Roll Video) -) diff --git a/2.3/rtb/deal.go b/2.3/rtb/deal.go index 5e28219..4fbf3bd 100644 --- a/2.3/rtb/deal.go +++ b/2.3/rtb/deal.go @@ -1,14 +1,5 @@ package rtb -// 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. -const ( - DealATFirstPrice uint8 = 1 // 1 = First Price - DealATSecondPricePlus uint8 = 2 // 2 = Second Price Plus - DealATAgreed uint8 = 3 // 3 = the value passed in bidfloor is the agreed upon deal price -) - // 3.2.18 Object: Deal // // This object constitutes a specific deal that was struck a priori between a buyer and a seller. Its presence diff --git a/2.3/rtb/device.go b/2.3/rtb/device.go index a187c3a..cd31505 100644 --- a/2.3/rtb/device.go +++ b/2.3/rtb/device.go @@ -1,26 +1,5 @@ package rtb -// Standard “Do Not Track” flag as set in the header by the -// browser, where 0 = tracking is unrestricted, 1 = do not track. -const ( - DeviceDNTUnrestricted uint8 = 0 // 0 = tracking is unrestricted - DeviceDNT uint8 = 1 // 1 = do not track -) - -// “Limit Ad Tracking” signal commercially endorsed (e.g., iOS, -// Android), where 0 = tracking is unrestricted, 1 = tracking must -// be limited per commercial guidelines. -const ( - DeviceLmtUnrestricted uint8 = 0 // 0 = tracking is unrestricted - DeviceLmtLimited uint8 = 1 // 1 = tracking must be limited per commercial guidelines. -) - -// Support for JavaScript, where 0 = no, 1 = yes. -const ( - DeviceJSNo uint8 = 0 // 0 = no - DeviceJSYes uint8 = 1 // 1 = yes -) - // 3.2.11 Object: Device // // This object provides information pertaining to the device through which the user is interacting. Device diff --git a/2.3/rtb/expandable_direction.go b/2.3/rtb/expandable_direction.go deleted file mode 100644 index c3ab09e..0000000 --- a/2.3/rtb/expandable_direction.go +++ /dev/null @@ -1,13 +0,0 @@ -package rtb - -// 5.5 Expandable Direction -// -// The following table lists the directions in which an expandable ad may expand, given the positioning of -// the ad unit on the page and constraints imposed by the content. -const ( - ExpandableDirectionLeft uint8 = 1 // 1 Left - ExpandableDirectionRight uint8 = 2 // 2 Right - ExpandableDirectionUp uint8 = 3 // 3 Up - ExpandableDirectionDown uint8 = 4 // 4 Down - ExpandableDirectionFullScreen uint8 = 5 // 5 Full Screen -) diff --git a/2.3/rtb/geo.go b/2.3/rtb/geo.go index 3e0725c..a93ef0b 100644 --- a/2.3/rtb/geo.go +++ b/2.3/rtb/geo.go @@ -1,13 +1,5 @@ package rtb -// 5.16 Location Type -// The following table lists the options to indicate how the geographic information was determined. -const ( - GeoTypeGPS uint8 = 1 // 1 GPS/Location Services - GeoTypeIP uint8 = 2 // 2 IP Address - GeoTypeUserProvided uint8 = 3 // 3 User provided (e.g., registration data) -) - // 3.2.12 Object: Geo // // This object encapsulates various methods for specifying a geographic location. When subordinate to a diff --git a/2.3/rtb/imp.go b/2.3/rtb/imp.go index aae5806..f76f125 100644 --- a/2.3/rtb/imp.go +++ b/2.3/rtb/imp.go @@ -1,20 +1,5 @@ package rtb -// 1 = the ad is interstitial or full screen, 0 = not interstitial. -const ( - ImpInstlNo uint8 = 0 // 0 = not interstitial - ImpInstlYes uint8 = 1 // 1 = the ad is interstitial or full screen -) - -// Flag to indicate if the impression requires secure HTTPS URL -// 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. -const ( - ImpSecureNo uint8 = 0 // 0 = non-secure - ImpSecureYes uint8 = 1 // 1 = secure -) - // 3.2.2 Object: Imp // // This object describes an ad placement or impression being auctioned. A single bid request can include diff --git a/2.3/rtb/pmp.go b/2.3/rtb/pmp.go index 04c78b5..d70fcc8 100644 --- a/2.3/rtb/pmp.go +++ b/2.3/rtb/pmp.go @@ -1,12 +1,5 @@ package rtb -// 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. -const ( - PMPPrivateAuctionUnrestricted uint8 = 0 // 0 = all bids are accepted - PMPPrivateAuctionRestricted uint8 = 1 // 1 = bids are restricted to the deals specified and the terms thereof -) - // 3.2.17 Object: Pmp // // This object is the private marketplace container for direct deals between buyers and sellers that may pertain diff --git a/2.3/rtb/regs.go b/2.3/rtb/regs.go index a795584..0bbc580 100644 --- a/2.3/rtb/regs.go +++ b/2.3/rtb/regs.go @@ -1,12 +1,5 @@ package rtb -// Flag indicating if this request is subject to the COPPA -// regulations established by the USA FTC, where 0 = no, 1 = yes. -const ( - RegsCOPPANo int8 = 0 // 0 = no - RegsCOPPAYes int8 = 1 // 1 = yes -) - // 3.2.16 Object: Regs // // This object contains any legal, governmental, or industry regulations that apply to the request. The coppa flag diff --git a/2.3/rtb/rtb.go b/2.3/rtb/rtb.go index 4b38dea..d6fff70 100644 --- a/2.3/rtb/rtb.go +++ b/2.3/rtb/rtb.go @@ -1,4 +1,4 @@ -// rtb package provides common OpenRTB's Object types and constants, +// rtb package provides common OpenRTB's Object types, // according to OpenRTB API Specification Version 2.3: // http://openrtb.github.io/OpenRTB/ package rtb diff --git a/2.3/rtb/seat_bid.go b/2.3/rtb/seat_bid.go index e1fc81b..4b7bf82 100644 --- a/2.3/rtb/seat_bid.go +++ b/2.3/rtb/seat_bid.go @@ -1,12 +1,5 @@ package rtb -// 0 = impressions can be won individually; 1 = impressions must -// be won or lost as a group. -const ( - SeatBidGroupNo uint8 = 0 // 0 = impressions can be won individually - SeatBidGroupYes uint8 = 1 // 1 = impressions must be won or lost as a group -) - // 4.2.2 Object: SeatBid // // A bid response can contain multiple SeatBid objects, each on behalf of a different bidder seat and each diff --git a/2.3/rtb/site.go b/2.3/rtb/site.go index fbcf97e..411c089 100644 --- a/2.3/rtb/site.go +++ b/2.3/rtb/site.go @@ -1,17 +1,5 @@ package rtb -// Mobile-optimized signal, where 0 = no, 1 = yes. -const ( - SiteMobileNo uint8 = 0 // 0 = no - SiteMobileYes uint8 = 1 // 1 = yes -) - -// Indicates if the site has a privacy policy, where 0 = no, 1 = yes. -const ( - SitePrivacyPolicyNo uint8 = 0 // 0 = no - SitePrivacyPolicyYes uint8 = 1 // 1 = yes -) - // 3.2.6 Object: Site // // This object should be included if the ad supported content is a website as opposed to a non-browser diff --git a/2.3/rtb/user.go b/2.3/rtb/user.go index 36b5abe..2fcfc22 100644 --- a/2.3/rtb/user.go +++ b/2.3/rtb/user.go @@ -1,14 +1,5 @@ package rtb -// Gender, where “M” = male, “F” = female, “O” = known to be -// other (i.e., omitted is unknown). -const ( - UserGenderMale string = "M" // “M” = male - UserGenderFemale string = "F" // “F” = female - UserGenderOther string = "O" // “O” = known to be other - UserGenderUnknown string = "" // omitted is unknown -) - // 3.2.13 Object: User // // This object contains information known or derived about the human user of the device (i.e., the diff --git a/2.3/rtb/video.go b/2.3/rtb/video.go index 9f04894..512b670 100644 --- a/2.3/rtb/video.go +++ b/2.3/rtb/video.go @@ -1,22 +1,5 @@ package rtb -// Maximum extended video ad duration if extension is allowed. -// If blank or 0, extension is not allowed. If -1, extension is -// allowed, and there is no time limit imposed. If greater than 0, -// then the value represents the number of seconds of extended -// play supported beyond the maxduration value. -const ( - VideoMaxExtendedUnlimited int64 = -1 // If -1, extension is allowed, and there is no time limit imposed - VideoMaxExtendedNotAllowed int64 = 0 // If blank or 0, extension is not allowed -) - -// Indicates if letter-boxing of 4:3 content into a 16:9 window is -// allowed, where 0 = no, 1 = yes. -const ( - VideoBoxingAllowedNo uint8 = 0 // 0 = no - VideoBoxingAllowedYes uint8 = 1 // 1 = yes -) - // 3.2.4 Object: Video // // This object represents an in-stream video impression. Many of the fields are non-essential for minimally diff --git a/2.3/rtb/video_bid_response_protocols.go b/2.3/rtb/video_bid_response_protocols.go deleted file mode 100644 index 545bdc0..0000000 --- a/2.3/rtb/video_bid_response_protocols.go +++ /dev/null @@ -1,14 +0,0 @@ -package rtb - -// 5.8 Video Bid Response Protocols -// -// The following table lists the options for video bid response protocols that could be supported by an -// exchange. -const ( - VideoBidResponseProtocolVAST10 uint8 = 1 // 1 VAST 1.0 - VideoBidResponseProtocolVAST20 uint8 = 2 // 2 VAST 2.0 - VideoBidResponseProtocolVAST30 uint8 = 3 // 3 VAST 3.0 - VideoBidResponseProtocolVAST10Wrapper uint8 = 4 // 1 VAST 1.0 Wrapper - VideoBidResponseProtocolVAST20Wrapper uint8 = 5 // 2 VAST 2.0 Wrapper - VideoBidResponseProtocolVAST30Wrapper uint8 = 6 // 3 VAST 3.0 Wrapper -) diff --git a/2.3/rtb/video_linearity.go b/2.3/rtb/video_linearity.go deleted file mode 100644 index 3ec0f3f..0000000 --- a/2.3/rtb/video_linearity.go +++ /dev/null @@ -1,19 +0,0 @@ -package rtb - -// 5.7 Video Linearity -// -// The following table indicates the options for video linearity. “In-stream” or “linear” video refers to preroll, -// post-roll, or mid-roll video ads where the user is forced to watch ad in order to see the video -// content. “Overlay” or “non-linear” refer to ads that are shown on top of the video content. -// -// This field is optional. The following is the interpretation of the bidder based upon the presence or -// absence of the field in the bid request: -// - If no value is set, any ad (linear or not) can be present in the response. -// - If a value is set, only ads of the corresponding type can be present in the response. -// -// Note to the reader: This OpenRTB table has values derived from the IAB Quality Assurance Guidelines -// (QAG). Practitioners should keep in sync with updates to the QAG values as published on IAB.net. -const ( - VideoLinearityLinear = 1 // 1 Linear / In-Stream - VideoLinearityNonLinear = 2 // 2 Non-Linear / Overlay -) diff --git a/2.3/rtb/video_playback_methods.go b/2.3/rtb/video_playback_methods.go deleted file mode 100644 index 0233e59..0000000 --- a/2.3/rtb/video_playback_methods.go +++ /dev/null @@ -1,11 +0,0 @@ -package rtb - -// 5.9 Video Playback Methods -// -// The following table lists the various video playback methods. -const ( - VideoPlaybackMethodAutoPlaySoundOn uint8 = 1 // 1 Auto-Play Sound On - VideoPlaybackMethodAutoPlaySoundOff uint8 = 2 // 2 Auto-Play Sound Off - VideoPlaybackMethodClickToPlay uint8 = 3 // 3 Click-to-Play - VideoPlaybackMethodMouseOver uint8 = 4 // 4 Mouse-Over -) diff --git a/2.3/rtb/video_quality.go b/2.3/rtb/video_quality.go deleted file mode 100644 index fbdbbd8..0000000 --- a/2.3/rtb/video_quality.go +++ /dev/null @@ -1,12 +0,0 @@ -package rtb - -// 5.11 Video Quality -// -// The following table lists the options for the video quality. These values are defined by the IAB – -// http://www.iab.net/media/file/long-form-video-final.pdf. -const ( - VideoQualityUnknown uint8 = 0 // 0 Unknown - VideoQualityProfessionallyProduced uint8 = 1 // 1 Professionally Produced - VideoQualityProsumer uint8 = 2 // 2 Prosumer - VideoQualityUserGenerated uint8 = 3 // 3 User Generated (UGC) -) diff --git a/2.3/rtb/video_start_delay.go b/2.3/rtb/video_start_delay.go deleted file mode 100644 index 5a3b19f..0000000 --- a/2.3/rtb/video_start_delay.go +++ /dev/null @@ -1,12 +0,0 @@ -package rtb - -// 5.10 Video Start Delay -// -// The following table lists the various options for the video start delay. If the start delay value is greater -// than 0, then the position is mid-roll and the value indicates the start delay. -const ( - // > 0 Mid-Roll (value indicates start delay in second) - VideoStartDelayPreRoll int64 = 0 // 0 Pre-Roll - VideoStartDelayGenericMidRoll int64 = -1 // -1 Generic Mid-Roll - VideoStartDelayGenericPostRoll int64 = -2 // -2 Generic Post-Roll -) diff --git a/README.md b/README.md index 2fba09b..89b6f47 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![GoDoc](https://godoc.org/github.com/mxmCherry/go-rtb/2.3/rtb?status.svg)](https://godoc.org/github.com/mxmCherry/go-rtb/2.3/rtb) -Common [OpenRTB](//github.com/openrtb/OpenRTB) [v2.3](//github.com/openrtb/OpenRTB/blob/master/OpenRTB-API-Specification-Version-2-3-FINAL.pdf) Object types and constants for Go programming language +Common [OpenRTB](//github.com/openrtb/OpenRTB) [v2.3](//github.com/openrtb/OpenRTB/blob/master/OpenRTB-API-Specification-Version-2-3-FINAL.pdf) Object types for Go programming language **Warning!** Currently, this package is quite unstable (types and names may change). Also, even after v1.0 this repo will contain only recent version (v1+). So, if you need to use this code in production, take a look on [godep](//github.com/tools/godep). @@ -31,32 +31,10 @@ Common [OpenRTB](//github.com/openrtb/OpenRTB) [v2.3](//github.com/openrtb/OpenR - [x] 4.2.1 Object: BidResponse - [x] 4.2.2 Object: SeatBid - [x] 4.2.3 Object: Bid -- [ ] 5. Enumerated Lists Specification - - [ ] 5.1 Content Categories - - [x] 5.2 Banner Ad Types - - [x] 5.3 Creative Attributes - - [x] 5.4 Ad Position - - [x] 5.5 Expandable Direction - - [x] 5.6 API Frameworks - - [x] 5.7 Video Linearity - - [x] 5.8 Video Bid Response Protocols - - [x] 5.9 Video Playback Methods - - [x] 5.10 Video Start Delay - - [x] 5.11 Video Quality - - [ ] 5.12 VAST Companion Types - - [ ] 5.13 Content Delivery Methods - - [ ] 5.14 Content Context - - [ ] 5.15 QAG Media Ratings - - [ ] 5.16 Location Type - - [ ] 5.17 Device Type - - [ ] 5.18 Connection Type - - [ ] 5.19 No-Bid Reason Codes - [ ] Code quality/review - - [ ] Review constants for section "5. Enumerated Lists Specification" - [ ] Review struct key types, which refer to section "5. Enumerated Lists Specification" - [ ] Check types for struct keys (see Guidelines - Types) - [ ] Use struct pointers for optional keys (e.g., App.Content) - - [ ] Review and rename constants for types, if needed (see Guidelines - Naming convention) - [ ] Add json directive "omitempty" for optional keys @@ -66,7 +44,6 @@ Common [OpenRTB](//github.com/openrtb/OpenRTB) [v2.3](//github.com/openrtb/OpenR - [UpperCamelCase](http://en.wikipedia.org/wiki/CamelCase) - Capitalized abbreviations (e.g., AT, COPPA, PMP etc.) - Capitalized ID keys -- Constants are named after type and key like ```TypeName``` + ```KeyName``` + ```ValueDescription```, e.g., constant for ```type BidRequest``` with key ```AT``` will look like ```const BidRequestATFirstPrice``` ## Types - Key types should be chosen according to OpenRTB specification (attribute types) @@ -78,11 +55,10 @@ Common [OpenRTB](//github.com/openrtb/OpenRTB) [v2.3](//github.com/openrtb/OpenR ## Documentation - [Godoc: documenting Go code](http://blog.golang.org/godoc-documenting-go-code) -- Each entity (type, constant or struct key) should be documented +- Each entity (type or struct key) should be documented - Comments for entities should be copy-pasted "as-is" from OpenRTB specification -- For struct keys, section "Notes" may be added at the very bottom of key comment - it may contain some recommendations for developers (constants reference etc.) ## Code organization -- Each RTB type and its related constants should be kept in its own file, named after type +- Each RTB type should be kept in its own file, named after type - File names are in underscore_case, e.g., ```type BidRequest``` should be declared in ```bid_request.go``` - [go fmt your code](https://blog.golang.org/go-fmt-your-code)