variables

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager handles the storage and substitution of variables.

func NewManager

func NewManager() *Manager

NewManager creates a new variable manager.

func (*Manager) Capture

func (m *Manager) Capture(body []byte, captures map[string]string)

Capture extracts values from a JSON body using gjson paths and stores them as variables.

func (*Manager) Clone

func (m *Manager) Clone() *Manager

Clone creates a deep copy of the variable manager.

func (*Manager) Set

func (m *Manager) Set(key string, value interface{})

Set stores a variable with a given key and value.

func (*Manager) Substitute

func (m *Manager) Substitute(input string) string

Substitute replaces all variable placeholders in a string with their corresponding values.

func (*Manager) SubstituteInInterface

func (m *Manager) SubstituteInInterface(data interface{}) interface{}

SubstituteInInterface recursively substitutes variables in a nested data structure. It handles strings, maps, and slices, and attempts to convert numeric strings back to numbers.

func (*Manager) SubstituteInPayload

func (m *Manager) SubstituteInPayload(payload interface{}) (io.Reader, error)

SubstituteInPayload substitutes variables in a JSON payload.

Jump to

Keyboard shortcuts

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