krabhcl

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr added in v0.5.0

type Addr struct {
	Keyword string
	Labels  []string
}

Addr represents resource reference.

var NullAddr Addr = Addr{Keyword: "", Labels: []string{}}

func AddrFromStrings added in v0.5.0

func AddrFromStrings(s []string) Addr

func ParseTraversalToAddr added in v0.5.0

func ParseTraversalToAddr(t hcl.Traversal) (Addr, error)

func (Addr) Absolute added in v0.5.0

func (a Addr) Absolute() []string

Absolute returns keyword and labels as a single slice.

func (Addr) Equal added in v0.5.0

func (a Addr) Equal(o Addr) bool

Equal compares if other Addr is the same.

func (Addr) OnlyRefNames added in v0.5.0

func (a Addr) OnlyRefNames() string

OnlyRefNames returns reference name without the keyword.

func (Addr) String added in v0.5.0

func (a Addr) String() string

String returns full reference name including the keyword.

type Body

type Body struct {
	hcl.Body
}

func (*Body) DefRangesFromPartialContentAttributes

func (b *Body) DefRangesFromPartialContentAttributes(schema *hcl.BodySchema) map[string]hcl.Range

func (*Body) DefRangesFromPartialContentBlocks

func (b *Body) DefRangesFromPartialContentBlocks(schema *hcl.BodySchema) []hcl.Range

type Expression

type Expression struct {
	Expr        hcl.Expression
	EvalContext *hcl.EvalContext
}

func (Expression) Addr added in v0.5.0

func (e Expression) Addr() (Addr, error)

func (Expression) AsFloat64 added in v0.4.2

func (e Expression) AsFloat64() (float64, error)

func (Expression) Bool added in v0.5.0

func (e Expression) Bool() (bool, error)

func (Expression) Int64 added in v0.5.0

func (e Expression) Int64() (int64, error)

func (Expression) SliceAddr added in v0.5.0

func (e Expression) SliceAddr() ([]*Addr, error)

func (Expression) SliceString added in v0.5.0

func (e Expression) SliceString() ([]string, error)

func (Expression) String added in v0.5.0

func (e Expression) String() (string, error)

type Source added in v0.5.0

type Source struct {
	DefRange hcl.Range
}

Source helps identifing code definition in krah hcl files.

func (*Source) Extract added in v0.5.0

func (s *Source) Extract(block *hcl.Block)

Extract saves the source information.

Jump to

Keyboard shortcuts

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