Movatterモバイル変換


[0]ホーム

URL:


types

package
v0.20.0Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License:MITImports:5Imported by:0

Details

Repository

github.com/terraform-docs/terraform-docs

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeBool

type Boolbool

Bool represents a 'bool' value

func (Bool)HasDefault

func (bBool) HasDefault()bool

HasDefault indicates a Terraform variable has a default value set.

func (Bool)Length

func (bBool) Length()int

Length returns the length of underlying item

func (Bool)Rawadded inv0.11.0

func (bBool) Raw() interface{}

Raw underlying value of this type.

typeEmpty

type Emptystring

Empty represents an empty 'string' which is marshaled to `""` in JSON and YAML

func (Empty)HasDefault

func (eEmpty) HasDefault()bool

HasDefault indicates a Terraform variable has a default value set.

func (Empty)Length

func (eEmpty) Length()int

Length returns the length of underlying item

func (Empty)MarshalJSON

func (eEmpty) MarshalJSON() ([]byte,error)

MarshalJSON custom marshal function which sets the value to `""`

func (Empty)Rawadded inv0.11.0

func (eEmpty) Raw() interface{}

Raw underlying value of this type.

typeList

type List []interface{}

List represents a 'list' of values

func (List)HasDefault

func (lList) HasDefault()bool

HasDefault indicates a Terraform variable has a default value set.

func (List)Length

func (lList) Length()int

Length returns the length of underlying item

func (List)MarshalXML

func (lList) MarshalXML(e *xml.Encoder, startxml.StartElement)error

MarshalXML custom marshal function which wraps list items in '<default></default>'tag and each items of the list will be wrapped in a '<item></item>' tag

func (List)Rawadded inv0.11.0

func (lList) Raw() interface{}

Raw underlying value of this type.

func (List)Underlying

func (lList) Underlying() []interface{}

Underlying returns the underlying elements in the form of '[]interface {}'

typeMap

type Map map[string]interface{}

Map represents a 'map' of values

func (Map)HasDefault

func (mMap) HasDefault()bool

HasDefault indicates a Terraform variable has a default value set.

func (Map)Length

func (mMap) Length()int

Length returns the length of underlying item

func (Map)MarshalXML

func (mMap) MarshalXML(e *xml.Encoder, startxml.StartElement)error

MarshalXML custom marshal function which converts map to its literalXML representation. For example:

m := Map{    "a": 1,    "b": 2,    "c": 3,}type foo struct {    Value Map `xml:"value"`}

will get marshaled to:

<foo>

<value>  <a>1</a>  <b>2</b>  <c>3</c></value>

</foo>

func (Map)Rawadded inv0.11.0

func (mMap) Raw() interface{}

Raw underlying value of this type.

func (Map)Underlying

func (mMap) Underlying() map[string]interface{}

Underlying returns the underlying elements in the form of 'map[string]interface {}'

typeNil

type Nil struct{}

Nil represents a 'nil' value which is marshaled to `null` when empty for JSON and YAML

func (Nil)HasDefault

func (nNil) HasDefault()bool

HasDefault return false for Nil, because there's no value set for the variable

func (Nil)Length

func (nNil) Length()int

Length returns the length of underlying item

func (Nil)MarshalJSON

func (nNil) MarshalJSON() ([]byte,error)

MarshalJSON custom marshal function which sets the value to literal `null`

func (Nil)MarshalXML

func (nNil) MarshalXML(e *xml.Encoder, startxml.StartElement)error

MarshalXML custom marshal function which adds property 'xsi:nil="true"' to a tagof a 'nil' item

func (Nil)MarshalYAML

func (nNil) MarshalYAML() (interface{},error)

MarshalYAML custom marshal function which sets the value to literal `null`

func (Nil)Rawadded inv0.11.0

func (nNil) Raw() interface{}

Raw underlying value of this type.

typeNumber

type Numberfloat64

Number represents a 'number' value which is marshaled to `null` when emty in JSON and YAML

func (Number)HasDefault

func (nNumber) HasDefault()bool

HasDefault indicates a Terraform variable has a default value set.

func (Number)Length

func (nNumber) Length()int

Length returns the length of underlying item

func (Number)Rawadded inv0.11.0

func (nNumber) Raw() interface{}

Raw underlying value of this type.

typeString

type Stringstring

String represents a 'string' value which is marshaled to `null` when empty for JSON and YAML

funcTypeOf

func TypeOf(tstring, v interface{})String

TypeOf returns Terraform type of a value based on provided type byterraform-inspect or by looking the underlying type of the value

func (String)HasDefault

func (sString) HasDefault()bool

HasDefault indicates a Terraform variable has a default value set.

func (String)Length

func (sString) Length()int

Length returns the length of underlying item

func (String)MarshalJSON

func (sString) MarshalJSON() ([]byte,error)

MarshalJSON custom marshal function which sets the value to literal `null` when empty

func (String)MarshalXML

func (sString) MarshalXML(e *xml.Encoder, startxml.StartElement)error

MarshalXML custom marshal function which adds property 'xsi:nil="true"' to a tagif the underlying item is 'nil'

func (String)MarshalYAML

func (sString) MarshalYAML() (interface{},error)

MarshalYAML custom marshal function which sets the value to literal `null` when empty

func (String)Rawadded inv0.11.0

func (sString) Raw() interface{}

Raw underlying value of this type.

typeValue

type Value interface {HasDefault()boolLength()intRaw() interface{}}

Value is a default value of an input or output.it can be of several types:

- Nil- String- Empty- Number- Bool- List- Map

funcValueOf

func ValueOf(v interface{})Value

ValueOf returns actual value of a variable casted to 'Default' interface.This is done to be able to attach specific marshaller func to the type(if such a custom function was needed)

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp