template

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Template

type Template interface {
	Execute(grokValues map[string]string) (string, error)
	ReferencedGrokFields() []string
	Name() string
}

Works like golang's text/template, but additionally provides the list of referenced fields. Example: "{{if eq .field1 .field2}}{{.field3}}{{end}}" Executing this template is similar to text/template.Template.Execute(), and ReferencedGrokFields() yields {"field1", "field2", "field3"}

func New

func New(name, template string) (Template, error)

Jump to

Keyboard shortcuts

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