vast

package
v11.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ad struct {
	Id       string   `xml:"id,attr,omitempty"`       // Id of the ad, defined by ad server. Required in VAST2.0.
	Sequence int      `xml:"sequence,attr,omitempty"` // Sequence number in which an ad should play. VAST3.0.
	InLine   *InLine  `xml:",omitempty"`
	Wrapper  *Wrapper `xml:",omitempty"`
}

type AdParameters

type AdParameters struct {
	Parameters   TrimmedData `xml:",cdata"`
	IsXmlEncoded bool        `xml:"xmlEncoded,attr,omitempty"` // VAST3.0.
}

type AdSystem

type AdSystem struct {
	Version string `xml:"version,attr,omitempty"`
	System  string `xml:",chardata"`
}

type Companion

type Companion struct {
	Id             string          `xml:"id,attr,omitempty"`
	Width          int             `xml:"width,attr"`       // Required.
	Height         int             `xml:"height,attr"`      // Required.
	AssetWidth     int             `xml:"assetWidth,attr"`  // VAST3.0.
	AssetHeight    int             `xml:"assetHeight,attr"` // VAST3.0.
	ExpandedWidth  int             `xml:"expandedWidth,attr,omitempty"`
	ExpandedHeight int             `xml:"expandedHeight,attr,omitempty"`
	ApiFramework   string          `xml:"apiFramework,attr,omitempty"`
	AdSlotId       string          `xml:"adSlotId,attr,omitempty"` // VAST3.0.
	ClickThrough   string          `xml:"CompanionClickThrough,omitempty"`
	ClickTracking  string          `xml:"CompanionClickTracking,omitempty"` // VAST3.0.
	AltText        string          `xml:"AltText,omitempty"`
	Trackings      []*Tracking     `xml:"TrackingEvents>Tracking,omitempty"` // Required tracking: EVENT_CREATIVE_VIEW
	AdParameters   *AdParameters   `xml:"AdParameters,omitempty"`            // Just string in VAST2.0.
	StaticResource *StaticResource `xml:"StaticResource,omitempty"`
	IFrameResource string          `xml:"IFrameResource,omitempty"`
	HtmlResource   *HtmlResource   `xml:"HTMLResource,omitempty"`                         // Just string in VAST2.0.
	Extensions     []*Extension    `xml:"CreativeExtensions>CreativeExtension,omitempty"` // VAST3.0.
}

type CompanionAds

type CompanionAds struct {
	Required   Mode         `xml:"required,attr,omitempty"` // VAST3.0.
	Companions []*Companion `xml:"Companion,omitempty"`
}

type CompanionAdsWrapper

type CompanionAdsWrapper struct {
	Required   Mode                `xml:"required,attr,omitempty"` // VAST3.0.
	Companions []*CompanionWrapper `xml:"Companion,omitempty"`
}

type CompanionWrapper

type CompanionWrapper struct {
	Id             string          `xml:"id,attr,omitempty"`
	Width          int             `xml:"width,attr"`       // Required.
	Height         int             `xml:"height,attr"`      // Required.
	AssetWidth     int             `xml:"assetWidth,attr"`  // VAST3.0.
	AssetHeight    int             `xml:"assetHeight,attr"` // VAST3.0.
	ExpandedWidth  int             `xml:"expandedWidth,attr"`
	ExpandedHeight int             `xml:"expandedHeight,attr"`
	ApiFramework   string          `xml:"apiFramework,attr,omitempty"`
	AdSlotId       string          `xml:"adSlotId,attr,omitempty"` // VAST3.0.
	ClickThrough   string          `xml:"CompanionClickThrough,omitempty"`
	ClickTrackings []string        `xml:"CompanionClickTracking,omitempty"` // VAST3.0.
	AltText        string          `xml:"AltText,omitempty"`
	Trackings      []*Tracking     `xml:"TrackingEvents>Tracking,omitempty"`
	AdParameters   *AdParameters   `xml:"AdParameters,omitempty"` // Just a string in VAST2.0.
	StaticResource *StaticResource `xml:"StaticResource,omitempty"`
	IFrameResource string          `xml:"IFrameResource,omitempty"`
	HtmlResource   *HtmlResource   `xml:"HTMLResource,omitempty"`                         // Just a string in VAST2.0.
	Extensions     []*Extension    `xml:"CreativeExtensions>CreativeExtension,omitempty"` // VAST3.0.
}

