vmap

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OffsetStart = -1
	OffsetEnd   = -2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Ad struct {
	Id       string  `xml:"id,attr" json:"id"`
	Sequence int     `xml:"sequence,attr" json:"sequence"`
	InLine   *InLine `xml:"InLine" json:"inLine"`
}

func (*Ad) UnmarshalToken added in v0.3.0

func (ad *Ad) UnmarshalToken(tok *xmltokenizer.Tokenizer, se *xmltokenizer.Token) error

type AdBreak

type AdBreak struct {
	AdSource       *AdSource       `xml:"AdSource" json:"adSource"`
	TrackingEvents []TrackingEvent `xml:"TrackingEvents>Tracking" json:"trackingEvents"`
	Id             string          `xml:"breakId,attr" json:"id"`
	BreakType      string          `xml:"breakType,attr" json:"breakType"`
	TimeOffset     TimeOffset      `xml:"timeOffset,attr" json:"timeOffset"`
}

func (*AdBreak) UnmarshalToken added in v0.3.0

func (adBreak *AdBreak) UnmarshalToken(tok *xmltokenizer.Tokenizer, se *xmltokenizer.Token) error

type AdSource

type AdSource struct {
	VASTData *VASTData `xml:"VASTAdData"`
}

type AdTagURI

type AdTagURI struct{}

type ClickThrough

type ClickThrough struct {
	Id   string `xml:"id,attr" json:"id"`
	Text string `xml:",chardata" json:"url"`
}

type ClickTracking added in v0.1.3

type ClickTracking struct {
	Id   string `xml:"id,attr" json:"id"`
	Text string `xml:",chardata" json:"url"`
}

type Creative

type Creative struct {
	Id            string         `xml:"id,attr" json:"id"`
	AdId          string         `xml:"adId,attr" json:"adId"`
	UniversalAdId *UniversalAdId `xml:"UniversalAdId" json:"universalAdId"`
	Linear        *Linear        `xml:"Linear" json:"linear"`
}

func (*Creative) UnmarshalToken added in v0.3.0

func (c *Creative) UnmarshalToken(tok *xmltokenizer.Tokenizer, se *xmltokenizer.Token) error

type CreativeParameter added in v0.2.6

type CreativeParameter struct {
	CreativeId            string `xml:"creativeId,attr" json:"creativeId"`
	Name                  string `xml:"name,attr" json:"name"`
	Value                 string `xml:",chardata" json:"value"`
	CreativeParameterType string `xml:"type,attr" json:"creativeParameterType"`
}

type CustomClick added in v0.1.3

type CustomClick struct {
	Id   string `xml:"id,attr" json:"id"`
	Text string `xml:",chardata" json:"url"`
}

type Duration added in v0.2.0

type Duration struct{ time.Duration }

func (Duration) MarshalText added in v0.2.1

func (d Duration) MarshalText() ([]byte, error)

func (*Duration) UnmarshalText added in v0.2.0

func (d *Duration) UnmarshalText(data []byte) error

type Error added in v0.2.6

type Error struct {
	Value string `xml:",chardata" json:"value"`
}

type Extension added in v0.2.6

type Extension struct {
	ExtensionType      string              `xml:"type,attr" json:"type"`
	CreativeParameters []CreativeParameter `xml:"CreativeParameters>CreativeParameter" json:"creativeParameters"`
}

NOTE: Specifically built for FreeWheel's CreativeParamer extension at the moment.

func (*Extension) UnmarshalToken added in v0.3.0

func (ext *Extension) UnmarshalToken(tok *xmltokenizer.Tokenizer, se *xmltokenizer.Token) error

type Impression

type Impression struct {
	Id   string `xml:"id,attr" json:"id"`
	Text string `xml:",chardata" json:"url"`
}

type InLine

