direct

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package direct implements the OpenRTB bid response item for direct (click URL) ad formats. Direct ads deliver a click-through URL rather than full creative markup; the system renders an iframe or redirect wrapper around that URL.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAdContent = errors.New("invalid ad content")

ErrInvalidAdContent is returned when the ad markup cannot be resolved to a direct link.

Functions

This section is empty.

Types

type ResponseBidItem

type ResponseBidItem struct {
	common.BaseBidItem
	DirectLink string `json:"action_link,omitempty"`
}

ResponseBidItem is the bid response item for direct ad formats. It implements adtype.ResponseItem and contains the resolved click-through URL together with pricing and tracking information.

func New

New creates a ResponseBidItem for a direct bid. It resolves the ad markup to a click-through URL, returning ErrInvalidAdContent when only an image URL is found (which is not a valid direct link).

func (*ResponseBidItem) ActionURL

func (it *ResponseBidItem) ActionURL() string

ActionURL returns the resolved direct click-through URL.

func (*ResponseBidItem) ContentFields

func (it *ResponseBidItem) ContentFields() map[string]any

ContentFields returns a map of all populated content fields (nil for direct format).

func (*ResponseBidItem) ContentItem

func (it *ResponseBidItem) ContentItem(name string) any

ContentItem returns the ad response data for the given field name.

func (*ResponseBidItem) ContentItemString

func (it *ResponseBidItem) ContentItemString(name string) string

ContentItemString returns the string value of a named content field.

func (*ResponseBidItem) IsDirect

func (it *ResponseBidItem) IsDirect() bool

IsDirect always returns true for direct bid items.

func (*ResponseBidItem) PriorityFormatType

func (it *ResponseBidItem) PriorityFormatType() types.FormatType

PriorityFormatType always returns FormatDirectType for direct bid items.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL