Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bsm/openrtb

OpenRTB protocol defintions for Go
https://github.com/bsm/openrtb

adtech go openrtb rtb

Last synced: about 2 months ago
JSON representation

OpenRTB protocol defintions for Go

Awesome Lists containing this project

README

        

# OpenRTB

[![Build Status](https://travis-ci.org/bsm/openrtb.svg?branch=master)](https://travis-ci.org/bsm/openrtb)

OpenRTB structs and validations for Go.

## Requirements

Requires Go 1.8+ for proper `json.RawMessage` marshaling.

## Installation

To install, use `go get`:

```shell
go get github.com/bsm/openrtb/v3
```

## Usage

```go
package main

import (
"log"
"github.com/bsm/openrtb/v3"
)

func main() {
file, err := os.Open("stored.json")
if err != nil {
log.Fatal(err)
}
defer file.Close()

var req *openrtb.BidRequest
if err := json.NewDecoder(file).Decode(&req); err != nil {
log.Fatal(err)
}

log.Printf("%+v\n", req)
}
```