type InLine struct {
	AdSystem   string       `xml:"AdSystem" json:"adSystem"`
	AdTitle    string       `xml:"AdTitle" json:"adTitle"`
	Impression []Impression `xml:"Impression" json:"impression"`
	Creatives  []Creative   `xml:"Creatives>Creative" json:"creatives"`
	Extensions []Extension  `xml:"Extensions>Extension" json:"extensions"`
	Error      *Error       `xml:"Error" json:"error"`
}

func (*InLine) UnmarshalToken added in v0.3.0

func (inline *InLine) UnmarshalToken(tok *xmltokenizer.Tokenizer, se *xmltokenizer.Token) error

type Linear

type Linear struct {
	Duration       Duration        `xml:"Duration" json:"duration"`
	TrackingEvents []TrackingEvent `xml:"TrackingEvents>Tracking" json:"trackingEvents"`
	MediaFiles     []MediaFile     `xml:"MediaFiles>MediaFile" json:"mediaFiles"`
	ClickThrough   *ClickThrough   `xml:"VideoClicks>ClickThrough" json:"clickThrough"`
	ClickTracking  []ClickTracking `xml:"VideoClicks>ClickTracking" json:"clickTracking"`
	CustomClick    []CustomClick   `xml:"VideoClicks>CustomClick" json:"customClick"`
}

type MediaFile

type MediaFile struct {
	Text      string `xml:",chardata" json:"text"`
	Bitrate   int    `xml:"bitrate,attr" json:"bitrate"`
	Width     int    `xml:"width,attr" json:"width"`
	Height    int    `xml:"height,attr" json:"height"`
	Delivery  string `xml:"delivery,attr" json:"delivery"`
	MediaType string `xml:"type,attr" json:"mediaType"`
	Codec     string `xml:"codec,attr" json:"codec"`
}

type TimeOffset added in v0.2.0

type TimeOffset struct {
	// If this is not nil, we're dealing with a duration offset.
	Duration *Duration

	//If not zero and duration is nil, it's a position number.
	// -1 is reserved for start, -2 for end.
	Position int

	// If duration is nil and position is zero, this is a percentage offset.
	Percent float32
}

TimeOffset represents the time offset for an ad break in the VMAP document.

func (TimeOffset) MarshalText added in v0.2.1

func (to TimeOffset) MarshalText() ([]byte, error)

func (*TimeOffset) UnmarshalText added in v0.2.0

func (to *TimeOffset) UnmarshalText(data []byte) error

type TrackingEvent

type TrackingEvent struct {
	Event string `xml:"event,attr" json:"event"`
	Text  string `xml:",chardata" json:"url"`
}

type UniversalAdId

type UniversalAdId struct {
	IdRegistry string `xml:"idRegistry,attr" json:"idRegistry"`
	Id         string `xml:",chardata" json:"id"`
}

type VAST

type VAST struct {
	Text                      string `xml:",chardata" json:"text"`
	Xsi                       string `xml:"xsi,attr" json:"xsi"`
	NoNamespaceSchemaLocation string `xml:"noNamespaceSchemaLocation,attr" json:"noNamespaceSchemaLocation"`
	Version                   string `xml:"version,attr" json:"version"`
	Ad                        []Ad   `xml:"Ad" json:"ad"`
}

func DecodeVast added in v0.3.0

func DecodeVast(input []byte) (VAST, error)

func (*VAST) UnmarshalToken added in v0.3.0

func (vast *VAST) UnmarshalToken(tok *xmltokenizer.Tokenizer, se *xmltokenizer.Token) error

type VASTData

type VASTData struct {
	VAST *VAST `xml:"VAST" json:"vast"`
}

type VMAP

type VMAP struct {
	XMLName  xml.Name  `xml:"VMAP" json:"xmlName"`
	Text     string    `xml:",chardata" json:"text"`
	Vmap     string    `xml:"vmap,attr" json:"vmap"`
	Version  string    `xml:"version,attr" json:"version"`
	AdBreaks []AdBreak `xml:"AdBreak" json:"adBreaks"`
}

func DecodeVmap added in v0.3.0

func DecodeVmap(input []byte) (VMAP, error)

Jump to

Keyboard shortcuts

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