Version: v0.0.0-...-f6175e8 Latest Latest

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

Go to latest
Published: Dec 18, 2018 License: Apache-2.0 Imports: 12 Imported by: 0




This section is empty.


View Source
var FuncMap = map[string]interface{}{
	"camel":        kace.Camel,
	"compare":      strings.Compare,
	"contains":     strings.Contains,
	"containsAny":  strings.ContainsAny,
	"count":        strings.Count,
	"dec":          dec,
	"equalFold":    strings.EqualFold,
	"fields":       strings.Fields,
	"hasPrefix":    strings.HasPrefix,
	"hasSuffix":    strings.HasSuffix,
	"inc":          inc,
	"strIndex":     strings.Index,
	"indexAny":     strings.IndexAny,
	"join":         strings.Join,
	"kebab":        kace.Kebab,
	"kebabUpper":   kace.KebabUpper,
	"lastIndex":    strings.LastIndex,
	"lastIndexAny": strings.LastIndexAny,
	"makeMap":      makeMap,
	"makeSlice":    makeSlice,
	"numbers":      numbers,
	"pascal":       kace.Pascal,
	"repeat":       strings.Repeat,
	"replace":      strings.Replace,
	"sliceString":  sliceString,
	"snake":        kace.Snake,
	"snakeUpper":   kace.SnakeUpper,
	"split":        strings.Split,
	"splitAfter":   strings.SplitAfter,
	"splitAfterN":  strings.SplitAfterN,
	"splitN":       strings.SplitN,
	"sub":          sub,
	"sum":          sum,
	"title":        strings.Title,
	"toLower":      strings.ToLower,
	"toTitle":      strings.ToTitle,
	"toUpper":      strings.ToUpper,
	"trim":         strings.Trim,
	"trimLeft":     strings.TrimLeft,
	"trimPrefix":   strings.TrimPrefix,
	"trimRight":    strings.TrimRight,
	"trimSpace":    strings.TrimSpace,
	"trimSuffix":   strings.TrimSuffix,

FuncMap is the default list of functions available to templates. If you add methods here, please keep them alphabetical.


func Plugin

func Plugin(dirs []string) func(string, string, interface{}) (interface{}, error)

Plugin returns a function which can be used in templates for executing plugins, dirs is the list of directories which are used fo plugin lookup.


type Values

type Values struct {
	Args   []string
	Stderr io.Writer
	Stdout io.Writer
	Stdin  io.Reader
	Env    map[string]string
	Log    *log.Logger

Values encapsulates the environment of the OS.

func (*Values) InitLog

func (env *Values) InitLog(verbose bool)

InitLog sets up env.Log to print to stderr if verbose is true, otherwise log messages will be discarded.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL