mongersvast

package module
v0.0.0-...-3ac9f4c Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: MIT Imports: 14 Imported by: 1

README

mongersvast

  • Simple golang utility library on formatting/manipulating of VAST XML
  • Supports VAST 1.0, 2.0, 3.0

Install


go get -u -v github.com/bayugyug/mongersvast

Mini-How-To

  • Load XML from string

package main

import (
        "fmt"
        mvast "github.com/bayugyug/mongersvast"
       )


func main() {

    var xml string

    //LOAD from a sample xml string
    vt := mvast.VAST{}
    vt.FromString(mvast.XMLInlineLinear)
    //stringify VAST obj
    xml, _ = vt.ToString()
    fmt.Println(xml)

}

-- Output

  • InLine Linear Ad

package main

import (
        "fmt"
        mvast "github.com/bayugyug/mongersvast"
       )

func main() {

   var xml string
   //INLINE LINEAR AD
   inAd := mvast.InLineAd(
            mvast.AdAttributes{"ID": "2007-07-04"},
            &mvast.AdSystem{Value: "Ads for VAST"},
            &mvast.AdTitle{Value: "Ad title here"},
            &mvast.Description{Value: "Ad remarks here"},
            &mvast.VASTError{Value: "http://mongers.vast.utils/error"},
            []*mvast.Impression{
                    {ID: "imp-01", Value: "http://mongers.vast.utils/impression1"},
            },
            &mvast.Creatives{
                    Creative: []*mvast.Creative{
                            {AdID: "ad01",
                                    Linear: &mvast.Linear{
                                            Duration: &mvast.Duration{Value: "00:00:30"},
                                            TrackingEvents: &mvast.TrackingEvents{
                                                    Tracking: []*mvast.Tracking{
                                                            {Event: mvast.TrackingEventTypes["Start"], Value: "http://mongers.vast.utils/start"},
                                                            {Event: mvast.TrackingEventTypes["FirstQuartile"], Value: "http://mongers.vast.utils/firstq"},
                                                            {Event: mvast.TrackingEventTypes["Midpoint"], Value: "http://mongers.vast.utils/midpoint"},
                                                            {Event: mvast.TrackingEventTypes["ThirdQuartile"], Value: "http://mongers.vast.utils/thirdq"},
                                                            {Event: mvast.TrackingEventTypes["Complete"], Value: "http://mongers.vast.utils/complete"},
                                                    },
                                            },
                                            VideoClicks: &mvast.VideoClicks{
                                                    ClickThrough: &mvast.ClickThrough{
                                                            Value: "http://mongers.vast.utils/clickthrough"},
                                                    ClickTracking: &mvast.ClickTracking{
                                                            Value: "http://mongers.vast.utils/clicktracking"},
                                            },
                                            MediaFiles: &mvast.MediaFiles{
                                                    MediaFile: []*mvast.MediaFile{
                                                            {
                                                                    ID:       "media-01",
                                                                    Delivery: "progressive",
                                                                    Type:     "video/mp4",
                                                                    Width:    "640",
                                                                    Height:   "360",
                                                                    Bitrate:  "784",
                                                                    Value:    "https://d1fudb3kxhcy38.cloudfront.net/5xjr/829/4eee446d1897557db60a9d7b3632d294_0001_640x360_700k.mp4",
                                                            },
                                                    },
                                            },
                                    }},
                    },
            })
        //stringify VAST obj
        xml, _ = inAd.ToString()
        fmt.Println(xml)

}

-- Output

  • Wrapper Linear Ad

package main

import (
        "fmt"
        mvast "github.com/bayugyug/mongersvast"
       )


func main() {

   var xml string
   //WRAPPER LINEAR AD
   wrpAd := mvast.WrapperAd(
            mvast.AdAttributes{"ID": "2007-07-04"},
            &mvast.AdSystem{Value: "Ads for VAST"},
            &mvast.AdTitle{Value: "Ad title here"},
            &mvast.Description{Value: "Ad remarks here"},
            &mvast.VASTError{Value: "http://mongers.vast.utils/error"},
            []*mvast.Impression{
                    {ID: "imp-01", Value: "http://mongers.vast.utils/impression1"},
            },
            &mvast.Creatives{
                    Creative: []*mvast.Creative{
                            {AdID: "ad01",
                                    Linear: &mvast.Linear{
                                            Duration: &mvast.Duration{Value: "00:00:30"},
                                            TrackingEvents: &mvast.TrackingEvents{
                                                    Tracking: []*mvast.Tracking{
                                                            {Event: mvast.TrackingEventTypes["Start"], Value: "http://mongers.vast.utils/start"},
                                                            {Event: mvast.TrackingEventTypes["FirstQuartile"], Value: "http://mongers.vast.utils/firstq"},
                                                            {Event: mvast.TrackingEventTypes["Midpoint"], Value: "http://mongers.vast.utils/midpoint"},
                                                            {Event: mvast.TrackingEventTypes["ThirdQuartile"], Value: "http://mongers.vast.utils/thirdq"},
                                                            {Event: mvast.TrackingEventTypes["Complete"], Value: "http://mongers.vast.utils/complete"},
                                                    },
                                            },
                                            VideoClicks: &mvast.VideoClicks{
                                                    ClickThrough: &mvast.ClickThrough{
                                                            Value: "http://mongers.vast.utils/clickthrough"},
                                                    ClickTracking: &mvast.ClickTracking{
                                                            Value: "http://mongers.vast.utils/clicktracking"},
                                            },
                                    }},
                    },
            },
            &mvast.VASTAdTagURI{
                    ID:    "adwrapper-01",
                    Value: "http://mongers.vast.utils/2nd-vast-here.xml"},
    )
    //stringify VAST obj
    xml, _ = wrpAd.ToString()
    fmt.Println(xml)

}

-- Output

  • Load from an XML file
package main

import (
        "fmt"
        mvast "github.com/bayugyug/mongersvast"
       )

func main() {

   var xml string
   //Load the XML file from directory
   vastf := mvast.VAST{}
   vastf.FromFile("./tsample.vast.xml")
   if len(vastf.Ad) > 0 {
		//INJECT additional vast element (Pricing)
		vastf.Ad[0].InLine.Pricing = &mvast.Pricing{
			Model:    "CPM",
			Currency: "USD",
			Value:    "0.99",
		}
		//INJECT additional vast element (Extensions)
		vastf.Ad[0].InLine.Extensions = &mvast.Extensions{
			Extension: []*mvast.Extension{
				{Type: "iab-Count",
					TotalAvailable: &mvast.TotalAvailable{Value: "2"}},
			},
		}
	}
   //stringify VAST obj
   xml, _ = vastf.ToString()
   fmt.Println(xml)

}

-- Input

-- Output

  • Simple InLine Linear Ad

package main

import (
        "fmt"
        mvast "github.com/bayugyug/mongersvast"
)

func main() {

        var xml string
        //INLINE SIMPLE
        inAd := mvast.InLineAd(
                mvast.AdAttributes{"ID": "2007-07-04", "Version": "4.0", "Sequence": "1", "ConditionalAd": "false"},
                &mvast.AdSystem{Value: "Ads for VAST Inline_Simple"},
                &mvast.AdTitle{Value: "Ad title here"},
                &mvast.Description{Value: "Ad remarks here"},
                &mvast.VASTError{Value: "http://mongers.vast.utils/error"},
                []*mvast.Impression{
                        {ID: "imp-01", Value: "http://mongers.vast.utils/impression1"},
                },
                &mvast.Creatives{
                        Creative: []*mvast.Creative{
                                {AdID: "ad01",
                                        Linear: &mvast.Linear{
                                                Duration: &mvast.Duration{Value: "00:00:30"},
                                                TrackingEvents: &mvast.TrackingEvents{
                                                        Tracking: []*mvast.Tracking{
                                                                {Event: mvast.TrackingEventTypes["Start"], Value: "http://mongers.vast.utils/start"},
                                                                {Event: mvast.TrackingEventTypes["FirstQuartile"], Value: "http://mongers.vast.utils/firstq"},
                                                                {Event: mvast.TrackingEventTypes["Midpoint"], Value: "http://mongers.vast.utils/midpoint"},
                                                                {Event: mvast.TrackingEventTypes["ThirdQuartile"], Value: "http://mongers.vast.utils/thirdq"},
                                                                {Event: mvast.TrackingEventTypes["Complete"], Value: "http://mongers.vast.utils/complete"},
                                                        },
                                                },
                                                VideoClicks: &mvast.VideoClicks{
                                                        ClickThrough: &mvast.ClickThrough{
                                                                Value: "http://mongers.vast.utils/clickthrough"},
                                                        ClickTracking: &mvast.ClickTracking{
                                                                Value: "http://mongers.vast.utils/clicktracking"},
                                                },
                                                MediaFiles: &mvast.MediaFiles{
                                                        MediaFile: []*mvast.MediaFile{
                                                                {
                                                                        ID:       "media-01",
                                                                        Delivery: "progressive",
                                                                        Type:     "video/mp4",
                                                                        Width:    "640",
                                                                        Height:   "360",
                                                                        Bitrate:  "784",
                                                                        Value:    "https://d1fudb3kxhcy38.cloudfront.net/5xjr/829/4eee446d1897557db60a9d7b3632d294_0001_640x360_700k.mp4",
                                                                },
                                                                {
                                                                        ID:                  "media-02",
                                                                        Delivery:            "progressive",
                                                                        Type:                "video/mp4",
                                                                        Width:               "1280",
                                                                        Height:              "720",
                                                                        Bitrate:             "2000",
                                                                        MinBitrate:          "1500",
                                                                        MaxBitrate:          "2500",
                                                                        Scalable:            "1",
                                                                        MaintainAspectRatio: "1",
                                                                        Codec:               "0",
                                                                        Value:               "https://iabtechlab.com/wp-content/uploads/2016/07/VAST-4.0-Short-Intro.mp4",
                                                                },
                                                                {
                                                                        ID:                  "media-03",
                                                                        Delivery:            "progressive",
                                                                        Type:                "video/mp4",
                                                                        Width:               "854",
                                                                        Height:              "480",
                                                                        Bitrate:             "1000",
                                                                        MinBitrate:          "700",
                                                                        MaxBitrate:          "1500",
                                                                        Scalable:            "1",
                                                                        MaintainAspectRatio: "1",
                                                                        Codec:               "0",
                                                                        Value:               "https://iabtechlab.com/wp-content/uploads/2017/12/VAST-4.0-Short-Intro-mid-resolution.mp4",
                                                                },
                                                                {
                                                                        ID:                  "media-04",
                                                                        Delivery:            "progressive",
                                                                        Type:                "video/mp4",
                                                                        Width:               "640",
                                                                        Height:              "360",
                                                                        Bitrate:             "600",
                                                                        MinBitrate:          "500",
                                                                        MaxBitrate:          "700",
                                                                        Scalable:            "1",
                                                                        MaintainAspectRatio: "1",
                                                                        Codec:               "0",
                                                                        Value:               "https://iabtechlab.com/wp-content/uploads/2017/12/VAST-4.0-Short-Intro-low-resolution.mp4",
                                                                },
                                                        },
                                                },
                                        }},
                        },
                })
        //INJECT additional vast element (Pricing)
        inAd.Ad[0].InLine.Pricing = &mvast.Pricing{
                Model:    "CPM",
                Currency: "USD",
                Value:    "2.99",
        }
        //INJECT additional vast element (Advertiser)
        inAd.Ad[0].InLine.Advertiser = &mvast.Advertiser{
                Value: "Mongers-Adverts",
        }
        //INJECT additional vast element (Category)
        inAd.Ad[0].InLine.Category = []*mvast.Category{
                {Value: "Mongers-Categ 1"},
                {Value: "Mongers-Categ 2"},
        }
        //INJECT additional vast element (UniversalAdId )
        inAd.Ad[0].InLine.Creatives.Creative[0].UniversalAdID = &mvast.UniversalAdID{
                IDRegistry: "Ad-ID",
                IDValue:    "8465",
                Value:      "8465",
        }
        //stringify VAST obj
        xml, _ = inAd.ToString()
        fmt.Println(xml)

}