type Creative

type Creative struct {
	Id           string        `xml:"id,attr,omitempty"`           // ID of the creative defined by the ad server.
	Sequence     int           `xml:"sequence,attr,omitempty"`     // Sequence number in which the creative should be displayed.
	AdId         string        `xml:"AdID,attr,omitempty"`         // Id of ad associated with the creative.
	ApiFramework string        `xml:"apiFramework,attr,omitempty"` // Ad serving API used. VAST3.0.
	Linear       *Linear       `xml:"Linear,omitempty"`
	CompanionAds *CompanionAds `xml:"CompanionAds,omitempty"`
	NonLinearAds *NonLinearAds `xml:"NonLinearAds,omitempty"`
}

type CreativeWrapper

type CreativeWrapper struct {
	Id           string               `xml:"id,attr,omitempty"`
	Sequence     int                  `xml:"sequence,attr,omitempty"`
	AdId         string               `xml:"AdID,attr,omitempty"`
	Linear       *LinearWrapper       `xml:"Linear,omitempty"`
	CompanionAds *CompanionAdsWrapper `xml:"CompanionAds,omitempty"`
	NonLinearAds *NonLinearAdsWrapper `xml:"NonLinearAds,omitempty"`
}

type Delivery

type Delivery string
const (
	DELIVERY_STREAMING   Delivery = "streaming"
	DELIVERY_PROGRESSIVE Delivery = "progressive"
)

type Duration

type Duration time.Duration

type Event

type Event string
const (
	EVENT_CREATIVE_VIEW     Event = "creativeView"
	EVENT_START             Event = "start"
	EVENT_FIRST_QUARTILE    Event = "firstQuartile"
	EVENT_MIDPOINT          Event = "midpoint"
	EVENT_THIRD_QUARTILE    Event = "thirdQuartile"
	EVENT_COMPLETE          Event = "complete"
	EVENT_MUTE              Event = "mute"
	EVENT_UNMUTE            Event = "unmute"
	EVENT_PAUSE             Event = "pause"
	EVENT_REWIND            Event = "rewind"
	EVENT_RESUME            Event = "resume"
	EVENT_FULLSCREEN        Event = "fullscreen"
	EVENT_EXIT_FULLSCREEN   Event = "exitFullscreen" //VAST3.0.
	EVENT_EXPAND            Event = "expand"
	EVENT_COLLAPSE          Event = "collapse"
	EVENT_ACCEPT_INVITATION Event = "acceptInvitation"
	EVENT_CLOSE             Event = "close"
	EVENT_SKIP              Event = "skip"     // VAST3.0.
	EVENT_PROGRESS          Event = "progress" // VAST3.0.
)

type Extension

type Extension struct {
	Data []byte `xml:",innerxml"`
}

type HtmlResource

type HtmlResource struct {
	Html         TrimmedData `xml:",cdata"`
	IsXmlEncoded bool        `xml:"xmlEncoded,attr,omitempty"`
}

type Icon

type Icon struct {
	Program        string          `xml:"program,attr"` // Name of the industry initiatives.
	Width          int             `xml:"width,attr"`
	Height         int             `xml:"height,attr"`
	XPosition      string          `xml:"xPosition,attr"`              // Horizontal alignment in format of ([0-9]*|left|right).
	YPosition      string          `xml:"yPosition,attr"`              // Vertical alignment in format of ([0-9]*|top|bottom).
	Duration       Duration        `xml:"duration,attr"`               // Duration for which the icon must be displayed.
	ApiFramework   string          `xml:"apiFramework,attr,omitempty"` // API used to interact with the icon.
	Offset         Offset          `xml:"offset,attr"`                 // Time delay from which the icon should be displayed.
	ClickThrough   string          `xml:"IconClicks>IconClickThrough,omitempty"`
	ClickTrackings []string        `xml:"IconClicks>IconClickTracking,omitempty"`
	StaticResource *StaticResource `xml:"StaticResource,omitempty"`
	IFrameResource string          `xml:"IFrameResource,omitempty"` // URL of the <iframe> to display the companion element.
	HtmlResource   *HtmlResource   `xml:"HTMLResource,omitempty"`
}

