datasource

package
v1.233.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package datasource renders Gomplate templates with merged YAML/JSON metadata.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(
	atmosConfig *schema.AtmosConfiguration,
	tmplName string,
	tmplValue string,
	mergedData map[string]interface{},
	funcs template.FuncMap,
) (string, error)

Render applies a Gomplate template with config and root datasources. Custom functions are scoped to this render and their return values retain native fields and methods, bypassing datasource JSON serialization.

func RenderWith

func RenderWith(
	atmosConfig *schema.AtmosConfiguration,
	tmplName string,
	tmplValue string,
	mergedData map[string]interface{},
	buildFuncs FuncsBuilder,
) (string, error)

RenderWith is Render with functions built from the render's own datasource URLs. Callers that guard or wrap the functions, such as policy enforcement, need those URLs to construct them.

Types

type FuncsBuilder

type FuncsBuilder func(topLevel, config *url.URL) (template.FuncMap, error)

FuncsBuilder returns the custom functions for one render. It receives the file URLs of the root ("." datasource) and "config" datasources, which exist only for the duration of the render.

Jump to

Keyboard shortcuts

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