templater

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package templater is imported form https://github.com/go-task/task/tree/master/internal/templater

Package templater is imported form https://github.com/go-task/task/tree/master/internal/templater

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	Variables() map[string]string
}

A Context carries the context of a Templater.

type Templater

type Templater interface {
	Replace(string) string
	ReplaceSlice([]string) []string
	ReplaceMap(map[string]string) map[string]string
	ReplaceMapI(map[string]any) map[string]any
	Err() error
}

A Templater is the interface that wraps basic templating methods that can be called several times, without having to check for error each time. The first error that happen will be assigned to the rhe inner struct, and consecutive calls to funcs will just return the zero value.

func New

func New(ctx Context) Templater

New returns a new Templater.

Jump to

Keyboard shortcuts

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