type Impression

type Impression struct {
	Id  string      `xml:"id,attr,omitempty"`
	Uri TrimmedData `xml:",cdata"`
}

type InLine

type InLine struct {
	AdSystem    *AdSystem     `xml:"AdSystem"`           // Required.
	AdTitle     *string       `xml:"AdTitle"`            // Required.
	Impressions []*Impression `xml:"Impression"`         // Required.
	Creatives   []*Creative   `xml:"Creatives>Creative"` // Creatives node is required.
	Description string        `xml:"Description,omitempty"`
	Advertiser  string        `xml:"Advertiser,omitempty"` // VAST3.0.
	SurveyUrl   string        `xml:"Survey,omitempty"`
	Errors      []string      `xml:"Error,omitempty"`
	Pricing     *Pricing      `xml:"Pricing,omitempty"` // VAST3.0.
	Extensions  []*Extension  `xml:"Extensions>Extension,omitempty"`
}

type Linear

type Linear struct {
	SkipOffset   *Offset       `xml:"skipoffset,attr,omitempty"`
	Duration     Duration      `xml:"Duration"`               // Required.
	AdParameters *AdParameters `xml:"AdParameters,omitempty"` // Just string in VAST2.0.
	Icons        []*Icon       `xml:"Icons>Icon"`             // VAST3.0.
	Trackings    []*Tracking   `xml:"TrackingEvents>Tracking,omitempty"`
	VideoClicks  *VideoClicks  `xml:"VideoClicks,omitempty"`
	MediaFiles   []*MediaFile  `xml:"MediaFiles>MediaFile,omitempty"`
	Extensions   []*Extension  `xml:"CreativeExtensions>CreativeExtension,omitempty"` // VAST3.0.
}

type LinearWrapper

type LinearWrapper struct {
	Icons       []*Icon      `xml:"Icons>Icon,omitempty"` // VAST3.0.
	Trackings   []*Tracking  `xml:"TrackingEvents>Tracking,omitempty"`
	VideoClicks *VideoClicks `xml:"VideoClicks,omitempty"`                          // VideoClicks here is different from the Linear one.
	Extensions  []*Extension `xml:"CreativeExtensions>CreativeExtension,omitempty"` // VAST3.0.
}

type MediaFile

type MediaFile struct {
	Id                        string      `xml:"id,attr,omitempty"`
	Delivery                  Delivery    `xml:"delivery,attr"`             // Required.
	MimeType                  string      `xml:"type,attr"`                 // Required.
	Codec                     string      `xml:"codec,attr,omitempty"`      // VAST3.0.
	Bitrate                   *int        `xml:"bitrate,attr,omitempty"`    // In Kbps; absent if MaxBitrate and MinBitrate are present.
	MinBitrate                *int        `xml:"minBitrate,attr,omitempty"` // In Kbps; absent if Bitrate is present. VAST3.0.
	MaxBitrate                *int        `xml:"maxBitrate,attr,omitempty"` // In Kbps; absent if Bitrate is present. VAST3.0.
	Width                     int         `xml:"width,attr"`                // Required.
	Height                    int         `xml:"height,attr"`               // Required.
	IsScalable                bool        `xml:"scalable,attr,omitempty"`
	ShouldMaintainAspectRatio bool        `xml:"maintainAspectRatio,attr,omitempty"`
	ApiFramework              string      `xml:"apiFramework,attr,omitempty"` // API used to interact with the MediaFile.
	Uri                       TrimmedData `xml:",cdata"`
}

type Mode

type Mode string
const (
	MODE_ALL  Mode = "all"  // All companion ads must be displayed.
	MODE_ANY  Mode = "any"  // At least one companion ad must be displayed.
	MODE_NONE Mode = "none" // Companion ad display is optional.
)

type NonLinear