-- Output

  • Simple Wrapper Tag with Viewable Impression

package main

import (
	"fmt"
	mvast "github.com/bayugyug/mongersvast"
)

func main() {

	var xml string
	//SIMPLE
	wrAd := mvast.WrapperAd(
		mvast.AdAttributes{
			"ID":                       "2007-07-04", //Ad.id
			"Version":                  "4.0",        //Ad.version
			"Sequence":                 "1",          //Ad.sequence
			"ConditionalAd":            "false",      //Ad.conditionalAd
			"FollowAdditionalWrappers": "0",          //Wrapper.followAdditionalWrappers
			"AllowMultipleAds":         "1",          //Wrapper.allowMultipleAds
			"FallbackOnNoAd":           "0",          //Wrapper.fallbackOnNoAd
		},
		&mvast.AdSystem{Version: "4.0", Value: "VAST Wrapper Tag with Viewable Impression"},
		&mvast.AdTitle{Value: "Ad title here"},
		&mvast.Description{Value: "Ad remarks here"},
		&mvast.VASTError{Value: "http://mongers.vast.utils/error"},
		[]*mvast.Impression{
			{ID: "imp-01", Value: "http://mongers.vast.utils/impression1"},
		},
		&mvast.Creatives{
			Creative: []*mvast.Creative{
				{
					AdID:     "2447226",
					ID:       "5480",
					Sequence: "1",
					Linear: &mvast.Linear{
						TrackingEvents: &mvast.TrackingEvents{
							Tracking: []*mvast.Tracking{
								{
									Event:  mvast.TrkEventStart,
									Offset: "09:00:10",
									Value:  "http://mongers.vast.utils/start",
								},
							},
						},
					},
				},
			},
		},
		&mvast.VASTAdTagURI{Value: "https://raw.githubusercontent.com/InteractiveAdvertisingBureau/VAST_Samples/master/VAST%204.0%20Samples/Inline_Companion_Tag-test.xml"},
	)
	//INJECT additional vast element (ViewableImpression)
	wrAd.Ad[0].Wrapper.ViewableImpression = []*mvast.ViewableImpression{
		{
			ID:               "1",
			Viewable:         &mvast.Viewable{Value: "http://search.iabtechlab.com/error?errcode=102&imprid=s5-ea2f7f298e28c0c98374491aec3dfeb1&ts=1243"},
			NotViewable:      &mvast.NotViewable{Value: "http://search.iabtechlab.com/error?errcode=103&imprid=s5-ea2f7f298e28c0c98374491aec3dfeb1&ts=1243"},
			ViewUndetermined: &mvast.ViewUndetermined{Value: "http://search.iabtechlab.com/error?errcode=104&imprid=s5-ea2f7f298e28c0c98374491aec3dfeb1&ts=1243"},
		},
	}
	//INJECT additional vast element (Pricing)
	wrAd.Ad[0].Wrapper.Pricing = &mvast.Pricing{
		Model:    "cpm",
		Currency: "USD",
		Value:    "5.99",
	}
	//INJECT additional vast element (Advertiser)
	wrAd.Ad[0].Wrapper.Advertiser = &mvast.Advertiser{
		Value: "Mongers-Adverts",
	}
	//INJECT additional vast element (Category)
	wrAd.Ad[0].Wrapper.Category = []*mvast.Category{
		{Value: "Mongers-Categ 1"},
	}
	//INJECT additional vast element (UniversalAdId)
	wrAd.Ad[0].Wrapper.Creatives.Creative[0].UniversalAdID = &mvast.UniversalAdID{
		IDRegistry: "Ad-ID",
		IDValue:    "8465",
		Value:      "8465",
	}

    //stringify VAST obj
	xml, _ = wrAd.ToString()
	fmt.Println(xml)

}

-- Output

  • Simple Inline Tag With Non-Linear

package main

import (
	"fmt"
	mvast "github.com/bayugyug/mongersvast"
)

func main() {

        var xml string
        //SIMPLE
        inAd := mvast.InLineAd(
                mvast.AdAttributes{
                        "ID":            "2007-07-04",
                        "Version":       "4.0",
                        "Sequence":      "1",
                        "ConditionalAd": "false",
                },
                &mvast.AdSystem{
                        Value: "VAST Inline Simple With Non-Linear",
                },
                &mvast.AdTitle{
                        Value: "Ad title here",
                },
                &mvast.Description{
                        Value: "VAST 4.0 sample tag for Non Linear ad (i.e Overlay ad). Change the StaticResources to have a tag with your own content. Change NonLinear tag's parameters accordingly to view desired results.",
                },
                &mvast.VASTError{
                        Value: "http://mongers.vast.utils/error",
                },
                []*mvast.Impression{
                        {
                                ID:    "imp-01",
                                Value: "http://mongers.vast.utils/impression1",
                        },
                },
                &mvast.Creatives{
                        Creative: []*mvast.Creative{
                                {
                                        AdID:     "2447226",
                                        ID:       "5480",
                                        Sequence: "1",
                                        NonLinearAds: &mvast.NonLinearAds{
                                                NonLinear: []*mvast.NonLinear{
                                                        {
                                                                ID: "1",
                                                                StaticResource: &mvast.StaticResource{
                                                                        CreativeType: "image/png",
                                                                        Value:        "http://mms.businesswire.com/media/20150623005446/en/473787/21/iab_tech_lab.jpg",
                                                                },
                                                                NonLinearClickThrough: &mvast.NonLinearClickThrough{
                                                                        Value: "http://iabtechlab.com",
                                                                },
                                                                NonLinearClickTracking: &mvast.NonLinearClickTracking{
                                                                        Value: "http://example.com/trackingurl/clickTracking",
                                                                },
                                                        },
                                                },
                                        },
                                },
                        },
                })
        //INJECT additional vast element (Pricing)
        inAd.Ad[0].InLine.Pricing = &mvast.Pricing{
                Model:    "cpm",
                Currency: "USD",
                Value:    "5.88",
        }
        //INJECT additional vast element (Advertiser)
        inAd.Ad[0].InLine.Advertiser = &mvast.Advertiser{
                Value: "Mongers-Adverts",
        }
        //INJECT additional vast element (AdServingId)
        inAd.Ad[0].InLine.AdServingID = &mvast.AdServingID{
                Value: "ADID_INnonLINEARTEST_ABC123",
        }
        //INJECT additional vast element (Category)
        inAd.Ad[0].InLine.Category = []*mvast.Category{
                {
                        Value:     "Mongers-Categ 1",
                        Authority: "http://www.iabtechlab.com/categoryauthority",
                },
        }
        //INJECT additional vast element (UniversalAdId)
        inAd.Ad[0].InLine.Creatives.Creative[0].UniversalAdID = &mvast.UniversalAdID{
                IDRegistry: "Ad-ID",
                IDValue:    "8465",
                Value:      "8465",
        }

        //INJECT additional vast element (Extensions)
        inAd.Ad[0].InLine.Extensions = &mvast.Extensions{
                Extension: []*mvast.Extension{
                        {Type: "iab-Count",
                                TotalAvailable: &mvast.TotalAvailable{Value: "2"}},
                },
        }
        //stringify VAST obj
        xml, _ = inAd.ToString()
        fmt.Println(xml)

}


-- Output

  • Simple Inline Linear Tag via Cascade Methods

package main

import (
	"fmt"

	mvast "github.com/bayugyug/mongersvast"
)

func main() {

	var xml string

	//init
	vst := &mvast.VAST{}

	//do cascade
	vst.
		SetAd("1", "id01", "1", "false").
		SetInLineAd("in01").
		SetAdSystem("VAST Inline Simple With Non-Linear").
		SetAdTitle("Ad title here").
		SetAdServing("", "ADID_INnonLINEARTEST_ABC123").
		SetDescription("Ad desc here ;-)").
		SetErrorURL("http://mongers.vast.utils/error").
		SetImpressionURL("imp1", "http://mongers.vast.utils/impression1").
		SetCreative("1", "", "", "").
		SetLinear(nil).
		SetLinearDuration("", "00:00:45").
		SetLinearTracking(mvast.TrkEventStart, "", "http://mongers.vast.utils/start").
		SetLinearTracking(mvast.TrkEventFirstQuartile, "", "http://mongers.vast.utils/firstq").
		SetLinearTracking(mvast.TrkEventMidpoint, "", "http://mongers.vast.utils/midpoint").
		SetLinearTracking(mvast.TrkEventThirdQuartile, "", "http://mongers.vast.utils/thirdq").
		SetLinearTracking(mvast.TrkEventComplete, "", "http://mongers.vast.utils/complete").
		SetLinearClickThrough("1", "http://mongers.vast.utils/clickthrough").
		SetLinearClickTracking("1", "http://mongers.vast.utils/clicktracking").
		SetLinearMediaFile("media-01",
			"https://iabtechlab.com/wp-content/uploads/2017/12/VAST-4.0-Short-Intro-low-resolution.mp4",
			"progressive",
			"video/mp4",
			"640",
			"360",
			"600",
			"500",
			"700",
			"1",
			"1",
			"0",
			"").
		SetPricing("1", "CPM", "USD", "1.58").
		SetAdvertiser("Mongers-Adverts").
		SetCategory("1", "http://www.iabtechlab.com/categoryauthority", "Mongers-Categ 1").
		SetExtension("iab-Count", "", &mvast.TotalAvailable{Value: "2"}, nil)

        //stringify VAST obj
	xml, _ = vst.ToString()
	fmt.Println(xml)

}


-- Output

  • Simple Inline NonLinear Tag via Cascade Methods

