tempe

package
v0.0.0-...-d22e7c3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const EnvVarPattern = "\\${[a-zA-Z0-9/-_--]+}"

EnvVarPattern define environment variable pattern with ${MY_ENV_VAR}

Variables

View Source
var EnvVarReplacerFunc = func(matches [][]byte) (map[string]string, error) {
	kv := make(map[string]string)
	for _, m := range matches {
		k := string(m)
		v := os.Getenv(k[2 : len(k)-1])
		kv[k] = v
	}
	return kv, nil
}

EnvVarReplacerFunc for replacing environment variable with the regex

Functions

This section is empty.

Types

type ReplaceFunc

type ReplaceFunc func(matches [][]byte) (map[string]string, error)

ReplaceFunc for tempe

type Tempe

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

Tempe struct

func New

func New(regex string, replacer ReplaceFunc) (*Tempe, error)

New tempe object

func (*Tempe) ReplaceBytes

func (t *Tempe) ReplaceBytes(in []byte) ([]byte, error)

ReplaceBytes the string

Jump to

Keyboard shortcuts

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