filematch

package
v0.0.0-...-5c7ffcf Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypePath      = "path"
	TypeGlob      = "glob"
	TypeRegexp    = "regexp"
	TypeFormat    = "format"
	TypeSls       = "sls"
	TypeContainer = "container"
)

Variables

This section is empty.

Functions

func GetPaths

func GetPaths(fatPaths []FatPath) []string

Types

type AbsFileMatcher

type AbsFileMatcher struct {
	Path string
}

func NewAbsFileMatcher

func NewAbsFileMatcher(path string) *AbsFileMatcher

func (*AbsFileMatcher) Find

func (m *AbsFileMatcher) Find() ([]FatPath, int, error)

func (*AbsFileMatcher) IsDynamicMultiFiles

func (m *AbsFileMatcher) IsDynamicMultiFiles() bool

type ContainerFileMatcher

type ContainerFileMatcher struct {
	Target *collecttask.CollectTarget
}

func NewContainerFileMatcher

func NewContainerFileMatcher(target *collecttask.CollectTarget) *ContainerFileMatcher

func (*ContainerFileMatcher) Find

func (m *ContainerFileMatcher) Find() ([]FatPath, int, error)

func (*ContainerFileMatcher) IsDynamicMultiFiles

func (c *ContainerFileMatcher) IsDynamicMultiFiles() bool

type FatPath

type FatPath struct {
	Path      string
	Tags      map[string]string
	IsSls     bool
	SlsConfig logstream.SlsConfig
	Attrs     map[string]string
}

富路径 对于绝对路径来说, tags==nil 对于 /home/admin/{a}/{b} 的路径来说 会有2个tags

type FileMatcher

type FileMatcher interface {
	Find() ([]FatPath, int, error)
	// 是否动态匹配多文件?
	IsDynamicMultiFiles() bool
}

func NewFormat2FileMatcher

func NewFormat2FileMatcher(basedir string, pattern string) (FileMatcher, error)

type FilePathFormatter

type FilePathFormatter struct {
	// contains filtered or unexported fields
}

func (*FilePathFormatter) ContainsFormat

func (f *FilePathFormatter) ContainsFormat(s string) bool

func (*FilePathFormatter) Format

func (f *FilePathFormatter) Format(s string) string

type Format2FileMatcher

type Format2FileMatcher struct {
	// contains filtered or unexported fields
}

type FormatFileMatcher

type FormatFileMatcher struct {
	// contains filtered or unexported fields
}

func NewFormatFileMatcher

func NewFormatFileMatcher(pattern string) *FormatFileMatcher

func (*FormatFileMatcher) Find

func (m *FormatFileMatcher) Find() ([]FatPath, int, error)

func (*FormatFileMatcher) IsDynamicMultiFiles

func (m *FormatFileMatcher) IsDynamicMultiFiles() bool

type GlobFileMatcher

type GlobFileMatcher struct {
	// contains filtered or unexported fields
}

func NewGlobFileMatcher

func NewGlobFileMatcher(pattern string) (*GlobFileMatcher, error)

func (*GlobFileMatcher) Find

func (m *GlobFileMatcher) Find() ([]FatPath, int, error)

func (*GlobFileMatcher) IsDynamicMultiFiles

func (m *GlobFileMatcher) IsDynamicMultiFiles() bool

type PodAbsFileMatcher

type PodAbsFileMatcher struct {
	Target *collecttask.CollectTarget
	Path   string
}

func NewPodAbsFileMatcher

func NewPodAbsFileMatcher(target *collecttask.CollectTarget, path string) *PodAbsFileMatcher

func (*PodAbsFileMatcher) Find

func (m *PodAbsFileMatcher) Find() ([]FatPath, int, error)

func (*PodAbsFileMatcher) IsDynamicMultiFiles

func (m *PodAbsFileMatcher) IsDynamicMultiFiles() bool

type PodRegexpFileMatcher

type PodRegexpFileMatcher struct {
	// contains filtered or unexported fields
}

func NewPodRegexpFileMatcher

func NewPodRegexpFileMatcher(target *collecttask.CollectTarget, dir, pattern string, maxVisited, maxMatched int) (*PodRegexpFileMatcher, error)

func (*PodRegexpFileMatcher) Find

func (m *PodRegexpFileMatcher) Find() ([]FatPath, int, error)

func (*PodRegexpFileMatcher) IsDynamicMultiFiles

func (m *PodRegexpFileMatcher) IsDynamicMultiFiles() bool

type RegexpFileMatcher

type RegexpFileMatcher struct {
	// contains filtered or unexported fields
}

func NewRegexpFileMatcher

func NewRegexpFileMatcher(dir, pattern string, maxVisited, maxMatched int) (*RegexpFileMatcher, error)

func (*RegexpFileMatcher) Find

func (m *RegexpFileMatcher) Find() ([]FatPath, int, error)

func (*RegexpFileMatcher) IsDynamicMultiFiles

func (m *RegexpFileMatcher) IsDynamicMultiFiles() bool

type SlsFileMatch

type SlsFileMatch struct {
	SlsConfigs []logstream.SlsConfig
}

func (*SlsFileMatch) Find

func (s *SlsFileMatch) Find() ([]FatPath, int, error)

func (*SlsFileMatch) IsDynamicMultiFiles

func (s *SlsFileMatch) IsDynamicMultiFiles() bool

Jump to

Keyboard shortcuts

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