templates

package
v2.15.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package templates contains all logic related to template rendering.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderDSN

func RenderDSN(dsn string, files *agentpb.TextFiles, tempDir string) (string, error)

RenderDSN creates temporary files and replaces placeholders with real paths.

Types

type TemplateRenderer

type TemplateRenderer struct {
	TextFiles          map[string]string
	TemplateLeftDelim  string
	TemplateRightDelim string
	TempDir            string
}

TemplateRenderer replaces creates files and replaces placeholders for files in text.

func (*TemplateRenderer) RenderFiles

func (tr *TemplateRenderer) RenderFiles(templateParams map[string]interface{}) (map[string]interface{}, error)

RenderFiles creates temporary files and returns paths to created files.

func (*TemplateRenderer) RenderTemplate

func (tr *TemplateRenderer) RenderTemplate(name, text string, templateParams map[string]interface{}) ([]byte, error)

RenderTemplate replaces placeholders with real values in text.

Jump to

Keyboard shortcuts

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