template

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package template implements the JSONPath template format used by kubectl.

See https://kubernetes.io/docs/reference/kubectl/jsonpath/ for more information.

In some cases, it deviates slightly from the syntax accepted by kubectl's JSONPath expressions:

  • The use of \ to escape the next character in identifiers is not supported.
  • The use of @['x.y'] (equivalent to @.x.y) inside brackets is not supported, as it could conflict with an actual key in a JSON object.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFormatter

func DefaultFormatter(v interface{}) (string, error)

func ExpressionLanguage

func ExpressionLanguage() gval.Language

func TemplateLanguage

func TemplateLanguage(opts ...TemplateOption) gval.Language

Types

type FormatterFunc

type FormatterFunc func(value interface{}) (string, error)

type TemplateOption

type TemplateOption func(tl *templateLanguage)

func WithExpressionLanguageVariableVisitor

func WithExpressionLanguageVariableVisitor(visitor jsonpath.VariableVisitor) TemplateOption

func WithFormatter

func WithFormatter(formatter FormatterFunc) TemplateOption

Jump to

Keyboard shortcuts

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