mirror of
https://github.com/prebid/openrtb.git
synced 2026-06-16 06:56:34 +03:00
42b75f5b93a94146cf9a67d9c17fbc6ffa16b367
go-rtb
OpenRTB v2.3 types for Go programming language (golang)
Warning! This package is considered unstable, consider using glide for vendoring specific version (commit hash).
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 specification (attribute types)
- Numeric types:
- architecture-independent, e.g.,
int32instead ofint - signed integral types should be used only when absolutely needed (value may contain negative numbers), unsigned integral types are preferred
- enumerations should be represented with minimal integral types, e.g.,
uint8orint8for enumerations with <= 256 variants - for floating-point attributes only
float64type should be used
- architecture-independent, e.g.,
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 BidRequestshould be declared inbid_request.go - go fmt your code
Languages
Go
100%