package main

import (
	"fmt"

	mvast "github.com/bayugyug/mongersvast"
)

func main() {

	var xml string

	vst := &mvast.VAST{}

	vst.
		SetAd("1", "id01", "1", "false").
		SetInLineAd("in01").
		SetAdSystem("VAST Inline Simple With Non-Linear").
		SetAdTitle("NonLinear Image").
		SetAdServing("", "ADID_INnonLINEARTEST_ABC123").
		SetDescription("VAST 3.0 sample tag for Non Linear ad (i.e Overlay ad). Change the StaticResources to have a tag with your own content. Change NonLinear tag's parameters accordingly to view desired results.").
		SetErrorURL("http://mongers.vast.utils/error").
		SetImpressionURL("imp1", "http://mongers.vast.utils/impression1").
		SetCreative("1", "", "", "").
		SetNonLinear(nil).
		SetNonLinearAd("1", "", "480", "150", "00:00:05", "", "").
		SetNonLinearStaticResource("image/png", "http://mms.businesswire.com/media/20150623005446/en/473787/21/iab_tech_lab.jpg").
		SetNonLinearClickTracking("", "http://example.com/trackingurl/clickTracking").
		SetNonLinearClickThrough("", "http://iabtechlab.com").
		SetPricing("1", "CPM", "USD", "1.58").
		SetUniversalAd("1", "", "", "univer id is here").
		SetAdvertiser("Mongers-Adverts").
		SetCategory("1", "http://www.iabtechlab.com/categoryauthority", "Mongers-Categ 1").
		SetExtension("iab-Count", "", &mvast.TotalAvailable{Value: "2"}, nil)
	xml, _ = vst.ToString()
	fmt.Println(xml)

}


-- Output

  • Simple Inline Companion Tag via Cascade Methods

package main

import (
	"fmt"

	mvast "github.com/bayugyug/mongersvast"
)

func main() {

	var xml string

	vst := &mvast.VAST{}

	vst.
		SetVersion("3.0").
		SetAd(
            "1",    //version
            "id01", //id
            "1",    //sequence
            "false",//adConditional
        ).
		SetInLineAd("in01").
		SetAdSystem("VAST Inline Simple With Non-Linear").
		SetAdTitle("Ad title here").
		SetAdServing("", "ADID_INnonLINEARTEST_ABC123").
		SetDescription("Ad desc here ;-)").
		SetErrorURL("http://mongers.vast.utils/error").
		SetImpressionURL(
            "imp1",  //ID
            "http://mongers.vast.utils/impression1", //URL
        ).
		SetCreative(
			"1", //ID
			"",  //AdID
			"",  //Sequence
			"",  //APIFramework
		).
		SetCompanionAd(nil).
		SetCompanion(
			"1232", //ID,
			"300",  //Width,
			"250",  //Height,
			"",     //AltText,
			"250",  //AssetWidth,
			"200",  //AssetHeight,
			"350",  //ExpandedWidth,
			"250",  //ExpandedHeight,
			"",     //APIFramework,
			"",     //AdSlotID,
			"",     //PxRatio
		).
		SetCompanionStaticResource("image/png", "https://www.iab.com/wp-content/uploads/2014/09/iab-tech-lab-6-644x290.png").
		SetCompanionClickThrough("", "https://iabtechlab.com").
		SetCreative("2", "", "", "").
		SetLinear(nil).
		SetLinearDuration("", "00:00:45").
		SetLinearTracking(mvast.TrkEventStart, "", "http://mongers.vast.utils/start").
		SetLinearTracking(mvast.TrkEventFirstQuartile, "", "http://mongers.vast.utils/firstq").
		SetLinearTracking(mvast.TrkEventMidpoint, "", "http://mongers.vast.utils/midpoint").
		SetLinearTracking(mvast.TrkEventThirdQuartile, "", "http://mongers.vast.utils/thirdq").
		SetLinearTracking(mvast.TrkEventComplete, "", "http://mongers.vast.utils/complete").
		SetLinearClickThrough("1", "http://mongers.vast.utils/clickthrough").
		SetLinearClickTracking("1", "http://mongers.vast.utils/clicktracking").
		SetLinearMediaFile(
			"media-01", //ID
			"https://iabtechlab.com/wp-content/uploads/2017/12/VAST-4.0-Short-Intro-low-resolution.mp4", //Value
			"progressive", //Delivery
			"video/mp4",   //Type
			"640",         //Width
			"360",         //Height
			"600",         //Bitrate
			"500",         //MinBitrate
			"700",         //MaxBitrate
			"1",           //Scalable
			"1",           //MaintainAspectRatio
			"0",           //Codec
			"",            //APIFramework
		).
		SetPricing("1", "CPM", "USD", "1.58").
		SetUniversalAd("1", "", "", "univer id is here").
		SetAdvertiser("Mongers-Adverts").
		SetCategory("1", "http://www.iabtechlab.com/categoryauthority", "Mongers-Categ 1").
		SetExtension("iab-Count", "", &mvast.TotalAvailable{Value: "2"}, nil)
	xml, _ = vst.ToString()
	fmt.Println(xml)

}

-- Output

Reference

VAST INSIGHTS

License

MIT

Documentation

Index

Constants

View Source
const (
	VastInlineLinear = 1 + iota
	VastInlineNonlinear
	VastWrapperLinear1
	VastWrapperLinear2
	VastWrapperNonlinear1
	VastWrapperNonlinear2
)

const for sample vast xmls

View Source
const (
	TrkEventMute                   = "mute"
	TrkEventUnmute                 = "unmute"
	TrkEventPause                  = "pause"
	TrkEventResume                 = "resume"
	TrkEventRewind                 = "rewind"
	TrkEventSkip                   = "skip"
	TrkEventPlayerExpand           = "playerExpand"
	TrkEventPlayerCollapse         = "playerCollapse"
	TrkEventStart                  = "start"
	TrkEventFirstQuartile          = "firstQuartile"
	TrkEventMidpoint               = "midpoint"
	TrkEventThirdQuartile          = "thirdQuartile"
	TrkEventComplete               = "complete"
	TrkEventAcceptInvitationLinear = "acceptInvitationLinear"
	TrkEventTimeSpentViewing       = "timeSpentViewing"
	TrkEventOtherAdInteraction     = "otherAdInteraction"
	TrkEventProgress               = "progress"
	TrkEventAcceptInvitation       = "acceptInvitation"
	TrkEventAdExpand               = "adExpand"
	TrkEventAdCollapse             = "adCollapse"
	TrkEventMinimize               = "minimize"
	TrkEventClose                  = "close"
	TrkEventOverlayViewDuration    = "overlayViewDuration"
	TrkEventCreativeView           = "creativeView"
	VastXMLNs                      = "http://www.iab.com/VAST"
	VastXMLNsXs                    = "http://www.w3.org/2001/XMLSchema"
)

const more

View Source
const (
	MacroUnknown     = -1
	MacroUnavailable = -2
	AdsPreRoll       = 1
	AdsMidRoll       = 2
	AdsPostRoll      = 3
)

constant Generic Macros

Variables

View Source
var (
	XMLInlineNonLinear = `` /* 2428-byte string literal not displayed */

	XMLInlineLinear = `` /* 2215-byte string literal not displayed */

	XMLWrapperLinear1 = `` /* 1787-byte string literal not displayed */

	XMLWrapperLinear2 = `` /* 1243-byte string literal not displayed */

	XMLWrapperNonLinear1 = `` /* 1236-byte string literal not displayed */

	XMLWrapperNonLinear2 = `` /* 1386-byte string literal not displayed */

)

SAMPLE VAST XMLS

View Source
var (
	ErrFailedToString         = errors.New("mongersvast: string Format failed")
	ErrFailedToStringNilValue = errors.New("mongersvast: string Format failed (nil value found)")
	ErrFailedFileOpen         = errors.New("mongersvast: XML file open failed")
	ErrFailedFileSave         = errors.New("mongersvast: XML file save failed")
	VastXMLVer1               = "1.0"
	VastXMLVer2               = "2.0"
	VastXMLVer3               = "3.0"
	VastXMLVer4               = "4.0"
	VastXMLHeader             = `<?xml version="1.0" encoding="UTF-8"?>`
	AdTypeIsInline            = "inline"
	AdTypeIsWrapper           = "wrapper"
)

misc vars here

View Source
var TrackingEventTypes = map[string]string{
	"AcceptInvitationLinear": TrkEventAcceptInvitationLinear,
	"AcceptInvitation":       TrkEventAcceptInvitation,
	"AdCollapse":             TrkEventAdCollapse,
	"AdExpand":               TrkEventAdExpand,
	"Close":                  TrkEventClose,
	"Complete":               TrkEventComplete,
	"CreativeView":           TrkEventCreativeView,
	"FirstQuartile":          TrkEventFirstQuartile,
	"Midpoint":               TrkEventMidpoint,
	"Minimize":               TrkEventMinimize,
	"Mute":                   TrkEventMute,
	"OtherAdInteraction":     TrkEventOtherAdInteraction,
	"OverlayViewDuration":    TrkEventOverlayViewDuration,
	"Pause":                  TrkEventPause,
	"PlayerCollapse":         TrkEventPlayerCollapse,
	"PlayerExpand":           TrkEventPlayerExpand,
	"Progress":               TrkEventProgress,
	"Resume":                 TrkEventResume,
	"Rewind":                 TrkEventRewind,
	"Skip":                   TrkEventSkip,
	"Start":                  TrkEventStart,
	"ThirdQuartile":          TrkEventThirdQuartile,
	"TimeSpentViewing":       TrkEventTimeSpentViewing,
	"Unmute":                 TrkEventUnmute,
}

TrackingEventTypes list of known event types of Tracking

View Source
var VASTErrorCodes = map[string]string{
	"100": "XML parsing error",
	"101": "VAST schema validation error",
	"102": "VAST version of response not supported",
	"200": "Trafficking error Video player received an Ad type that it was not expecting and/or cannot display",
	"201": "Video player expecting different linearity",
	"202": "Video player expecting different duration",
	"203": "Video player expecting different size",
	"300": "General Wrapper error",
	"301": "Timeout of VAST URI provided in Wrapper element, or of VAST URI provided in a subsequent Wrapper element (URI was either unavailable or reached a timeout as defined by the video player)",
	"302": "Wrapper limit reached, as defined by the video player Too many Wrapper responses have  been received with no InLine response",
	"303": "No Ads VAST response after one or more Wrappers",
	"400": "General Linear error Video player is unable to display the Linear Ad",
	"401": "File not found Unable to find Linear/MediaFile from URI",
	"402": "Timeout of MediaFile URI",
	"403": "Couldn’t find MediaFile that is supported by this video player, based on the attributes of the MediaFile element",
	"405": "Problem displaying MediaFile Video player found a MediaFile with supported type but couldn’t display it MediaFile may include: unsupported codecs, different MIME type than MediaFile@type, unsupported delivery method, etc",
	"500": "General NonLinearAds error",
	"501": "Unable to display NonLinear Ad because creative dimensions do not align with creative display area (ie creative dimension too large)",
	"502": "Unable to fetch NonLinearAds/NonLinear resource",
	"503": "Couldn’t find NonLinear resource with supported type",
	"600": "General CompanionAds error",
	"601": "Unable to display Companion because creative dimensions do not fit within Companiondisplay area (ie, no available space)",
	"602": "Unable to display Required Companion",
	"603": "Unable to fetch CompanionAds/Companion resource",
	"604": "Couldn’t find Companion resource with supported type",
	"900": "Undefined Error",
	"901": "General VPAID error",
}

