2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:26:05 +03:00
2015-04-28 20:07:07 +03:00
2017-06-25 12:26:05 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:26:05 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:03:32 +03:00
2017-06-25 12:26:05 +03:00
2017-06-25 12:03:32 +03:00

openrtb GoDoc Build Status

OpenRTB v2.5 types for Go programming language (Golang)

Using

go get -u "github.com/mxmCherry/openrtb"
import "github.com/mxmCherry/openrtb"

This repo follows semver - see releases. Master always contains latest code, so better use some package manager to vendor specific version.

Guidelines

Naming convention

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

Types

  • Key types should be chosen according to OpenRTB specification (attribute types)
  • Numeric types:
    • int64 - time, duration, unbound enums (like BidRequest.at - exchange-specific auctions types are > 500)
    • int8 - short enums (with values <= 127), boolean-like attributes (like BidRequest.test)
    • uint64 - width, height, bitrate etc. (unbound positive numbers)
    • float64 - coordinates, prices etc.

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 (including line-breaks - think less)

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

  • Review all integral types, probably, switch everything to signed ones or just to int?
  • Consider switching back to encoding/json.RawMessage, as Go 1.8 fixed serialisation for non-ptr (probably, when Go 1.9 or even 1.10 is out)
  • Review enum types (typed enum attributes + constants)
S
Description
Go (Golang) OpenRTB 2.x, 3.0 / AdCOM 1.0 / Native 1.2 types/enums
Readme 913 KiB
Languages
Go 100%