stdlib

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package stdlib implements the Terramate language functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbspathFunc

func AbspathFunc(basedir string) function.Function

AbspathFunc returns the `tm_abspath()` hcl function.

func Functions

func Functions(basedir string) map[string]function.Function

Functions returns all the Terramate default functions. The `basedir` must be an absolute path for an existent directory or it panics.

func HCLExpressionFunc

func HCLExpressionFunc() function.Function

HCLExpressionFunc returns the tm_hcl_expression function. This function interprets the `expr` argument as a string and returns the parsed expression.

func Name

func Name(name string) string

Name converts the function name into the exported Terramate name.

func NoFS added in v0.4.1

func NoFS(basedir string) map[string]function.Function

NoFS returns all Terramate functions but excluding fs-related functions.

func Regex

func Regex() function.Function

Regex is a copy of Terraform stdlib.RegexFunc but with cached compiled patterns.

func TernaryFunc

func TernaryFunc() function.Function

TernaryFunc is the `tm_ternary` function implementation. The `tm_ternary(cond, expr1, expr2)` will return expr1 if `cond` evaluates to `true` and `expr2` otherwise.

func TryFunc added in v0.4.4

func TryFunc() function.Function

TryFunc implements the `tm_try()` function.

func VendorFunc

func VendorFunc(basedir, vendordir project.Path, stream chan<- event.VendorRequest) function.Function

VendorFunc returns the `tm_vendor` function. The basedir defines what tm_vendor will use to define the relative paths of vendored dependencies. The vendordir defines where modules are vendored inside the project. The stream defines the event stream for tm_vendor, one event is produced per successful function call.

func VersionMatch

func VersionMatch() function.Function

VersionMatch returns the `tm_version_match` function spec, which checks if the provided version matches the constraint. If the third argument is provided, then it uses the flags to customize the version matcher. At the moment, only the propery `allow_prereleases` is supported, which enables matchs against prereleases using default Semver ordering semantics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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