Giter Club home page Giter Club logo

openrtb-1's Introduction

openrtb

GoDoc

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

Using

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

History

  • Forked on April 23, 2017 from mxmCherry
  • Updated Device, Geo to OpenRTB 2.5

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.5 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)

openrtb-1's People

Contributors

mxmcherry avatar bokelley avatar grudzinski avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.