examples

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package examples embeds the adformat/examples/*.yaml sample formats (§4 of the design plan) via embed.FS, so they can be loaded without a fragile runtime.Caller + os.Open dance (the old admodels/types/format_mock.go approach) and reused both by tests and by adformat/adformattest.

Index

Constants

This section is empty.

Variables

View Source
var MultiscreenBanner = adformat.Format{
	Codename: "multiscreen_banner",
	Title:    "Multi-screen Interactive Banner",
	Kind:     adformat.KindBanner,
	Tags:     []string{"expandable", "multi-screen"},
	Sizes:    []adformat.SizeOption{adformat.FixedSize("", 320, 480)},
	Config:   &multiscreenConfig,
}

MultiscreenBanner is the Go var-table equivalent of multiscreen.yaml (§4.7/§3.2.10).

View Source
var Names = []string{
	"banner.yaml",
	"banner_fixed.yaml",
	"popunder.yaml",
	"native.yaml",
	"video_preroll.yaml",
	"push_ad.yaml",
	"playable.yaml",
	"multiscreen.yaml",
}

Names of every embedded example file, in the same order as presented in §4 of the design plan.

View Source
var NativeAd = adformat.Format{
	Codename: "native",
	Title:    "Native Ad",
	Kind:     adformat.KindNative,
	Config:   &nativeConfig,
}

NativeAd is the Go var-table equivalent of native.yaml (§3.2.10).

Functions

func All

func All() ([]*adformat.Format, error)

All decodes every embedded example listed in Names, in order.

func Load

func Load(name string) (*adformat.Format, error)

Load reads and decodes (via adformat.DecodeAny, which also runs Config.Validate) the named embedded example.

Types

This section is empty.

Jump to

Keyboard shortcuts

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