variables

package
v0.0.0-...-61cb389 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplaceVariables

func ReplaceVariables(template string, context map[string]string) string

ReplaceVariables replace all variables found in template matching the names from context

Types

type Variable

type Variable struct {
	End       int
	Name      string
	NameEnd   int
	NameStart int
	Start     int
	Tag       string
	TagEnd    int
	TagStart  int
}

Variable is a named variable found in some string. It contains the name of the variable, associated tag if any and the position in the string where it was found

func FindVariables

func FindVariables(stringWithVariables string) []Variable

FindVariables find variables with tag (if any) in a given string

func (Variable) AsString

func (v Variable) AsString() string

AsString returns a string representation of this variable

Jump to

Keyboard shortcuts

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