OpenRTB v2.3.1 types for Go programming language (golang)
Go
Latest commit e6a227e Jan 20, 2017 @mxmCherry committed on GitHub Updated Readme - added TODO section
Permalink
Failed to load latest commit information.
testdata Added simple tests (JSON marshalling); deprecated User.BuyerID proper… Jul 30, 2016
LICENSE Initial commit Apr 28, 2015
README.md Updated Readme - added TODO section Jan 19, 2017
app.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
banner.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
bid.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
bid_request.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
bid_response.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
content.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
data.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
deal.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
device.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
geo.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
imp.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
native.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
openrtb_test.go Added simple tests (JSON marshalling); deprecated User.BuyerID proper… Jul 30, 2016
pmp.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
producer.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
publisher.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
raw_json.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
raw_json_test.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
regs.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
rtb.go Migrate to github.com/mxmCherry/openrtb, update docs (README) Apr 6, 2016
seat_bid.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
segment.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
site.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
user.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017
video.go Use RawJSON type for Ext instead of interface{} Jan 19, 2017

README.md

openrtb

GoDoc

OpenRTB v2.3.1 types for Go programming language (golang)

Warning! Using glide is recommended to vendor specific commit hash.

Using

go get -u "gopkg.in/mxmCherry/openrtb.v3"
import "gopkg.in/mxmCherry/openrtb.v3"

Goals

Provide base for OpenRTB-related projects, focusing on:

  • Extensive documentation
  • Strict specification (using unsigned numeric types for values, that are not meant to be signed; don't overuse pointers to avoid nil dereferencing etc.)
  • Efficient memory usage (using numeric types large enough just to hold intended values etc.)

Guidelines

Naming convention

  • UpperCamelCase
  • Capitalized abbreviations (e.g., AT, COPPA, PMP etc.)
  • Capitalized ID keys

Types

  • Key types should be chosen according to OpenRTB v2.3.1 specification (attribute types)
  • Numeric types:
    • architecture-independent, e.g., int32 instead of int
    • signed integral types should be used only when absolutely needed (value may contain negative numbers), unsigned integral types are preferred
    • but avoid uint8 as it has problems with JSON serialization
    • enumerations should be represented with minimal integral types, e.g., int8 for enumerations with <= 256 variants
    • for floating-point attributes only float64 type should be used

Documentation

  • Godoc: documenting Go code
  • Each entity (type or struct key) should be documented
  • Comments for entities should be copy-pasted "as-is" from OpenRTB specification

Code organization

  • 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

TODO

  • OpenRTB 2.5 compliance (specs)
  • Review time/duration types, use int64 for easier time conversion (requires major version bump)
  • Review enum types (some experiments are in next branch)