VASTErrorCodes list of standard vast errror codes

View Source
var VASTMacros = map[string]string{
	"Timestamp":           `[TIMESTAMP]`,
	"CacheBusting":        `[CACHEBUSTING]`,
	"ContentplayHead":     `[CONTENTPLAYHEAD]`,
	"MediaplayHead":       `[MEDIAPLAYHEAD]`,
	"BreakPosition":       `[BREAKPOSITION]`,
	"BlockedAdCategories": `[BLOCKEDADCATEGORIES]`,
	"AdCategories":        `[ADCATEGORIES]`,
	"AdCount":             `[ADCOUNT]`,
	"TransactionID":       `[TRANSACTIONID]`,
	"PlacementType":       `[PLACEMENTTYPE]`,
	"AdType":              `[ADTYPE]`,
	"UniversalAdID":       `[UNIVERSALADID]`,
	"IFA":                 `[IFA]`,
	"IFAtype":             `[IFATYPE]`,
	"ClientUA":            `[CLIENTUA]`,
	"ServerUA":            `[SERVERUA]`,
	"DeviceUA":            `[DEVICEUA]`,
	"DeviceIP":            `[DEVICEIP]`,
	"LatLong":             `[LATLONG]`,
	"Domain":              `[DOMAIN]`,
	"PageURL":             `[PAGEURL]`,
	"AppName":             `[APPNAME]`,
	"VastVersions":        `[VASTVERSIONS]`,
	"ApiFrameworks":       `[APIFRAMEWORKS]`,
	"Extensions":          `[EXTENSIONS]`,
	"VerificationVendors": `[VERIFICATIONVENDORS]`,
	"MediaMime":           `[MEDIAMIME]`,
	"PlayerCapabilities":  `[PLAYERCAPABILITIES]`,
	"ClickType":           `[CLICKTYPE]`,
	"PlayerState":         `[PLAYERSTATE]`,
	"PlayerSize":          `[PLAYERSIZE]`,
	"AdPlayHead":          `[ADPLAYHEAD]`,
	"AssetURI":            `[ASSETURI]`,
	"PodSequence":         `[PODSEQUENCE]`,
	"AdServingID":         `[ADSERVINGID]`,
	"ClickPos":            `[CLICKPOS]`,
	"ErrorCode":           `[ERRORCODE]`,
	"Reason":              `[REASON]`,
	"LimitAdTracking":     `[LIMITADTRACKING]`,
	"Regulations":         `[REGULATIONS]`,
	"GdprConsent":         `[GDPRCONSENT]`,
}

VASTMacros generic macros for VAST

Functions

func PushXML

func PushXML(w http.ResponseWriter, xml string)

PushXML push content with proper xml hdrs

func SetXMLHeaders

func SetXMLHeaders(w http.ResponseWriter)

SetXMLHeaders set the xml headers simply

Types

type Ad struct {
	ID            string   `xml:"id,attr,omitempty"`
	Sequence      string   `xml:"sequence,attr,omitempty"`
	ConditionalAd string   `xml:"conditionalAd,attr,omitempty"`
	InLine        *InLine  `xml:",omitempty"`
	Wrapper       *Wrapper `xml:",omitempty"`
}

Ad is an element of the VAST structure

type AdAttributes

type AdAttributes VastOptions

AdAttributes attrs for Ad object

type AdParameters

type AdParameters struct {
	ID         string `xml:"id,attr,omitempty"`
	XMLEncoded string `xml:"xmlEncoded,attr,omitempty"`
	Value      string `xml:",cdata"`
}

AdParameters vast ad params

type AdServingID

type AdServingID struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

AdServingID vast

type AdSystem

type AdSystem struct {
	Version string `xml:"version,attr,omitempty"`
	Value   string `xml:",cdata"`
}

AdSystem is an element of the VAST structure

type AdTitle

type AdTitle struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

AdTitle vast

type AdVerifications

type AdVerifications struct {
	Verification []*Verification `xml:",omitempty"`
}

AdVerifications list of Verification

type Advertiser

type Advertiser struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

Advertiser name of the advertiser

type AltText

type AltText struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

AltText vast ad params

type Category

type Category struct {
	ID        string `xml:"id,attr,omitempty"`
	Authority string `xml:"authority,attr,omitempty"`
	Value     string `xml:",cdata"`
}

Category name of the category in creative

type ClickThrough

type ClickThrough struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
	URL   []*URL `xml:",omitempty"`
}

ClickThrough vast url

type ClickTracking

type ClickTracking struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
	URL   []*URL `xml:",omitempty"`
}

ClickTracking vast url

type ClosedCaptionFile

type ClosedCaptionFile struct {
	ID       string `xml:"id,attr,omitempty"`
	Type     string `xml:"type,attr,omitempty"`
	Language string `xml:"language,attr,omitempty"`
	Value    string `xml:",cdata"`
	URL      []*URL `xml:",omitempty"`
}

ClosedCaptionFile vast element

type ClosedCaptionFiles

type ClosedCaptionFiles struct {
	ClosedCaptionFile []*ClosedCaptionFile `xml:",omitempty"`
}

ClosedCaptionFiles is an element list

type Code

type Code struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

Code vast element

type Companion

type Companion struct {
	ID                    string                 `xml:"id,attr,omitempty"`
	Width                 string                 `xml:"width,attr,omitempty"`
	Height                string                 `xml:"height,attr,omitempty"`
	AssetWidth            string                 `xml:"assetWidth,attr,omitempty"`
	AssetHeight           string                 `xml:"assetHeight,attr,omitempty"`
	ExpandedWidth         string                 `xml:"expandedWidth,attr,omitempty"`
	ExpandedHeight        string                 `xml:"expandedHeight,attr,omitempty"`
	APIFramework          string                 `xml:"apiFramework,attr,omitempty"`
	AdSlotID              string                 `xml:"adSlotID,attr,omitempty"`
	PxRatio               string                 `xml:"pxratio,attr,omitempty"`
	RenderingMode         string                 `xml:"renderingMode,attr,omitempty"`
	LogoTile              string                 `xml:"logoTile,attr,omitempty"`
	LogoTitle             string                 `xml:"logoTitle,attr,omitempty"`
	LogoURL               string                 `xml:"logoURL,attr,omitempty"`
	HTMLResource          *HTMLResource          `xml:",omitempty"`
	IFrameResource        *IFrameResource        `xml:",omitempty"`
	StaticResource        *StaticResource        `xml:",omitempty"`
	CompanionClickThrough *CompanionClickThrough `xml:",omitempty"`
	TrackingEvents        *TrackingEvents        `xml:",omitempty"`
	AdParameters          *AdParameters          `xml:",omitempty"`
	AltText               *AltText               `xml:",omitempty"`
}

Companion is an element of the VAST structure

type CompanionAds

type CompanionAds struct {
	Required  string       `xml:"required,attr,omitempty"`
	Companion []*Companion `xml:",omitempty"`
}

CompanionAds is an element list

type CompanionClickThrough

type CompanionClickThrough struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
	URL   []*URL `xml:",omitempty"`
}

CompanionClickThrough vast url

type Creative

type Creative struct {
	ID                 string              `xml:"id,attr,omitempty"`
	AdID               string              `xml:"adId,attr,omitempty"`
	Sequence           string              `xml:"sequence,attr,omitempty"`
	APIFramework       string              `xml:"apiFramework,attr,omitempty"`
	Linear             *Linear             `xml:",omitempty"`
	NonLinearAds       *NonLinearAds       `xml:",omitempty"`
	CompanionAds       *CompanionAds       `xml:",omitempty"`
	UniversalAdID      *UniversalAdID      `xml:"UniversalAdId,omitempty"`
	CreativeExtensions *CreativeExtensions `xml:",omitempty"`
}

Creative is an element of the VAST structure

type CreativeExtension

type CreativeExtension struct {
	Type  string `xml:"type,attr,omitempty"`
	Value string `xml:",cdata"`
}

CreativeExtension is an element

type CreativeExtensions

type CreativeExtensions struct {
	CreativeExtension []*CreativeExtension `xml:",omitempty"`
}

CreativeExtensions is an element list

type Creatives

type Creatives struct {
	Creative []*Creative `xml:"Creative,omitempty"`
}

Creatives is an element of the VAST structure

type CustomClick

type CustomClick struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
	URL   []*URL `xml:",omitempty"`
}

CustomClick vast url

type CustomTracking

type CustomTracking struct {
	Tracking []*Tracking `xml:",omitempty"`
}

CustomTracking is an element of the VAST structure

type CustomXML

type CustomXML struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

CustomXML ext custom

type Description

type Description struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

Description vast

type Duration

