Documentation ¶
Overview ¶
Package preprocess provides facilities to expand environment variables in `.l2` API files and return the contents
Index ¶
- func Expand(s string, vm *goja.Runtime, mapping map[string]string) string
- func ExpandEnv(s string, vm *goja.Runtime) string
- func ExpandHeaders(block *gabs.Container, vm *goja.Runtime)
- func ExpandJSON(block *gabs.Container, vm *goja.Runtime)
- func ExpandURL(block *gabs.Container, vm *goja.Runtime)
- func GetLamaFileAsString(path string) string
- func LamaFile(inputFile string) (string, string)
- func LoadElfEnv(l2path string)
- func ProcessVarsInBlock(block *gabs.Container, vm *goja.Runtime)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Expand ¶ added in v1.3.0
Expand replaces ${var} or $var in the string based on the mapping function. For example, os.ExpandEnv(s) is equivalent to os.Expand(s, os.Getenv).
func ExpandEnv ¶ added in v1.3.0
ExpandEnv replaces ${var} or $var in the string according to the values of the current environment variables. References to undefined variables are replaced by the empty string.
func ExpandHeaders ¶ added in v1.3.0
func ExpandJSON ¶ added in v1.3.0
func GetLamaFileAsString ¶ added in v1.3.0
func LamaFile ¶ added in v1.1.0
LamaFile takes in a path to an API file. It moves into the API file directory, reads the API contents, loads the `l2.env` file if available, and finally substitutes environment vars in the API contents Once done, it reverts back to the original directory, and returns the processed l2 file.
func LoadElfEnv ¶ added in v1.3.0
func LoadElfEnv(l2path string)
func ProcessVarsInBlock ¶ added in v1.3.0
Types ¶
This section is empty.