pattern

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Indicator       = '$'
	SeparatorPrefix = '{'
	SeparatorSuffix = '}'
)

Variables

This section is empty.

Functions

func Extract

func Extract(input string, splitsStr []string) []string

Extract eg: input="/var/log/76fb94cbb5/tomcat/", splitsStr=["/var/log/", "/", "/"]

return ["76fb94cbb5", "tomcat"]

func GetSplits

func GetSplits(target string) (splitStr []string, matchers []string)

GetSplits eg: target="/var/log/${pod.uid}/${pod.name}/"

returns ["var/log/", "/", "/"] and ["pod.uid", "pod.name"]

func Validate added in v1.2.0

func Validate(pattern string) error

Types

type Pattern added in v1.2.0

type Pattern struct {
	Raw string
	// contains filtered or unexported fields
}

func Init added in v1.2.0

func Init(pattern string) (*Pattern, error)

func (*Pattern) Render added in v1.2.0

func (p *Pattern) Render() (string, error)

func (*Pattern) WithK8s added in v1.2.0

func (p *Pattern) WithK8s(data *k8sMeta.FieldsData) *Pattern

func (*Pattern) WithObject added in v1.2.0

func (p *Pattern) WithObject(obj *runtime.Object) *Pattern

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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