param

package
v0.0.0-...-34fc9f0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params map[string]any

Params for a Template.

func NewParams

func NewParams() Params

NewParams returns a new Params instance.

func (Params) Contains

func (p Params) Contains(k string) bool

func (Params) ContainsWellKnown

func (p Params) ContainsWellKnown(k WellKnown) bool

func (Params) Copy

func (p Params) Copy() Params

func (Params) Get

func (p Params) Get(k string) any

func (Params) GetWellKnown

func (p Params) GetWellKnown(k WellKnown) any

func (Params) Set

func (p Params) Set(k string, v any) Params

func (Params) SetAll

func (p Params) SetAll(other Params) Params

func (Params) SetAllNoOverwrite

func (p Params) SetAllNoOverwrite(other Params) Params

func (Params) SetWellKnown

func (p Params) SetWellKnown(k WellKnown, v any) Params

type Template

type Template struct {
	*template.Template
	// contains filtered or unexported fields
}

Template that has been parsed to search for template parameters.

func Parse

func Parse(t *template.Template) *Template

Parse the given template to find the set of template parameters used.

func (Template) Contains

func (t Template) Contains(p string) bool

Contains returns true if the given parameter is used by this Template.

func (Template) ContainsWellKnown

func (t Template) ContainsWellKnown(p WellKnown) bool

ContainsWellKnown returns true if the given well-known parameter is used by this Template.

func (Template) MissingParams

func (t Template) MissingParams(params Params) sets.String

MissingParams checks the provided params against the parameters used in this Template. Returns the set of template parameters not defined in params.

func (Template) Params

func (t Template) Params() sets.String

Params returns the set of parameters that were found in this template.

type WellKnown

type WellKnown string

WellKnown defines a well-known template parameter injected automatically by the echo testing framework.

const (
	// From is the template parameter used for injecting the source of a call. It will be of type echo.Caller,
	// which is generally either of type echo.Instance or istio.Ingress (for ingress-based tests).
	From WellKnown = "From"

	// To is the template parameter used for injecting the echo.Target of a call.
	To WellKnown = "To"

	// Namespace is the template parameter used for injecting the target namespace.Instance of the applied config.
	Namespace WellKnown = "Namespace"

	// SystemNamespace is the template parameter used for injecting the namespace.Instance of the Istio system.
	SystemNamespace WellKnown = "SystemNamespace"
)

func (WellKnown) String

func (p WellKnown) String() string

type WellKnownList

type WellKnownList []WellKnown

func AllWellKnown

func AllWellKnown() WellKnownList

func (WellKnownList) ToStringArray

func (w WellKnownList) ToStringArray() []string

Jump to

Keyboard shortcuts

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