Documentation
¶
Index ¶
- func NewFromFile(name, filename string) (*tagmanager.CustomTemplate, error)
- func Resolve(filename, name string, embedded *tagmanager.CustomTemplate) (*tagmanager.CustomTemplate, error)
- func ResolveOrLookup(ctx context.Context, tm Upserter, filename, name string, ...) (*tagmanager.CustomTemplate, error)
- type Upserter
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.
Click to show internal directories.
Click to hide internal directories.