Documentation ¶
Index ¶
- Constants
- func HasTemplating(node yamlmeta.Node) bool
- func NewGoValueWithYAML(val interface{}) tplcore.GoValue
- func NewTemplateAnnotationFromYAMLComment(comment *yamlmeta.Comment, nodePos *filepos.Position, opts MetasOpts) (template.Annotation, error)
- type CommentAndAnnotation
- type EvaluationCtx
- func (e EvaluationCtx) PrepareNode(parentNode template.EvaluationNode, val template.EvaluationNode) error
- func (e EvaluationCtx) Replace(parentNodes []template.EvaluationNode, val interface{}) error
- func (e EvaluationCtx) SetMapItemKey(node template.EvaluationNode, val interface{}) error
- func (e EvaluationCtx) ShouldWrapRootValue(nodeVal interface{}) bool
- func (e EvaluationCtx) WrapRootValue(val interface{}) interface{}
- type MapItemOverride
- type Metas
- type MetasOpts
- type StarlarkFragment
- func (s *StarlarkFragment) AsGoValue() (interface{}, error)
- func (s *StarlarkFragment) AsStarlarkValue() starlark.Value
- func (s *StarlarkFragment) CompareSameType(op syntax.Token, y starlark.Value, depth int) (bool, error)
- func (s *StarlarkFragment) Freeze()
- func (s *StarlarkFragment) Get(k starlark.Value) (v starlark.Value, found bool, err error)
- func (s *StarlarkFragment) Hash() (uint32, error)
- func (s *StarlarkFragment) Index(i int) starlark.Value
- func (s *StarlarkFragment) Items() []starlark.Tuple
- func (s *StarlarkFragment) Iterate() starlark.Iterator
- func (s *StarlarkFragment) Len() int
- func (s *StarlarkFragment) SetIndex(index int, v starlark.Value) error
- func (s *StarlarkFragment) SetKey(k, v starlark.Value) error
- func (s *StarlarkFragment) Slice(start, end, step int) starlark.Value
- func (s *StarlarkFragment) String() string
- func (s *StarlarkFragment) Truth() starlark.Bool
- func (s *StarlarkFragment) Type() string
- type StarlarkFragmentKeysIterator
- type StarlarkFragmentNilIterator
- type StarlarkFragmentValuesIterator
- type Template
- type TemplateOpts
Constants ¶
View Source
const (
AnnotationMapKeyOverride template.AnnotationName = "yaml/map-key-override"
)
View Source
const (
AnnotationTextTemplatedStrings template.AnnotationName = "yaml/text-templated-strings"
)
View Source
const (
EvaluationCtxDialectName template.EvaluationCtxDialectName = "yaml"
)
Variables ¶
This section is empty.
Functions ¶
func HasTemplating ¶ added in v0.32.0
func NewGoValueWithYAML ¶ added in v0.26.0
func NewTemplateAnnotationFromYAMLComment ¶ added in v0.39.0
func NewTemplateAnnotationFromYAMLComment(comment *yamlmeta.Comment, nodePos *filepos.Position, opts MetasOpts) (template.Annotation, error)
NewTemplateAnnotationFromYAMLComment parses "comment" into template.Annotation.
nodePos is the position of the node to which "comment" is attached (this is important to differentiate between @template/code and @template/value).
Types ¶
type CommentAndAnnotation ¶ added in v0.36.0
type CommentAndAnnotation struct { Comment *yamlmeta.Comment Annotation *template.Annotation }
type EvaluationCtx ¶
type EvaluationCtx struct {
// contains filtered or unexported fields
}
func (EvaluationCtx) PrepareNode ¶
func (e EvaluationCtx) PrepareNode(parentNode template.EvaluationNode, val template.EvaluationNode) error
PrepareNode pre-processes the template.EvaluationNode so that the resulting AST fully reflects having been evaluated.
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 {
// contains filtered or unexported fields
}
type Metas ¶
type Metas struct { Block []*yamlmeta.Comment // meant to execute some code Values []*yamlmeta.Comment // meant to return interpolated value Annotations []CommentAndAnnotation // contains filtered or unexported fields }
Metas are the collection of ytt YAML templating values parsed from the comments attached to a yamlmeta.Node
type StarlarkFragment ¶
type StarlarkFragment struct {
// contains filtered or unexported fields
}
StarlarkFragment is an adapter for yamlmeta.Node values in Starlark code
func NewStarlarkFragment ¶
func NewStarlarkFragment(data interface{}) *StarlarkFragment
func (*StarlarkFragment) AsGoValue ¶
func (s *StarlarkFragment) AsGoValue() (interface{}, error)
func (*StarlarkFragment) AsStarlarkValue ¶
func (s *StarlarkFragment) AsStarlarkValue() starlark.Value
func (*StarlarkFragment) CompareSameType ¶ added in v0.26.0
func (*StarlarkFragment) Freeze ¶
func (s *StarlarkFragment) Freeze()
func (*StarlarkFragment) Hash ¶
func (s *StarlarkFragment) Hash() (uint32, error)
func (*StarlarkFragment) Index ¶ added in v0.26.0
func (s *StarlarkFragment) Index(i int) starlark.Value
func (*StarlarkFragment) Items ¶ added in v0.26.0
func (s *StarlarkFragment) Items() []starlark.Tuple
Items seems to be only used for splatting kwargs
func (*StarlarkFragment) Iterate ¶ added in v0.26.0
func (s *StarlarkFragment) Iterate() starlark.Iterator
func (*StarlarkFragment) Len ¶ added in v0.26.0
func (s *StarlarkFragment) Len() int
func (*StarlarkFragment) SetIndex ¶ added in v0.26.0
func (s *StarlarkFragment) SetIndex(index int, v starlark.Value) error
func (*StarlarkFragment) SetKey ¶ added in v0.26.0
func (s *StarlarkFragment) SetKey(k, v starlark.Value) error
func (*StarlarkFragment) Slice ¶ added in v0.26.0
func (s *StarlarkFragment) Slice(start, end, step int) starlark.Value
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 StarlarkFragmentKeysIterator ¶ added in v0.26.0
type StarlarkFragmentKeysIterator struct {
// contains filtered or unexported fields
}
func (*StarlarkFragmentKeysIterator) Done ¶ added in v0.26.0
func (s *StarlarkFragmentKeysIterator) Done()
type StarlarkFragmentNilIterator ¶ added in v0.26.0
type StarlarkFragmentNilIterator struct{}
func (StarlarkFragmentNilIterator) Done ¶ added in v0.26.0
func (s StarlarkFragmentNilIterator) Done()
type StarlarkFragmentValuesIterator ¶ added in v0.26.0
type StarlarkFragmentValuesIterator struct {
// contains filtered or unexported fields
}
func (*StarlarkFragmentValuesIterator) Done ¶ added in v0.26.0
func (s *StarlarkFragmentValuesIterator) Done()
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
Click to show internal directories.
Click to hide internal directories.