replacer

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package replacer provides utilities that replace the reference and environment variables with its value

Index

Constants

View Source
const (
	// EmptyString is the empty string ""
	EmptyString = ""
)

Variables

View Source
var (
	// ErrNilPointer nil pointer error
	ErrNilPointer = errors.New("nil pointer error")
	// ErrInvalidObject invalid object error
	ErrInvalidObject = errors.New("invalid object")
)

Functions

func GetFieldValue

func GetFieldValue(f interface{}, name string) (retVal reflect.Value, err error)

GetFieldValue get filed value in reflected format

func GetMatches

func GetMatches(source string) [][]string

GetMatches get compiled matches

func GetReferenceValue

func GetReferenceValue(object interface{}, name string) (reflect.Value, error)

GetReferenceValue get the value of the reference, e.g. ${app.name}

func ParseReferences

func ParseReferences(st interface{}, varName []string) interface{}

ParseReferences parse the variable references

func ParseVariables

func ParseVariables(src string, re *regexp.Regexp) [][]string

ParseVariables parse reference and env variables

func Replace

func Replace(to interface{}, root interface{}) error

Replace given env and reference variables inside specific struct

func ReplaceMap

func ReplaceMap(m map[string]interface{}, root interface{}) error

ReplaceMap replace references and env variables

func ReplaceStringVariables

func ReplaceStringVariables(source string, t interface{}) interface{}

ReplaceStringVariables replace reference and env variables

Types

This section is empty.

Jump to

Keyboard shortcuts

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