functions

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnvFunction = function.New(&function.Spec{
	Params: []function.Parameter{
		{
			Name: "envvar",
			Type: cty.String,
		},
	},
	Type: function.StaticReturnType(cty.String),
	Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) {
		envvar := args[0].AsString()
		return cty.StringVal(os.Getenv(envvar)), nil
	},
})

EnvFunction constructs a function that looks up an EnvironmentVariable given the variable name

Functions

func Env

func Env(envvar cty.Value) (cty.Value, error)

Env performs a function call to EnvFunction, useful for testing

Types

This section is empty.

Jump to

Keyboard shortcuts

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