doc

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortInputsByName

func SortInputsByName(inputs []Input)

SortInputsByName sorts a list of inputs by name.

func SortInputsByRequired added in v0.5.0

func SortInputsByRequired(inputs []Input)

SortInputsByRequired sorts a list of inputs by whether they are required

func SortOutputsByName

func SortOutputsByName(outputs []Output)

SortOutputsByName sorts a list of outputs by name.

Types

type Doc

type Doc struct {
	Comment string
	Inputs  []Input
	Outputs []Output
}

Doc represents a Terraform module.

func Create

func Create(files map[string]*ast.File) *Doc

Create creates a new document from a map of filenames to *ast.Files.

func CreateFromPaths

func CreateFromPaths(paths []string) (*Doc, error)

CreateFromPaths creates a new document from a list of file or directory paths.

func TestDoc

func TestDoc(t testing.T, path string) *Doc

TestDoc creates a *Doc from a Terraform module.

func TestDocFromFile

func TestDocFromFile(t testing.T, path string, name string) *Doc

TestDocFromFile creates a *Doc from a Terraform file.

func (*Doc) HasComment

func (d *Doc) HasComment() bool

HasComment indicates if the document has a comment.

func (*Doc) HasInputs

func (d *Doc) HasInputs() bool

HasInputs indicates if the document has inputs.

func (*Doc) HasOutputs

func (d *Doc) HasOutputs() bool

HasOutputs indicates if the document has outputs.

type Input

type Input struct {
	Name        string
	Description string
	Default     *Value
	Type        string
}

Input represents a Terraform input.

func (*Input) GetDefault

func (i *Input) GetDefault() *Value

GetDefault returns the Terraform input's default value.

func (*Input) HasDefault

func (i *Input) HasDefault() bool

HasDefault indicates if a Terraform input has a default value set.

func (*Input) HasDescription

func (i *Input) HasDescription() bool

HasDescription indicates if a Terraform input has a description.

func (*Input) IsAggregateType added in v0.6.0

func (i *Input) IsAggregateType() bool

IsAggregateType indicates if a Terraform input is an aggregate type.

func (*Input) IsOptional

func (i *Input) IsOptional() bool

IsOptional indicates if a Terraform input is optional.

func (*Input) IsRequired

func (i *Input) IsRequired() bool

IsRequired indicates if a Terraform input is required.

type Output

type Output struct {
	Name        string
	Description string
}

Output represents a Terraform output.

func (*Output) HasDescription

func (o *Output) HasDescription() bool

HasDescription indicates if a Terraform output has a description.

type Value

type Value struct {
	Type  string
	Value interface{}
}

Value represents a Terraform value.

func (Value) IsAggregateType added in v0.6.0

func (v Value) IsAggregateType() bool

IsAggregateType indicates if a Terraform value is an aggregate type.

Jump to

Keyboard shortcuts

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