Back to godoc.org

Package doc

v0.6.0
Latest Go to latest

The latest major version is .

Published: Dec 13, 2018 | License: MIT | Module: github.com/damaya/terraform-docs

Index

func SortInputsByName

func SortInputsByName(inputs []Input)

SortInputsByName sorts a list of inputs by name.

func SortInputsByRequired

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.

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

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

func (v Value) IsAggregateType() bool

IsAggregateType indicates if a Terraform value is an aggregate type.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier