common

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package common provides the common log components.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtractTimeFunc added in v0.1.9

type ExtractTimeFunc func([]byte) (time.Time, []byte, error)

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)

type ProcessMatchedFunc

type ProcessMatchedFunc func(parsedTime time.Time, line []byte, filter *Filter)

Jump to

Keyboard shortcuts

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