yamltemplate

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationMapKeyOverride structmeta.AnnotationName = "yaml/map-key-override"
)
View Source
const (
	AnnotationTextTemplatedStrings structmeta.AnnotationName = "yaml/text-templated-strings"
)
View Source
const (
	EvaluationCtxDialectName template.EvaluationCtxDialectName = "yaml"
)

Variables

This section is empty.

Functions

func NewStructMetaFromMeta

func NewStructMetaFromMeta(meta *yamlmeta.Meta, opts MetasOpts) (structmeta.Meta, error)

Types

type EvaluationCtx

type EvaluationCtx struct{}

func (EvaluationCtx) PrepareNode

func (e EvaluationCtx) PrepareNode(
	parentNode template.EvaluationNode, val template.EvaluationNode) error

func (EvaluationCtx) Replace

func (e EvaluationCtx) Replace(
	parentNodes []template.EvaluationNode, val interface{}) error

func (EvaluationCtx) SetMapItemKey added in v0.17.0

func (e EvaluationCtx) SetMapItemKey(node template.EvaluationNode, val interface{}) error

func (EvaluationCtx) ShouldWrapRootValue

func (e EvaluationCtx) ShouldWrapRootValue(nodeVal interface{}) bool

func (EvaluationCtx) WrapRootValue

func (e EvaluationCtx) WrapRootValue(val interface{}) interface{}

type MapItemOverride

type MapItemOverride struct{}

func (MapItemOverride) Apply

func (d MapItemOverride) Apply(
	typedMap *yamlmeta.Map, newItem *yamlmeta.MapItem) error

type MetaAndAnnotation

type MetaAndAnnotation struct {
	Meta       *yamlmeta.Meta
	Annotation *structmeta.Annotation
}

type Metas

type Metas struct {
	Block       []*yamlmeta.Meta // meant to execute some code
	Values      []*yamlmeta.Meta // meant to return interpolated value
	Annotations []MetaAndAnnotation
	// contains filtered or unexported fields
}

func NewMetas

func NewMetas(node yamlmeta.Node, opts MetasOpts) (Metas, error)

func (Metas) NeedsEnd

func (m Metas) NeedsEnd() bool

type MetasOpts added in v0.12.0

type MetasOpts struct {
	IgnoreUnknown bool
}

type StarlarkFragment

type StarlarkFragment struct {
	// contains filtered or unexported fields
}

func NewStarlarkFragment

func NewStarlarkFragment(data interface{}) *StarlarkFragment

func (*StarlarkFragment) AsGoValue

func (s *StarlarkFragment) AsGoValue() interface{}

func (*StarlarkFragment) AsStarlarkValue

func (s *StarlarkFragment) AsStarlarkValue() starlark.Value

func (*StarlarkFragment) Freeze

func (s *StarlarkFragment) Freeze()

func (*StarlarkFragment) Hash

func (s *StarlarkFragment) Hash() (uint32, error)

func (*StarlarkFragment) String

func (s *StarlarkFragment) String() string

func (*StarlarkFragment) Truth

func (s *StarlarkFragment) Truth() starlark.Bool

func (*StarlarkFragment) Type

func (s *StarlarkFragment) Type() string

type Template

type Template struct {
	// contains filtered or unexported fields
}

func NewTemplate

func NewTemplate(name string, opts TemplateOpts) *Template

func (*Template) Compile

func (e *Template) Compile(docSet *yamlmeta.DocumentSet) (*template.CompiledTemplate, error)

type TemplateOpts added in v0.12.0

type TemplateOpts struct {
	IgnoreUnknownComments bool
}

Jump to

Keyboard shortcuts

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