OpenRTB structs and validations for Go.
Requires Go 1.8+ for proper json.RawMessage
marshaling.
To install, use go get
:
go get github.com/bsm/openrtb/v3
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)
}