datasource

package
v1.234.0 Latest Latest
Warning

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

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

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{},
	opts *Options,
) (string, error)

RenderWith is Render with every option. The merged data is exposed on `.` (with the historical `.Env.README_YAML` helper) and as the `config` datasource; only Gomplate functions and opts.Funcs are available.

Types

type Options

type Options struct {
	// Funcs are scoped to this render; their return values retain native
	// fields and methods, bypassing datasource JSON serialization.
	Funcs template.FuncMap
	// WrapFuncs receives the fully assembled function map and the render's
	// datasources, which include "." and "config". Policy enforcement uses it
	// to guard every function call.
	WrapFuncs render.FuncsWrapper
	// MissingKey is the text/template "missingkey" option; empty means error.
	MissingKey string
}

Options customizes one render.

Jump to

Keyboard shortcuts

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