templater

package
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 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]interface{}) map[string]interface{}
	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