Skip to content

MehrazRumman/gortb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoRTB ( OpenRTB 2.5 )

Go Reference Go Test

GoRTB is a Go implementation of the OpenRTB (Real-Time Bidding) 2.5 specification. This library provides a robust and type-safe way to work with OpenRTB requests and responses in your Go applications.

Go Version Support

GoRTB supports Go versions 1.13 and later.

Features

  • Full implementation of OpenRTB 2.5 specification
  • Type-safe bid request and response handling
  • Easy-to-use API for both bidders and exchanges
  • Comprehensive validation of RTB objects
  • High performance JSON serialization/deserialization
  • Extensible architecture for custom implementations

Installation

To install GoRTB, use go get:

go get github.com/MehrazRumman/gortb

Quick Start

Here's a simple example of how to create a bid request:

package main

import (
    "fmt"
    "github.com/MehrazRumman/gortb"
)

func main() {
    // Create a new bid request
    bidRequest := &gortb.BidRequest{
        ID: "bid-req-1",
        Imp: []gortb.Impression{{
            ID: "imp-1",
            Banner: &gortb.Banner{
                W: 300,
                H: 250,
            },
        }},
    }

    // Convert to JSON
    json, err := bidRequest.Marshal()
    if err != nil {
        panic(err)
    }

    fmt.Printf("Bid Request: %s\n", string(json))
}

Documentation

For detailed documentation and examples, please visit our Go Package Documentation.

Main Components

  • BidRequest: Represents an OpenRTB bid request
  • BidResponse: Represents an OpenRTB bid response
  • Impression: Describes an ad impression opportunity
  • Bid: Contains bid information
  • Various objects for different ad types (Banner, Video, Native, etc.)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any issues or have questions, please file an issue on the GitHub issue tracker.

Acknowledgments

  • OpenRTB 2.5 Specification
  • The Go community for their valuable feedback and contributions

Version

Current version: v1.0.0