stackrender

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package stackrender implements port.StackRenderer. It mirrors swarm-cd's compose rendering: the compose file is an optional Go text/template evaluated against a values file exposed as {{.Values.*}}, then parsed as YAML into a generic map for the deploy adapter. Pure — no I/O; both inputs are bytes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

Renderer implements port.StackRenderer.

func New

func New(logger *slog.Logger) *Renderer

New builds a Renderer. A nil logger falls back to slog.Default.

func (*Renderer) Render

func (r *Renderer) Render(compose, values []byte) (map[string]any, error)

Render parses compose (optionally templated against values) into a generic compose map. When values is non-empty, compose is treated as a Go text/template executed with {"Values": <values>}, matching swarm-cd so existing stacks port unchanged. Missing value keys render as "<no value>" (swarm-cd's lenient default); a malformed template or invalid YAML is an error.

Jump to

Keyboard shortcuts

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