Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rp added rwdd #125

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default: test

.minimal.makefile:
curl -fsSL -o $@ https://gitlab.com/bsm/misc/raw/master/make/go/minimal.makefile
curl -fsSL -o $@ https://gitlab.com/arpeely/misc/raw/master/make/go/minimal.makefile

include .minimal.makefile
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenRTB

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

OpenRTB structs and validations for Go.

Expand All @@ -13,7 +13,7 @@ Requires Go 1.8+ for proper `json.RawMessage` marshaling.
To install, use `go get`:

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

## Usage
Expand All @@ -23,7 +23,7 @@ package main

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

func main() {
Expand Down
2 changes: 1 addition & 1 deletion audio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestAudio(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion banner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestBanner(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion bid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestBid(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion bidrequest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestBidRequest(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion bidresponse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestBidResponse(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion content_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestContent(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion device_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestDevice(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module github.com/bsm/openrtb/v3
module github.com/arpeely/openrtb/v3

go 1.13

require github.com/json-iterator/go v1.1.12
15 changes: 15 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
20 changes: 17 additions & 3 deletions impression.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package openrtb
import (
"encoding/json"
"errors"

jsoniter "github.com/json-iterator/go"
)

// Validation errors
Expand Down Expand Up @@ -32,10 +34,22 @@ type Impression struct {
BidFloor float64 `json:"bidfloor,omitempty"` // Bid floor for this impression in CPM
BidFloorCurrency string `json:"bidfloorcur,omitempty"` // Currency of bid floor
Secure NumberOrString `json:"secure,omitempty"` // Flag to indicate whether the impression requires secure HTTPS URL creative assets and markup.
Quantity *Quantity `json:"qty,omitempty"` // Includes the impression multiplier, and describes its source.
Exp int `json:"exp,omitempty"` // Advisory as to the number of seconds that may elapse between the auction and the actual impression.
IFrameBusters []string `json:"iframebuster,omitempty"` // Array of names for supportediframe busters.
Quantity *Quantity `json:"qty,omitempty"` // Includes the impression multiplier, and describes its source.
Exp int `json:"exp,omitempty"` // Advisory as to the number of seconds that may elapse between the auction and the actual impression.
IFrameBusters []string `json:"iframebuster,omitempty"` // Array of names for supportediframe busters.
Ext json.RawMessage `json:"ext,omitempty"`
Metric []Metric `json:"metric,omitempty"`
ClickBrowser int `json:"clickbrowser,omitempty"`
Rwdd int `json:"rwdd,omitempty"`
}

type MetricType string

type Metric struct {
Type MetricType `json:"type,omitempty"`
Value float32 `json:"value"` // We don't want to use "omitempty" here because the real value could be 0
Vendor string `json:"vendor,omitempty"`
Ext jsoniter.RawMessage `json:"ext,omitempty"`
}

func (imp *Impression) assetCount() int {
Expand Down
2 changes: 1 addition & 1 deletion impression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestImpression(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestApp(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions native/request/request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"reflect"
"testing"

"github.com/bsm/openrtb/v3"
. "github.com/bsm/openrtb/v3/native/request"
"github.com/arpeely/openrtb/v3"
. "github.com/arpeely/openrtb/v3/native/request"
)

func TestRequest(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion native/request/video.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package request
import (
"encoding/json"

"github.com/bsm/openrtb/v3"
"github.com/arpeely/openrtb/v3"
)

// Video is the native video object.
Expand Down
2 changes: 1 addition & 1 deletion native/response/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package response
import (
"encoding/json"

"github.com/bsm/openrtb/v3"
"github.com/arpeely/openrtb/v3"
)

// Response is the native object is the top level JSON object which identifies a native response.
Expand Down
2 changes: 1 addition & 1 deletion native/response/response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3/native/response"
. "github.com/arpeely/openrtb/v3/native/response"
)

func TestResponse(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestNative(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion numbers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestNumberOrString(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pmp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestPMP(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion quantity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestQuantity(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion seatbid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestSeatBid_Validate(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestSource(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions video.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type Video struct {
Placement VideoPlacement `json:"placement,omitempty"` // Video placement type, DEPRECATED
Plcmt VideoPlcmt `json:"plcmt,omitempty"` // Video Plcmt type ad defined in ADCOM1.0
Ext json.RawMessage `json:"ext,omitempty"`
MaxSequence int `json:"maxseq,omitempty"` // Indicates the maximum number of ads that may be served into a “dynamic” video ad pod
}

type jsonVideo Video
Expand Down
2 changes: 1 addition & 1 deletion video_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"reflect"
"testing"

. "github.com/bsm/openrtb/v3"
. "github.com/arpeely/openrtb/v3"
)

func TestVideo(t *testing.T) {
Expand Down