engine

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRendering = errors.New("failed to render")
)

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Render(ctx context.Context, text string, dest io.Writer) error
}

Engine is a template engine.

func New

func New(cfg *config.Config, option ...Option) (Engine, error)

type Option

type Option func(*opts)

Option is configurable Engine behavior.

func IgnoreNotFound added in v0.2.1

func IgnoreNotFound(b bool) Option

IgnoreNotFound ignores values are not found in the external store.

func TextType added in v0.3.0

func TextType(tto TextTypeOpt) Option

TextType sets the text type of rendered text.

type TextTypeOpt added in v0.3.0

type TextTypeOpt = encoding.TextType
const (
	TextTypePlain     TextTypeOpt = "plain"
	TextTypeJSON      TextTypeOpt = encoding.TextTypeJSON
	TextTypeJSONArray TextTypeOpt = encoding.TextTypeJSONArray
	TextTypeYAML      TextTypeOpt = encoding.TextTypeYAML
	TextTypeYAMLArray TextTypeOpt = encoding.TextTypeYAMLArray
	TextTypeYAMLDocs  TextTypeOpt = encoding.TextTypeYAMLDocs
)

Directories

Path Synopsis
*

Jump to

Keyboard shortcuts

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