filter

package
v0.0.1-alpha4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter struct {
	Name string `json:"name"`

	Substring *string `json:"substring,omitempty"`

	Regex *string `json:"regex,omitempty"`

	// OwnerReferences is a list of component names that watches on this filter.
	// Useful when multiple components watch on the same log file.
	// e.g., if the component X and Y both watch on the same log file,
	// with the same filter rule (substring/regex), this field will be
	// set to [x, y].
	OwnerReferences []string `json:"owner_references,omitempty"`
	// contains filtered or unexported fields
}

func ParseFilterJSON

func ParseFilterJSON(data []byte) (*Filter, error)

func ParseFilterYAML

func ParseFilterYAML(data []byte) (*Filter, error)

func (*Filter) Compile

func (f *Filter) Compile() error

Compiles the regex, if set.

func (*Filter) JSON

func (f *Filter) JSON() ([]byte, error)

func (*Filter) MatchBytes

func (f *Filter) MatchBytes(line []byte) (bool, error)

func (*Filter) MatchString

func (f *Filter) MatchString(line string) (bool, error)

func (*Filter) YAML

func (f *Filter) YAML() ([]byte, error)

Jump to

Keyboard shortcuts

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