template

package module
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DelimStart = "{{"
	DelimEnd   = "}}"
)
View Source
const TEMPLATE object.Type = "template"

Variables

This section is empty.

Functions

func Builtins

func Builtins() map[string]object.Object

func Module

func Module() *object.Module

func New

func New(ctx context.Context, args ...object.Object) object.Object

func Render

func Render(ctx context.Context, out io.Writer, tmpl string, values any) error

Render is a go template rendering function it includes all the sprig lib functions as well as some extras like a k8sLookup function to get values from k8s objects you can access environment variables from the template under .Env The passed values will be available under .Values in the templates

func RenderTemplate

func RenderTemplate(ctx context.Context, args ...object.Object) object.Object

Types

type Template

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

func (*Template) Cost

func (t *Template) Cost() int

func (*Template) Equals

func (t *Template) Equals(other object.Object) object.Object

func (*Template) GetAttr

func (t *Template) GetAttr(name string) (object.Object, bool)

func (*Template) Inspect

func (t *Template) Inspect() string

func (*Template) Interface

func (t *Template) Interface() interface{}

func (*Template) IsTruthy

func (t *Template) IsTruthy() bool

func (*Template) MarshalJSON

func (t *Template) MarshalJSON() ([]byte, error)

func (*Template) RunOperation

func (db *Template) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*Template) SetAttr

func (db *Template) SetAttr(name string, value object.Object) error

func (*Template) Type

func (t *Template) Type() object.Type

Jump to

Keyboard shortcuts

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