Help us shape the future of Go! Take the 2026 Go Developer Survey

template

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromFile

func NewFromFile(name, filename string) (*tagmanager.CustomTemplate, error)

NewFromFile loads a custom template from the given path. The file contents are used verbatim, so it must be a complete GTM template.

func Resolve

func Resolve(filename, name string, embedded *tagmanager.CustomTemplate) (*tagmanager.CustomTemplate, error)

Resolve returns the template loaded from filename, or embedded if filename is empty.

func ResolveOrLookup

func ResolveOrLookup(
	ctx context.Context,
	tm Upserter,
	filename, name string,
	lookup func() (*tagmanager.CustomTemplate, error),
) (*tagmanager.CustomTemplate, error)

ResolveOrLookup provisions the template from filename when set, otherwise it falls back to lookup, which is used by providers relying on a manually installed template.

Types

type Upserter

type Upserter interface {
	UpsertCustomTemplate(ctx context.Context, item *tagmanager.CustomTemplate) (*tagmanager.CustomTemplate, error)
}

Upserter provisions a custom template, e.g. tagmanager.TagManager.

Jump to

Keyboard shortcuts

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