type NonLinear struct {
	Id                        string          `xml:"id,attr,omitempty"`
	Width                     int             `xml:"width,attr"`  // Required.
	Height                    int             `xml:"height,attr"` // Required.
	ExpandedWidth             int             `xml:"expandedWidth,attr"`
	ExpandedHeight            int             `xml:"expandedHeight,attr"`
	MinSuggestedDuration      *Duration       `xml:"minSuggestedDuration,attr,omitempty"`
	ApiFramework              string          `xml:"apiFramework,attr,omitempty"`
	IsScalable                bool            `xml:"scalable,attr,omitempty"`
	ShouldMaintainAspectRatio bool            `xml:"maintainAspectRatio,attr,omitempty"`
	ClickTracking             []string        `xml:"NonLinearClickTracking,omitempty"` // VAST3.0.
	ClickThrough              string          `xml:"NonLinearClickThrough,omitempty"`
	AdParameters              *AdParameters   `xml:"AdParameters,omitempty"` // Just string in VAST2.0.
	StaticResource            *StaticResource `xml:"StaticResource,omitempty"`
	IFrameResource            string          `xml:"IFrameResource,omitempty"`
	HtmlResource              *HtmlResource   `xml:"HTMLResource,omitempty"`                         // Just string in VAST2.0.
	Extensions                []Extension     `xml:"CreativeExtensions>CreativeExtension,omitempty"` // VAST3.0.
}

type NonLinearAds

type NonLinearAds struct {
	Trackings  []*Tracking  `xml:"TrackingEvents>Tracking,omitempty"`
	NonLinears []*NonLinear `xml:"NonLinear,omitempty"` // Required, at least one item.
}

type NonLinearAdsWrapper

type NonLinearAdsWrapper struct {
	Trackings  []*Tracking  `xml:"TrackingEvents>Tracking,omitempty"`
	NonLinears []*NonLinear `xml:"NonLinear,omitempty"`
}

type Offset

type Offset struct {
	Duration Duration
	Percent  int8
}

type Pricing

type Pricing struct {
	Model    PricingModel `xml:"model,attr"`
	Currency string       `xml:"currency,attr"` // ISO-4217 3 letter format.
	Price    string       `xml:",chardata"`     // Price in decimals represented as string; in case of Wrapper, only outer-most value is relevant.
}

type PricingModel

type PricingModel string
const (
	PRICING_MODEL_CPM PricingModel = "cpm"
	PRICING_MODEL_CPC PricingModel = "cpc"
	PRICING_MODEL_CPE PricingModel = "cpe"
	PRICING_MODEL_CPV PricingModel = "cpv"
)

type StaticResource

type StaticResource struct {
	MimeType string      `xml:"creativeType,attr"` // Required.
	Uri      TrimmedData `xml:",cdata"`
}

type Tracking

type Tracking struct {
	Event  Event       `xml:"event,attr"`            // Required.
	Offset *Offset     `xml:"offset,attr,omitempty"` // Time at which the event should be triggered. VAST3.0.
	Uri    TrimmedData `xml:",cdata"`
}

type TrimmedData

type TrimmedData string

type Vast

type Vast struct {
	XMLName xml.Name `xml:"VAST"`
	Version Version  `xml:"version,attr"`    // Required.
	Ads     []*Ad    `xml:"Ad"`              // Ad can be empty in VAST2.0.
	Errors  []string `xml:"Error,omitempty"` // One or more URI's, likely tracking pixels, to request in case of no ad.
}

type Version

type Version string
const (
	VERSION_2 Version = "2.0"
	VERSION_3 Version = "3.0"
)

type VideoClick

type VideoClick struct {
	Id  string      `xml:"id,attr,omitempty"`
	Uri TrimmedData `xml:",cdata"`
}

type VideoClicks

type VideoClicks struct {
	ClickThroughs  []*VideoClick `xml:"ClickThrough,omitempty"`
	ClickTrackings []*VideoClick `xml:"ClickTracking,omitempty"`
	CustomClicks   []*VideoClick `xml:"CustomClick,omitempty"`
}

type Wrapper

type Wrapper struct {
	AdSystem     *AdSystem          `xml:"AdSystem"`     // Required.
	VastAdTagUri string             `xml:"VASTAdTagURI"` // Required.
	Impressions  []*Impression      `xml:"Impression"`   // Required.
	Errors       []string           `xml:"Error,omitempty"`
	Creatives    []*CreativeWrapper `xml:"Creatives>Creative"` // Required.
	Extensions   []*Extension       `xml:"Extensions>Extension,omitempty"`
}

Jump to

Keyboard shortcuts

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