templates

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Files embed.FS

Functions

func CopyTemplateFile

func CopyTemplateFile(src string, dst string) error

func CopyTemplateFiles

func CopyTemplateFiles(srcDir string, destDir string) ([]string, error)

CopyTemplateFiles copies configuration files from the embedded templates to the destination directory. It overwrites existing files in the destination directory. It returns a list of copied files.

func Read

func Read(name string) ([]byte, error)

func ReadAsString

func ReadAsString(name string) (string, error)

func ReadDir

func ReadDir(dir string) ([]string, error)

func RemoveTemplateFiles

func RemoveTemplateFiles(srcDir string, destDir string) ([]string, error)

RemoveTemplateFiles removes configuration files from the destination directory that were copied from the source directory. It returns a list of removed files.

func Render

func Render(templateSrc string, data any) (string, error)

Render renders a template with the given data and returns the result as a string.

Types

type AlloyData added in v0.7.0

type AlloyData struct {
	ClusterName       string
	PrometheusRemotes []AlloyRemote
	LokiRemotes       []AlloyRemote
}

AlloyData contains data for rendering Alloy configuration templates. Used by both the remotes template and individual module templates. Per-remote custom labels are handled via AlloyRemote.CustomRules.

type AlloyRemote added in v0.9.0

type AlloyRemote struct {
	Name           string // Unique identifier for this remote (used in Alloy config block names)
	URL            string // Remote write URL
	Username       string // Basic auth username
	PasswordEnvVar string // Environment variable name containing the password
	CustomRules    string // Pre-rendered Alloy rule {} blocks for per-remote relabel injection
}

AlloyRemote represents a single remote endpoint for Prometheus or Loki.

type KubeadmInitData

type KubeadmInitData struct {
	KubeBootstrapToken string
	SandboxDir         string
	MachineIP          string
	Hostname           string
	KubernetesVersion  string
}

type MetallbData

type MetallbData struct {
	MachineIP string
}

Jump to

Keyboard shortcuts

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