type Duration struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",chardata"`
}

Duration string representation of the creative in seconds

type ExecutableResource

type ExecutableResource struct {
	ID           string `xml:"id,attr,omitempty"`
	APIFramework string `xml:"apiFramework,attr,omitempty"`
	Value        string `xml:",cdata"`
}

ExecutableResource vast url for javascript res

type Expires

type Expires struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

Expires expiry in seconds

type Extension

type Extension struct {
	Type            string           `xml:"type,attr,omitempty"`
	FallbackIndex   string           `xml:"fallback_index,attr,omitempty"`
	TotalAvailable  *TotalAvailable  `xml:"total_available,omitempty"`
	Value           string           `xml:",cdata"`
	AdVerifications *AdVerifications `xml:",omitempty"`
	CustomTracking  *CustomTracking  `xml:",omitempty"`
}

Extension is an element of the VAST structure

type Extensions

type Extensions struct {
	Extension []*Extension `xml:",omitempty"`
}

Extensions is an element list

type FlashResource

type FlashResource struct {
	ID           string `xml:"id,attr,omitempty"`
	APIFramework string `xml:"apiFramework,attr,omitempty"`
	Value        string `xml:",cdata"`
}

FlashResource vast url for javascript res

type HTMLResource

type HTMLResource struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

HTMLResource source url

type HashExt

type HashExt []byte

HashExt is a raw encoded JSON value.

func (HashExt) MarshalJSON

func (e HashExt) MarshalJSON() ([]byte, error)

MarshalJSON returns e as the JSON encoding of e.

func (*HashExt) UnmarshalJSON

func (e *HashExt) UnmarshalJSON(data []byte) error

UnmarshalJSON sets *e to a copy of data.

type IFrameResource

type IFrameResource struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

IFrameResource source url

type Icon

type Icon struct {
	ID               string            `xml:"id,attr,omitempty"`
	Program          string            `xml:"program,attr,omitempty"`
	Width            string            `xml:"width,attr,omitempty"`
	Height           string            `xml:"height,attr,omitempty"`
	XPosition        string            `xml:"xPosition,attr,omitempty"`
	YPosition        string            `xml:"yPosition,attr,omitempty"`
	Duration         string            `xml:"duration,attr,omitempty"`
	Offset           string            `xml:"offset,attr,omitempty"`
	PxRatio          string            `xml:"pxratio,attr,omitempty"`
	APIFramework     string            `xml:"apiFramework,attr,omitempty"`
	HTMLResource     *HTMLResource     `xml:",omitempty"`
	IFrameResource   *IFrameResource   `xml:",omitempty"`
	StaticResource   *StaticResource   `xml:",omitempty"`
	IconClicks       *IconClicks       `xml:",omitempty"`
	IconViewTracking *IconViewTracking `xml:",omitempty"`
}

Icon is an element of the VAST structure

type IconClickThrough

type IconClickThrough struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
	URL   []*URL `xml:",omitempty"`
}

IconClickThrough vast url

type IconClickTracking

type IconClickTracking struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
	URL   []*URL `xml:",omitempty"`
}

IconClickTracking vast url

type IconClicks

type IconClicks struct {
	IconClickThrough  *IconClickThrough  `xml:",omitempty"`
	IconClickTracking *IconClickTracking `xml:",omitempty"`
}

IconClicks is an element of the VAST structure

type IconViewTracking

type IconViewTracking struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
	URL   []*URL `xml:",omitempty"`
}

IconViewTracking vast url

type Icons

type Icons struct {
	Icon []*Icon `xml:",omitempty"`
}

Icons is an element list

type Impression

type Impression struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
	URL   []*URL `xml:",omitempty"`
}

Impression vast url

type InLine

type InLine struct {
	InLineWrapperData
	ID string `xml:"id,attr,omitempty"`
}

InLine is an element of the VAST structure (LINEAR)

type InLineWrapperData

type InLineWrapperData struct {
	AdSystem           *AdSystem             `xml:",omitempty"`
	AdTitle            *AdTitle              `xml:",omitempty"`
	AdServingID        *AdServingID          `xml:"AdServingId,omitempty"`
	Description        *Description          `xml:",omitempty"`
	Survey             *Survey               `xml:",omitempty"`
	Error              *VASTError            `xml:",omitempty"`
	Impression         []*Impression         `xml:",omitempty"`
	ViewableImpression []*ViewableImpression `xml:",omitempty"`
	Creatives          *Creatives            `xml:",omitempty"`
	VASTAdTagURI       *VASTAdTagURI         `xml:",omitempty"`
	Extensions         *Extensions           `xml:",omitempty"`
	Pricing            *Pricing              `xml:",omitempty"`
	AdVerifications    *AdVerifications      `xml:",omitempty"`
	Advertiser         *Advertiser           `xml:",omitempty"`
	Category           []*Category           `xml:",omitempty"`
	Expires            *Expires              `xml:",omitempty"`
}

InLineWrapperData common data for InLine/Wrapper

type InteractiveCreativeFile

type InteractiveCreativeFile struct {
	ID               string `xml:"id,attr,omitempty"`
	APIFramework     string `xml:"apiFramework,attr,omitempty"`
	VariableDuration string `xml:"variableDuration,attr,omitempty"`
	Value            string `xml:",cdata"`
}

InteractiveCreativeFile creative is interactive

type JavaScriptResource

type JavaScriptResource struct {
	ID              string `xml:"id,attr,omitempty"`
	APIFramework    string `xml:"apiFramework,attr,omitempty"`
	BrowserOptional string `xml:"browserOptional,attr,omitempty"`
	Browser         string `xml:"browser,attr,omitempty"`
	Value           string `xml:",cdata"`
}

JavaScriptResource vast url for javascript res

type Linear

type Linear struct {
	SkipOffset     string          `xml:"skipoffset,attr,omitempty"`
	AdParameters   *AdParameters   `xml:",omitempty"`
	Duration       *Duration       `xml:",omitempty"`
	TrackingEvents *TrackingEvents `xml:",omitempty"`
	VideoClicks    *VideoClicks    `xml:",omitempty"`
	MediaFiles     *MediaFiles     `xml:",omitempty"`
	Icons          *Icons          `xml:",omitempty"`
}

Linear is an element of the VAST structure

type MediaFile

type MediaFile struct {
	ID                  string `xml:"id,attr,omitempty"`
	Delivery            string `xml:"delivery,attr,omitempty"`
	Type                string `xml:"type,attr,omitempty"`
	Width               string `xml:"width,attr,omitempty"`
	Height              string `xml:"height,attr,omitempty"`
	Bitrate             string `xml:"bitrate,attr,omitempty"`
	MinBitrate          string `xml:"minBitrate,attr,omitempty"`
	MaxBitrate          string `xml:"maxBitrate,attr,omitempty"`
	Scalable            string `xml:"scalable,attr,omitempty"`
	MaintainAspectRatio string `xml:"maintainAspectRatio,attr,omitempty"`
	Codec               string `xml:"codec,attr,omitempty"`
	APIFramework        string `xml:"apiFramework,attr,omitempty"`
	MediaType           string `xml:"mediaType,attr,omitempty"`
	Value               string `xml:",cdata"`
}

MediaFile is an element of the VAST structure

type MediaFiles

type MediaFiles struct {
	MediaFile               []*MediaFile             `xml:",omitempty"`
	Mezzanine               *Mezzanine               `xml:",omitempty"`
	InteractiveCreativeFile *InteractiveCreativeFile `xml:",omitempty"`
	ClosedCaptionFiles      *ClosedCaptionFiles      `xml:",omitempty"`
}

MediaFiles is an element list

type Mezzanine

type Mezzanine struct {
	ID        string `xml:"id,attr,omitempty"`
	Delivery  string `xml:"delivery,attr,omitempty"`
	Type      string `xml:"type,attr,omitempty"`
	Width     string `xml:"width,attr,omitempty"`
	Height    string `xml:"height,attr,omitempty"`
	Codec     string `xml:"codec,attr,omitempty"`
	FileSize  string `xml:"fileSize,attr,omitempty"`
	MediaType string `xml:"mediaType,attr,omitempty"`
	Value     string `xml:",cdata"`
}

Mezzanine vast url

type NonLinear

type NonLinear struct {
	ID                     string                  `xml:"id,attr,omitempty"`
	APIFramework           string                  `xml:"apiFramework,attr,omitempty"`
	Height                 string                  `xml:"height,attr,omitempty"`
	Width                  string                  `xml:"width,attr,omitempty"`
	MinSuggestedDuration   string                  `xml:"minSuggestedDuration,attr,omitempty"`
	Scalable               string                  `xml:"scalable,attr,omitempty"`
	MaintainAspectRatio    string                  `xml:"maintainAspectRatio,attr,omitempty"`
	StaticResource         *StaticResource         `xml:",omitempty"`
	NonLinearClickThrough  *NonLinearClickThrough  `xml:",omitempty"`
	NonLinearClickTracking *NonLinearClickTracking `xml:",omitempty"`
	URL                    []*URL                  `xml:",omitempty"`
}

NonLinear is an element of the VAST structure

type NonLinearAds

type NonLinearAds struct {
	TrackingEvents *TrackingEvents `xml:",omitempty"`
	NonLinear      []*NonLinear    `xml:",omitempty"`
}

NonLinearAds is an element of the VAST structure

type NonLinearClickThrough

type NonLinearClickThrough struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
	URL   []*URL `xml:",omitempty"`
}

NonLinearClickThrough vast url

type NonLinearClickTracking

type NonLinearClickTracking struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
	URL   []*URL `xml:",omitempty"`
}

NonLinearClickTracking vast url

type NotViewable

type NotViewable struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

NotViewable creative cant be viewed

type Pricing

type Pricing struct {
	ID       string `xml:"id,attr,omitempty"`
	Model    string `xml:"model,attr,omitempty"`
	Currency string `xml:"currency,attr,omitempty"`
	Value    string `xml:",cdata"`
}

Pricing price tag of the vast creative

type StaticResource

type StaticResource struct {
	CreativeType string `xml:"creativeType,attr,omitempty"`
	Value        string `xml:",cdata"`
}

StaticResource is an element of the VAST structure

type Survey

type Survey struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

Survey vast

type TotalAvailable

type TotalAvailable struct {
	Value string `xml:",cdata"`
}

TotalAvailable total avail count

type Tracking

type Tracking struct {
	Event  string `xml:"event,attr,omitempty"`
	Offset string `xml:"offset,attr,omitempty"`
	Value  string `xml:",cdata"`
	URL    []*URL `xml:",omitempty"`
}

Tracking is an element of the VAST structure

type TrackingEvents

type TrackingEvents struct {
	Tracking []*Tracking `xml:",omitempty"`
}

TrackingEvents is an element of the VAST structure

type URL

type URL struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

URL vast

type UniversalAdID

type UniversalAdID struct {
	ID         string `xml:"id,attr,omitempty"`
	IDRegistry string `xml:"idRegistry,attr,omitempty"`
	IDValue    string `xml:"idValue,attr,omitempty"`
	Value      string `xml:",cdata"`
}

UniversalAdID ad id

type VAST

type VAST struct {
	Version string `xml:"version,attr,omitempty"`
	XMLNs   string `xml:"xmlns,attr,omitempty"`
	XMLNsXs string `xml:"xmlns:xs,attr,omitempty"`
	Ad      []*Ad  `xml:",omitempty"`
}

VAST the root element of the XML

func InLineAd

func InLineAd(attrs AdAttributes, adSystem *AdSystem, title *AdTitle, desc *Description, verr *VASTError, imps []*Impression, creatives *Creatives) (req *VAST)

InLineAd inline ad template

func NewVAST

func NewVAST(version string) *VAST

NewVAST get instance on VAST object

func WrapperAd

func WrapperAd(attrs AdAttributes, adSystem *AdSystem, title *AdTitle, desc *Description, verr *VASTError, imps []*Impression, creatives *Creatives, adURI *VASTAdTagURI) (req *VAST)

WrapperAd wrapper ad template

func (*VAST) FormatAd

func (v *VAST) FormatAd() *VAST

FormatAd set the minimum Ad

func (*VAST) FormatAdAttrs

func (v *VAST) FormatAdAttrs(attrs AdAttributes)

FormatAdAttrs sync all possible options/attrs

func (*VAST) FormatCreativeWithNonLinearAds

func (v *VAST) FormatCreativeWithNonLinearAds(s string) *VAST

FormatCreativeWithNonLinearAds prep if no nonlinearads

func (*VAST) FromFile

func (v *VAST) FromFile(filename string)

FromFile load from file

func (*VAST) FromString

func (v *VAST) FromString(body string)

FromString load and unmarshal from string

func (*VAST) FromXML

func (v *VAST) FromXML(body string)

FromXML an alias to FromString

func (*VAST) GetAdPos

func (v *VAST) GetAdPos() int

GetAdPos get the last index

func (*VAST) GetAds

func (v *VAST) GetAds() []*Ad

GetAds get the list of ads

func (*VAST) GetAdsAdServing

func (v *VAST) GetAdsAdServing() map[string][]*AdServingID

GetAdsAdServing get the list of all AdServingID

func (*VAST) GetAdsAdSystem

func (v *VAST) GetAdsAdSystem() map[string][]*AdSystem

GetAdsAdSystem get the list of all AdSystem

func (*VAST) GetAdsAdTitle

func (v *VAST) GetAdsAdTitle() map[string][]*AdTitle

GetAdsAdTitle get the list of all AdTitle

func (*VAST) GetAdsAdVerification

func (v *VAST) GetAdsAdVerification() map[string][]*Verification

GetAdsAdVerification get the list of all AdVerifications.Verification

func (*VAST) GetAdsAdVerificationExecutableResource

func (v *VAST) GetAdsAdVerificationExecutableResource() map[string][]*ExecutableResource

GetAdsAdVerificationExecutableResource get the list of all AdVerifications.Verification.ExecutableResource

func (*VAST) GetAdsAdVerificationFlashResource

func (v *VAST) GetAdsAdVerificationFlashResource() map[string][]*FlashResource

GetAdsAdVerificationFlashResource get the list of all AdVerifications.Verification.FlashResource

func (*VAST) GetAdsAdVerificationJavaScriptResource

func (v *VAST) GetAdsAdVerificationJavaScriptResource() map[string][]*JavaScriptResource

GetAdsAdVerificationJavaScriptResource get the list of all AdVerifications.Verification.JavaScriptResource

func (*VAST) GetAdsAdVerificationNotViewable

func (v *VAST) GetAdsAdVerificationNotViewable() map[string][]*NotViewable

GetAdsAdVerificationNotViewable get the list of all AdVerifications.Verification.ViewableImpression.NotViewable

func (*VAST) GetAdsAdVerificationTracking

func (v *VAST) GetAdsAdVerificationTracking() map[string][]*Tracking

GetAdsAdVerificationTracking get the list of all AdVerifications.Verification.TrackingEvents.Tracking

func (*VAST) GetAdsAdVerificationVerificationParameters

func (v *VAST) GetAdsAdVerificationVerificationParameters() map[string][]*VerificationParameters

GetAdsAdVerificationVerificationParameters get the list of all AdVerifications.Verification.VerificationParameters

func (*VAST) GetAdsAdVerificationViewUndetermined

func (v *VAST) GetAdsAdVerificationViewUndetermined() map[string][]*ViewUndetermined

GetAdsAdVerificationViewUndetermined get the list of all AdVerifications.Verification.ViewableImpression.ViewUndetermined

func (*VAST) GetAdsAdVerificationViewable

func (v *VAST) GetAdsAdVerificationViewable() map[string][]*Viewable

GetAdsAdVerificationViewable get the list of all AdVerifications.Verification.ViewableImpression.Viewable

func (*VAST) GetAdsAdVerificationViewableImpression

func (v *VAST) GetAdsAdVerificationViewableImpression() map[string][]*ViewableImpression

GetAdsAdVerificationViewableImpression get the list of all AdVerifications.Verification.ViewableImpression

func (*VAST) GetAdsAdVerifications

func (v *VAST) GetAdsAdVerifications() map[string][]*AdVerifications

GetAdsAdVerifications get the list of all AdVerifications

func (*VAST) GetAdsAdvertiser

func (v *VAST) GetAdsAdvertiser() map[string][]*Advertiser

GetAdsAdvertiser get the list of all Advertiser

func (*VAST) GetAdsCategory

func (v *VAST) GetAdsCategory() map[string][]*Category

GetAdsCategory get the list of all Category

func (*VAST) GetAdsCreative

func (v *VAST) GetAdsCreative() map[string][]*Creative

GetAdsCreative get the list of all Creative

func (*VAST) GetAdsCreativeCompanion

func (v *VAST) GetAdsCreativeCompanion() map[string][]*Companion

GetAdsCreativeCompanion get the list of all Creative.CompanionAds.Companion

func (*VAST) GetAdsCreativeCompanionAdParameters

func (v *VAST) GetAdsCreativeCompanionAdParameters() map[string][]*AdParameters

GetAdsCreativeCompanionAdParameters get the list of all Creative.CompanionAds.Companion.AdParameters

func (*VAST) GetAdsCreativeCompanionAds

func (v *VAST) GetAdsCreativeCompanionAds() map[string][]*CompanionAds

GetAdsCreativeCompanionAds get the list of all Creative.CompanionAds

func (*VAST) GetAdsCreativeCompanionAltText

func (v *VAST) GetAdsCreativeCompanionAltText() map[string][]*AltText

GetAdsCreativeCompanionAltText get the list of all Creative.CompanionAds.Companion.AltText

func (*VAST) GetAdsCreativeCompanionClickThrough

func (v *VAST) GetAdsCreativeCompanionClickThrough() map[string][]*CompanionClickThrough

GetAdsCreativeCompanionClickThrough get the list of all Creative.CompanionAds.Companion.CompanionClickThrough

func (*VAST) GetAdsCreativeCompanionHTMLResource

func (v *VAST) GetAdsCreativeCompanionHTMLResource() map[string][]*HTMLResource

GetAdsCreativeCompanionHTMLResource get the list of all Creative.CompanionAds.Companion.HTMLResource

func (*VAST) GetAdsCreativeCompanionIFrameResource

func (v *VAST) GetAdsCreativeCompanionIFrameResource() map[string][]*IFrameResource

GetAdsCreativeCompanionIFrameResource get the list of all Creative.CompanionAds.Companion.IFrameResource

func (*VAST) GetAdsCreativeCompanionStaticResource

func (v *VAST) GetAdsCreativeCompanionStaticResource() map[string][]*StaticResource

GetAdsCreativeCompanionStaticResource get the list of all Creative.CompanionAds.Companion.StaticResource

func (*VAST) GetAdsCreativeCompanionTracking

func (v *VAST) GetAdsCreativeCompanionTracking() map[string][]*Tracking

GetAdsCreativeCompanionTracking get the list of all Creative.CompanionAds.Companion.TrackingEvents.Tracking

func (*VAST) GetAdsCreativeExtension

func (v *VAST) GetAdsCreativeExtension() map[string][]*CreativeExtension

GetAdsCreativeExtension get the list of all Creative.CreativeExtensions.CreativeExtension

func (*VAST) GetAdsCreativeExtensions

func (v *VAST) GetAdsCreativeExtensions() map[string][]*CreativeExtensions

GetAdsCreativeExtensions get the list of all Creative.CreativeExtensions

func (*VAST) GetAdsCreativeLinear

func (v *VAST) GetAdsCreativeLinear() map[string][]*Linear

GetAdsCreativeLinear get the list of all Creative.Linear

func (*VAST) GetAdsCreativeLinearClosedCaptionFile

func (v *VAST) GetAdsCreativeLinearClosedCaptionFile() map[string][]*ClosedCaptionFile

GetAdsCreativeLinearClosedCaptionFile get the list of all Creative.Linear.MediaFiles.ClosedCaptionFiles.ClosedCaptionFile

func (*VAST) GetAdsCreativeLinearClosedCaptionFiles

func (v *VAST) GetAdsCreativeLinearClosedCaptionFiles() map[string][]*ClosedCaptionFiles

GetAdsCreativeLinearClosedCaptionFiles get the list of all Creative.Linear.MediaFiles.ClosedCaptionFiles

func (*VAST) GetAdsCreativeLinearDuration

func (v *VAST) GetAdsCreativeLinearDuration() map[string][]*Duration

GetAdsCreativeLinearDuration get the list of all Creative.Linear.Duration

func (*VAST) GetAdsCreativeLinearIcon

func (v *VAST) GetAdsCreativeLinearIcon() map[string][]*Icon

GetAdsCreativeLinearIcon get the list of all Creative.Linear.Icons.Icon

func (*VAST) GetAdsCreativeLinearIcons

func (v *VAST) GetAdsCreativeLinearIcons() map[string][]*Icons

GetAdsCreativeLinearIcons get the list of all Creative.Linear.Icons

func (*VAST) GetAdsCreativeLinearInteractiveCreativeFile

func (v *VAST) GetAdsCreativeLinearInteractiveCreativeFile() map[string][]*InteractiveCreativeFile

GetAdsCreativeLinearInteractiveCreativeFile get the list of all Creative.Linear.MediaFiles.InteractiveCreativeFile

func (*VAST) GetAdsCreativeLinearMediaFile

func (v *VAST) GetAdsCreativeLinearMediaFile() map[string][]*MediaFile

GetAdsCreativeLinearMediaFile get the list of all Creative.Linear.MediaFiles.MediaFile

func (*VAST) GetAdsCreativeLinearMediaFiles

func (v *VAST) GetAdsCreativeLinearMediaFiles() map[string][]*MediaFiles

GetAdsCreativeLinearMediaFiles get the list of all Creative.Linear.MediaFiles

func (*VAST) GetAdsCreativeLinearMezzanine

func (v *VAST) GetAdsCreativeLinearMezzanine() map[string][]*Mezzanine

GetAdsCreativeLinearMezzanine get the list of all Creative.Linear.MediaFiles.Mezzanine

func (*VAST) GetAdsCreativeLinearTracking

func (v *VAST) GetAdsCreativeLinearTracking() map[string][]*Tracking

GetAdsCreativeLinearTracking get the list of all Creative.Linear.TrackingEvents.Tracking

func (*VAST) GetAdsCreativeLinearTrackingEvents

func (v *VAST) GetAdsCreativeLinearTrackingEvents() map[string][]*TrackingEvents

GetAdsCreativeLinearTrackingEvents get the list of all Creative.Linear.TrackingEvents

func (*VAST) GetAdsCreativeLinearVideoClickThrough

func (v *VAST) GetAdsCreativeLinearVideoClickThrough() map[string][]*ClickThrough

GetAdsCreativeLinearVideoClickThrough get the list of all Creative.Linear.VideoClicks.ClickThrough

func (*VAST) GetAdsCreativeLinearVideoClickTracking

func (v *VAST) GetAdsCreativeLinearVideoClickTracking() map[string][]*ClickTracking

GetAdsCreativeLinearVideoClickTracking get the list of all Creative.Linear.VideoClicks.ClickTracking

func (*VAST) GetAdsCreativeLinearVideoClicks

func (v *VAST) GetAdsCreativeLinearVideoClicks() map[string][]*VideoClicks

GetAdsCreativeLinearVideoClicks get the list of all Creative.Linear.VideoClicks

func (*VAST) GetAdsCreativeLinearVideoCustomClick

func (v *VAST) GetAdsCreativeLinearVideoCustomClick() map[string][]*CustomClick

GetAdsCreativeLinearVideoCustomClick get the list of all Creative.Linear.VideoClicks.CustomClick

func (*VAST) GetAdsCreativeNonLinear

func (v *VAST) GetAdsCreativeNonLinear() map[string][]*NonLinear

GetAdsCreativeNonLinear get the list of all Creative.NonLinearAds.NonLinear

func (*VAST) GetAdsCreativeNonLinearAds

func (v *VAST) GetAdsCreativeNonLinearAds() map[string][]*NonLinearAds

GetAdsCreativeNonLinearAds get the list of all Creative.NonLinearAds

func (*VAST) GetAdsCreativeNonLinearClickThrough

func (v *VAST) GetAdsCreativeNonLinearClickThrough() map[string][]*NonLinearClickThrough

GetAdsCreativeNonLinearClickThrough get the list of all Creative.NonLinearAds.NonLinear.NonLinearClickThrough

func (*VAST) GetAdsCreativeNonLinearClickTracking

func (v *VAST) GetAdsCreativeNonLinearClickTracking() map[string][]*NonLinearClickTracking

GetAdsCreativeNonLinearClickTracking get the list of all Creative.NonLinearAds.NonLinear.NonLinearClickTracking

func (*VAST) GetAdsCreativeNonLinearStaticResource

func (v *VAST) GetAdsCreativeNonLinearStaticResource() map[string][]*StaticResource

GetAdsCreativeNonLinearStaticResource get the list of all Creative.NonLinearAds.NonLinear.StaticResource

func (*VAST) GetAdsCreativeNonLinearTracking

func (v *VAST) GetAdsCreativeNonLinearTracking() map[string][]*Tracking

GetAdsCreativeNonLinearTracking get the list of all Creative.NonLinearAds.TrackingEvents.Tracking

func (*VAST) GetAdsCreativeUniversalAd

func (v *VAST) GetAdsCreativeUniversalAd() map[string][]*UniversalAdID

GetAdsCreativeUniversalAd get the list of all Creative.UniversalAdID

func (*VAST) GetAdsCreatives

func (v *VAST) GetAdsCreatives() map[string][]*Creatives

GetAdsCreatives get the list of all Creatives

func (*VAST) GetAdsDescription

func (v *VAST) GetAdsDescription() map[string][]*Description

GetAdsDescription get the list of all Description

func (*VAST) GetAdsError

func (v *VAST) GetAdsError() map[string][]*VASTError

GetAdsError get the list of all VASTError

func (*VAST) GetAdsErrorURL

func (v *VAST) GetAdsErrorURL() map[string][]*VASTError

GetAdsErrorURL get the list of all VASTError

func (*VAST) GetAdsExpires

func (v *VAST) GetAdsExpires() map[string][]*Expires

GetAdsExpires get the list of all Expires

func (*VAST) GetAdsExtension

func (v *VAST) GetAdsExtension() map[string][]*Extension

GetAdsExtension get the list of all Extensions.Extension

func (*VAST) GetAdsExtensionAdVerification

func (v *VAST) GetAdsExtensionAdVerification() map[string][]*Verification

GetAdsExtensionAdVerification get the list of all Extensions.Extension.AdVerifications.Verification

func (*VAST) GetAdsExtensionCustomTracking

func (v *VAST) GetAdsExtensionCustomTracking() map[string][]*Tracking

GetAdsExtensionCustomTracking get the list of all Extensions.Extension.CustomTracking.Tracking

func (*VAST) GetAdsExtensionTotalAvailable

func (v *VAST) GetAdsExtensionTotalAvailable() map[string][]*TotalAvailable

GetAdsExtensionTotalAvailable get the list of all Extensions.Extension.TotalAvailable

func (*VAST) GetAdsExtensions

func (v *VAST) GetAdsExtensions() map[string][]*Extensions

GetAdsExtensions get the list of all Extensions

func (*VAST) GetAdsImpression

func (v *VAST) GetAdsImpression() map[string][]*Impression

GetAdsImpression get the list of all Impression

func (*VAST) GetAdsInLine

func (v *VAST) GetAdsInLine() []*InLine

GetAdsInLine get the list of all inline

func (*VAST) GetAdsNotViewable

func (v *VAST) GetAdsNotViewable() map[string][]*NotViewable

GetAdsNotViewable get the list of all Viewable

func (*VAST) GetAdsPricing

func (v *VAST) GetAdsPricing() map[string][]*Pricing

GetAdsPricing get the list of all Pricing

func (*VAST) GetAdsSurvey

func (v *VAST) GetAdsSurvey() map[string][]*Survey

GetAdsSurvey get the list of all Survey

func (*VAST) GetAdsVASTAdTagURI

func (v *VAST) GetAdsVASTAdTagURI() map[string][]*VASTAdTagURI

GetAdsVASTAdTagURI get the list of all VASTAdTagURI

func (*VAST) GetAdsViewUndetermined

func (v *VAST) GetAdsViewUndetermined() map[string][]*ViewUndetermined

GetAdsViewUndetermined get the list of all Viewable

func (*VAST) GetAdsViewable

func (v *VAST) GetAdsViewable() map[string][]*Viewable

GetAdsViewable get the list of all Viewable

func (*VAST) GetAdsViewableImpression

func (v *VAST) GetAdsViewableImpression() map[string][]*ViewableImpression

GetAdsViewableImpression get the list of all ViewableImpression

func (*VAST) GetAdsViewableImpressionNotViewable

func (v *VAST) GetAdsViewableImpressionNotViewable() map[string][]*NotViewable

GetAdsViewableImpressionNotViewable get the list of all ViewableImpression.NotViewable

func (*VAST) GetAdsViewableImpressionViewUndetermined

func (v *VAST) GetAdsViewableImpressionViewUndetermined() map[string][]*ViewUndetermined

GetAdsViewableImpressionViewUndetermined get the list of all ViewableImpression.ViewUndetermined

func (*VAST) GetAdsViewableImpressionViewable

func (v *VAST) GetAdsViewableImpressionViewable() map[string][]*Viewable

GetAdsViewableImpressionViewable get the list of all ViewableImpression.Viewable

func (*VAST) GetAdsWrapper

func (v *VAST) GetAdsWrapper() []*Wrapper

GetAdsWrapper get the list of all wrapper

func (*VAST) IsAdHasCreatives

func (v *VAST) IsAdHasCreatives(s string) bool

IsAdHasCreatives check if creative element is valid

func (*VAST) IsAdInLine

func (v *VAST) IsAdInLine() bool

IsAdInLine check ad type

func (*VAST) IsAdWrapper

func (v *VAST) IsAdWrapper() bool

IsAdWrapper check ad type

func (*VAST) LenCreative

func (v *VAST) LenCreative(s string) int

LenCreative get total length of creatives.creative

func (*VAST) LenCreativeNonLinear

func (v *VAST) LenCreativeNonLinear(s string) int

LenCreativeNonLinear prep if no nonlinearads

func (*VAST) SetAd

func (v *VAST) SetAd(adVersion, adID, adSequence, adConditional string) *VAST

SetAd set the minimum Ad

func (*VAST) SetAdServing

func (v *VAST) SetAdServing(adID, adValue string) *VAST

SetAdServing set the AdServingID

func (*VAST) SetAdSystem

func (v *VAST) SetAdSystem(s string) *VAST

SetAdSystem set the AdSystem

func (*VAST) SetAdTitle

func (v *VAST) SetAdTitle(s string) *VAST

SetAdTitle set the AdTitle

func (*VAST) SetAdvertiser

func (v *VAST) SetAdvertiser(s string) *VAST

SetAdvertiser set the Advertiser

func (*VAST) SetCategory

func (v *VAST) SetCategory(sID, sAuth, sValue string) *VAST

SetCategory add into the list of Category

func (*VAST) SetCompanion

func (v *VAST) SetCompanion(sID, sWidth, sHeight, sAltText, sAssetWidth, sAssetHeight, sExpandedWidth, sExpandedHeight, sAPIFramework, sAdSlotID, sPxRatio string) *VAST

SetCompanion add into the CompanionAds.Companion obj

func (*VAST) SetCompanionAd

func (v *VAST) SetCompanionAd(row *CompanionAds) *VAST

SetCompanionAd add into the CompanionAds obj

func (*VAST) SetCompanionClickThrough

func (v *VAST) SetCompanionClickThrough(sID, sValue string) *VAST

SetCompanionClickThrough add into the CompanionAds.Companion.CompanionClickThrough obj

func (*VAST) SetCompanionHTMLResource

func (v *VAST) SetCompanionHTMLResource(sID, sValue string) *VAST

SetCompanionHTMLResource add into the CompanionAds.Companion.HTMLResource obj

func (*VAST) SetCompanionIFrameResource

func (v *VAST) SetCompanionIFrameResource(sID, sValue string) *VAST

SetCompanionIFrameResource add into the CompanionAds.Companion.IFrameResource obj

func (*VAST) SetCompanionStaticResource

func (v *VAST) SetCompanionStaticResource(sType, sValue string) *VAST

SetCompanionStaticResource add into the CompanionAds.Companion.StaticResource obj

func (*VAST) SetCompanionTracking

func (v *VAST) SetCompanionTracking(sEvent, sOffset, sValue string) *VAST

SetCompanionTracking add into the CompanionAds.Companion.TrackingEvents obj

func (*VAST) SetCreative

func (v *VAST) SetCreative(sID, sAdID, sSequence, sFramework string) *VAST

SetCreative add into the list of Creative

func (*VAST) SetCreativeRow

func (v *VAST) SetCreativeRow(sID, sAdID, sSequence, sFramework string, linear *Linear, nonLinear *NonLinearAds, companion *CompanionAds, universal *UniversalAdID) *VAST

SetCreativeRow add into the list of Creative

func (*VAST) SetDescription

func (v *VAST) SetDescription(s string) *VAST

SetDescription set the Description

func (*VAST) SetErrorURL

func (v *VAST) SetErrorURL(s string) *VAST

SetErrorURL set the Error URL

func (*VAST) SetExtension

func (v *VAST) SetExtension(sType, sValue string, total *TotalAvailable, adverifications *AdVerifications) *VAST

SetExtension add into the list of Extension

func (*VAST) SetExtensionAdVerification

func (v *VAST) SetExtensionAdVerification(js *JavaScriptResource, vp *VerificationParameters, tk *TrackingEvents) *VAST

SetExtensionAdVerification add into the list of Extension.AdVerifications.Verification

func (*VAST) SetExtensionJavaScriptResource

func (v *VAST) SetExtensionJavaScriptResource(sID, sValue string) *VAST

SetExtensionJavaScriptResource add into the list of Extension.AdVerifications.Verification.JavaScriptResource

func (*VAST) SetExtensionTotalAvailable

func (v *VAST) SetExtensionTotalAvailable(sValue string) *VAST

SetExtensionTotalAvailable add into the list of Extension.TotalAvailable

func (*VAST) SetExtensionTracking

func (v *VAST) SetExtensionTracking(sEvent, sOffset, sValue string) *VAST

SetExtensionTracking add into the list of Extension.AdVerifications.Verification.TrackingEvents.Tracking

func (*VAST) SetExtensionVerificationParameters

func (v *VAST) SetExtensionVerificationParameters(sID, sValue string) *VAST

SetExtensionVerificationParameters add into the list of Extension.AdVerifications.Verification.VerificationParameters

func (*VAST) SetImpression

func (v *VAST) SetImpression(impID, impURL string) *VAST

SetImpression set the Impression URL

func (*VAST) SetImpressionURL

func (v *VAST) SetImpressionURL(impID, impURL string) *VAST

SetImpressionURL set the Impression URL

func (*VAST) SetInLineAd

func (v *VAST) SetInLineAd(inlineID string) *VAST

SetInLineAd set the minimum InLineAd

func (*VAST) SetLinear

func (v *VAST) SetLinear(row *Linear) *VAST

SetLinear add into the Linear obj

func (*VAST) SetLinearClickThrough

func (v *VAST) SetLinearClickThrough(sID, sValue string) *VAST

SetLinearClickThrough add into the Linear.VideoClicks.ClickThrough obj

func (*VAST) SetLinearClickTracking

func (v *VAST) SetLinearClickTracking(sID, sValue string) *VAST

SetLinearClickTracking add into the Linear.VideoClicks.ClickTracking obj

func (*VAST) SetLinearCustomClick

func (v *VAST) SetLinearCustomClick(sID, sValue string) *VAST

SetLinearCustomClick add into the Linear.VideoClicks.CustomClick obj

func (*VAST) SetLinearDuration

func (v *VAST) SetLinearDuration(sID, sValue string) *VAST

SetLinearDuration add into the Linear.Duration obj

func (*VAST) SetLinearInteractiveCreativeFile

func (v *VAST) SetLinearInteractiveCreativeFile(sID, sValue string) *VAST

SetLinearInteractiveCreativeFile add into the Linear.MediaFiles.InteractiveCreativeFile obj

func (*VAST) SetLinearMediaFile

func (v *VAST) SetLinearMediaFile(sID, sValue, sDelivery, sType, sWidth, sHeight, sBitrate, sMinBitrate, sMaxBitrate, sScalable, sMaintainAspectRatio, sCodec, sAPIFramework string) *VAST

SetLinearMediaFile add into the Linear.MediaFiles.MediaFile obj

func (*VAST) SetLinearMezzanine

func (v *VAST) SetLinearMezzanine(sID, sValue string) *VAST

SetLinearMezzanine add into the Linear.MediaFiles.Mezzanine obj

func (*VAST) SetLinearTracking

func (v *VAST) SetLinearTracking(sEvent, sOffset, sValue string) *VAST

SetLinearTracking add into the Linear.TrackingEvents.Tracking obj

func (*VAST) SetNonLinear

func (v *VAST) SetNonLinear(row *NonLinearAds) *VAST

SetNonLinear add into the NonLinearAds obj

func (*VAST) SetNonLinearAd

func (v *VAST) SetNonLinearAd(sID, sAPIFramework, sWidth, sHeight, sMinSuggestedDuration, sScalable, sMaintainAspectRatio string) *VAST

SetNonLinearAd add into the NonLinearAds.NonLinear obj

func (*VAST) SetNonLinearClickThrough

func (v *VAST) SetNonLinearClickThrough(sID, sValue string) *VAST

SetNonLinearClickThrough add into the NonLinearAds.NonLinear.NonLinearClickThrough obj

func (*VAST) SetNonLinearClickTracking

func (v *VAST) SetNonLinearClickTracking(sID, sValue string) *VAST

SetNonLinearClickTracking add into the NonLinearAds.NonLinear.NonLinearClickTracking obj

func (*VAST) SetNonLinearStaticResource

func (v *VAST) SetNonLinearStaticResource(sType, sValue string) *VAST

SetNonLinearStaticResource add into the NonLinearAds.NonLinear.StaticResource obj

func (*VAST) SetNonLinearTracking

func (v *VAST) SetNonLinearTracking(sEvent, sOffset, sValue string) *VAST

SetNonLinearTracking add into the NonLinearAds.TrackingEvents obj

func (*VAST) SetPricing

func (v *VAST) SetPricing(adID, adModel, adCurr, adValue string) *VAST

SetPricing set the Pricing

func (*VAST) SetSurvey

func (v *VAST) SetSurvey(s string) *VAST

SetSurvey set the Survey

func (*VAST) SetUniversalAd

func (v *VAST) SetUniversalAd(sID, sIDRegistry, sIDValue, sValue string) *VAST

SetUniversalAd add into the UniversalAdID obj

func (*VAST) SetVASTAdTagURI

func (v *VAST) SetVASTAdTagURI(adID, adValue string) *VAST

SetVASTAdTagURI set the VASTAdTagURI

func (*VAST) SetVerification

func (v *VAST) SetVerification(jscript *JavaScriptResource, verificationp *VerificationParameters, trkevents *TrackingEvents) *VAST

SetVerification add into the list of Verification

func (*VAST) SetVerificationJavaScriptResource

func (v *VAST) SetVerificationJavaScriptResource(sID, sValue string) *VAST

SetVerificationJavaScriptResource add into the list of Verification.JavaScriptResource

func (*VAST) SetVerificationTracking

func (v *VAST) SetVerificationTracking(sEvent, sOffset, sValue string) *VAST

SetVerificationTracking add into the list of Verification.TrackingEvents.Tracking

func (*VAST) SetVerificationVerificationParameters

func (v *VAST) SetVerificationVerificationParameters(sID, sValue string) *VAST

SetVerificationVerificationParameters add into the list of Verification.VerificationParameters

func (*VAST) SetVersion

func (v *VAST) SetVersion(version string) *VAST

SetVersion set the VAST version

func (*VAST) SetViewableImpression

func (v *VAST) SetViewableImpression(sID string, viewable *Viewable, notviewable *NotViewable, undetermined *ViewUndetermined) *VAST

SetViewableImpression add into the list of ViewableImpression

func (*VAST) SetViewableImpressionNotViewable

func (v *VAST) SetViewableImpressionNotViewable(sID, sValue string) *VAST

SetViewableImpressionNotViewable add into the list of ViewableImpression.NotViewable

func (*VAST) SetViewableImpressionViewUndetermined

func (v *VAST) SetViewableImpressionViewUndetermined(sID, sValue string) *VAST

SetViewableImpressionViewUndetermined add into the list of ViewableImpression.ViewUndetermined

func (*VAST) SetViewableImpressionViewable

func (v *VAST) SetViewableImpressionViewable(sID, sValue string) *VAST

SetViewableImpressionViewable add into the list of ViewableImpression.Viewable

func (*VAST) SetWrapperAd

func (v *VAST) SetWrapperAd(wrapperID, followAdditionalWrappers, allowMultipleAds, fallbackOnNoAd string) *VAST

SetWrapperAd set the minimum WrapperAd

func (*VAST) Stringify

func (v *VAST) Stringify() (string, error)

Stringify an alias to ToString

func (*VAST) ToFile

func (v *VAST) ToFile(filename, body string) (bool, error)

ToFile save the xml into a file

func (*VAST) ToJSON

func (v *VAST) ToJSON() (string, error)

ToJSON convert to string

func (*VAST) ToString

func (v *VAST) ToString() (string, error)

ToString convert to string

func (*VAST) ToXML

func (v *VAST) ToXML() (string, error)

ToXML an alias to ToString

func (*VAST) VideoDuration

func (v *VAST) VideoDuration(secs int) *Duration

VideoDuration convert duration seconds

type VASTAdTagURI

type VASTAdTagURI struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

VASTAdTagURI URL of the wrapper

type VASTError

type VASTError struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

VASTError error url

type VastOptions

type VastOptions map[string]string

VastOptions attrs generic

type Verification

type Verification struct {
	ID                     string                  `xml:"id,attr,omitempty"`
	Vendor                 string                  `xml:"vendor,attr,omitempty"`
	JavaScriptResource     *JavaScriptResource     `xml:",omitempty"`
	VerificationParameters *VerificationParameters `xml:",omitempty"`
	TrackingEvents         *TrackingEvents         `xml:",omitempty"`
	ExecutableResource     *ExecutableResource     `xml:",omitempty"`
	FlashResource          *FlashResource          `xml:",omitempty"`
	ViewableImpression     []*ViewableImpression   `xml:",omitempty"`
}

Verification is a JavaScriptResource

type VerificationParameters

type VerificationParameters struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

VerificationParameters vast element

type VideoAdServingTemplate

type VideoAdServingTemplate struct {
	Version string `xml:"version,attr,omitempty"`
	Ad      []*Ad  `xml:",omitempty"`
}

VideoAdServingTemplate compat for ver1.0

type VideoClicks

type VideoClicks struct {
	ClickThrough  *ClickThrough  `xml:",omitempty"`
	ClickTracking *ClickTracking `xml:",omitempty"`
	CustomClick   *CustomClick   `xml:",omitempty"`
}

VideoClicks is an element of the VAST structure

type ViewUndetermined

type ViewUndetermined struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

ViewUndetermined view not determined

type Viewable

type Viewable struct {
	ID    string `xml:"id,attr,omitempty"`
	Value string `xml:",cdata"`
}

Viewable creative can be viewed

type ViewableImpression

type ViewableImpression struct {
	ID               string            `xml:"id,attr,omitempty"`
	Viewable         *Viewable         `xml:",omitempty"`
	NotViewable      *NotViewable      `xml:",omitempty"`
	ViewUndetermined *ViewUndetermined `xml:",omitempty"`
}

ViewableImpression viewable imp

type Wrapper

type Wrapper struct {
	InLineWrapperData
	ID                       string `xml:"id,attr,omitempty"`
	FollowAdditionalWrappers string `xml:"followAdditionalWrappers,attr,omitempty"`
	AllowMultipleAds         string `xml:"allowMultipleAds,attr,omitempty"`
	FallbackOnNoAd           string `xml:"fallbackOnNoAd,attr,omitempty"`
}

Wrapper is an element of the VAST structure (WRAPPER)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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