render

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package render centralizes rendering of template text with runtime values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	Text         string
	Values       Values
	Interactsh   URLSource
	InteractURLs []string
}

Input describes a render operation. Text is template text, Values are data, and Interactsh is optional source-level marker handling.

type MapInput

type MapInput struct {
	Source Values
	Data   Values
	// Values is the evaluation context used while rendering Source.
	Values Values
	// Interactsh and InteractURLs carry source-level Interactsh allocations.
	Interactsh   URLSource
	InteractURLs []string
}

MapInput describes a map render operation. Source values are template text. Data values are terminal data that override Source and are not rendered.

type MapResult

type MapResult struct {
	Values       Values
	InteractURLs []string
}

MapResult contains the complete value map after Source rendering and Data overlay, plus any Interactsh URLs allocated while rendering Source values.

func RenderMap

func RenderMap(input MapInput) (MapResult, error)

RenderMap renders Source values as template text, overlays Data values, and returns a complete value map. Data keys are skipped while rendering so they cannot produce DSL or Interactsh side effects.

It is intended for already-expanded payload iteration maps, not raw payload definitions containing lists.

type Result

type Result struct {
	Text         string
	InteractURLs []string
}

Result is the terminal rendered data and any Interactsh URLs allocated while rendering template text.

func Render

func Render(input Input) (Result, error)

Render evaluates template text with values and returns rendered data.

Interactsh markers in Text are source-level render effects and are allocated before DSL helper evaluation, so helper transforms apply to generated URLs. Values are data and rendered output is terminal data; neither is rescanned for DSL expressions or Interactsh markers.

func ReplaceInteractshMarkers

func ReplaceInteractshMarkers(text string, source URLSource, interactURLs []string) (Result, error)

ReplaceInteractshMarkers allocates Interactsh URLs for markers that appear in template text. It does not evaluate DSL expressions or inspect values.

type URLSource

type URLSource interface {
	NewURLWithData(data string) (string, error)
}

URLSource allocates URLs for Interactsh markers found in template text.

type Values

type Values = map[string]interface{}

Values contains render values. Values are inserted as data; they are not scanned as new template text after insertion.

Jump to

Keyboard shortcuts

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