replacer

package
v0.0.0-...-f96b470 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package replacer provides a Replacer interface that replaces a string with a new string.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Replacer

type Replacer interface {
	Replace(string) string
}

Replacer is an interface that replaces a string with a new string.

func NewFuncReplacer

func NewFuncReplacer() Replacer

NewFuncReplacer returns a Replacer that replaces the following functions: - unix() -> unix timestamp - unixNano() -> unix timestamp in nanoseconds every function definition is replaced with a dynamic value at run time.

func NewMapReplacer

func NewMapReplacer(replacementMap map[string]string) Replacer

NewMapReplacer returns a Replacer that replaces the following variables. - ${key} -> value every variable definition is replaced with a static value at run time.

Jump to

Keyboard shortcuts

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