converter

package
v0.0.0-...-173f61c Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package converter content relative to the package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttributeToStringWithoutContext

func AttributeToStringWithoutContext(attribute *hcl.Attribute) (string, errors.Error)

AttributeToStringWithoutContext convert a hc Attribute into a string value.

func BoolAttribute

func BoolAttribute(ctx *hcl.EvalContext, attr hcl.Expression, value cty.Value, def bool) (bool, errors.Error)

BoolAttribute return the attribute as a bool.

func GetExpressionValueAsBool

func GetExpressionValueAsBool(ctx *hcl.EvalContext, expr hcl.Expression, def bool) (bool, errors.Error)

GetExpressionValueAsBool return the expression as bool.

func GetExpressionValueAsDuration

func GetExpressionValueAsDuration(ctx *hcl.EvalContext, expr hcl.Expression, def *time.Duration) (*time.Duration,
	errors.Error)

GetExpressionValueAsDuration evaluate the expression and return a duration value.

func GetExpressionValueAsInt

func GetExpressionValueAsInt(ctx *hcl.EvalContext, expr hcl.Expression, def int) (int, errors.Error)

GetExpressionValueAsInt evaluate the expression and return a int value.

func GetExpressionValueAsInterface

func GetExpressionValueAsInterface(ctx *hcl.EvalContext, expr hcl.Expression, def interface{}) (interface{},
	errors.Error)

GetExpressionValueAsInterface evaluate an hcl expresion and converts into an interface.

func GetExpressionValueAsString

func GetExpressionValueAsString(ctx *hcl.EvalContext, expr hcl.Expression, def string) (string, errors.Error)

GetExpressionValueAsString return the value fo the expression as a string.

func GetValueAsBool

func GetValueAsBool(value cty.Value, def bool) bool

GetValueAsBool return the value as a bool.

func GetValueAsString

func GetValueAsString(value cty.Value, def string) string

GetValueAsString converts a given cty.Value into a string or returns a default valu.

func StringAttribute

func StringAttribute(ctx *hcl.EvalContext, attr hcl.Expression, value cty.Value, def string) (string, errors.Error)

StringAttribute return the attribute as a string.

func ToInterface

func ToInterface(v cty.Value) (interface{}, errors.Error)

ToInterface converts a given cty.Value into an interface.

func ToString

func ToString(v cty.Value) (string, errors.Error)

ToString converts a given cty.Value into a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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