From 20ccd43bf4cb450cb6d8a2cea89fc5f0b3ec4ec9 Mon Sep 17 00:00:00 2001 From: Dan Jaglowski Date: Mon, 31 Jul 2023 13:51:04 -0400 Subject: [PATCH] [chore] Remove/unimport deprecated fields --- .../pkg-stanza-fileconsumer-deprecated.yaml | 21 +++++ .../pkg-stanza-fileconsumer-deprecated2.yaml | 21 +++++ .../pkg-stanza-fileconsumer-deprecated3.yaml | 21 +++++ .../pkg-stanza-fileconsumer-deprecated4.yaml | 21 +++++ .../pkg-stanza-fileconsumer-deprecated5.yaml | 21 +++++ pkg/stanza/fileconsumer/attributes.go | 24 ------ pkg/stanza/fileconsumer/config.go | 2 +- pkg/stanza/fileconsumer/config_test.go | 20 ++--- pkg/stanza/fileconsumer/file.go | 33 ++++---- pkg/stanza/fileconsumer/file_sort.go | 2 +- pkg/stanza/fileconsumer/file_test.go | 8 +- pkg/stanza/fileconsumer/finder.go | 41 ++++------ pkg/stanza/fileconsumer/finder_test.go | 76 +++++++++---------- pkg/stanza/fileconsumer/reader.go | 16 ++-- pkg/stanza/fileconsumer/reader_factory.go | 12 +-- pkg/stanza/fileconsumer/roller.go | 4 +- pkg/stanza/fileconsumer/roller_other.go | 30 ++++---- pkg/stanza/fileconsumer/roller_windows.go | 8 +- 18 files changed, 221 insertions(+), 160 deletions(-) create mode 100755 .chloggen/pkg-stanza-fileconsumer-deprecated.yaml create mode 100755 .chloggen/pkg-stanza-fileconsumer-deprecated2.yaml create mode 100755 .chloggen/pkg-stanza-fileconsumer-deprecated3.yaml create mode 100755 .chloggen/pkg-stanza-fileconsumer-deprecated4.yaml create mode 100755 .chloggen/pkg-stanza-fileconsumer-deprecated5.yaml delete mode 100644 pkg/stanza/fileconsumer/attributes.go diff --git a/.chloggen/pkg-stanza-fileconsumer-deprecated.yaml b/.chloggen/pkg-stanza-fileconsumer-deprecated.yaml new file mode 100755 index 000000000000..917a377943c1 --- /dev/null +++ b/.chloggen/pkg-stanza-fileconsumer-deprecated.yaml @@ -0,0 +1,21 @@ +# Use this changelog template to create an entry for release notes. +# If your change doesn't affect end users, such as a test fix or a tooling change, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/stanza + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove deprecated 'fileconsumer.FileAttributes' + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [24688] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + diff --git a/.chloggen/pkg-stanza-fileconsumer-deprecated2.yaml b/.chloggen/pkg-stanza-fileconsumer-deprecated2.yaml new file mode 100755 index 000000000000..0c95a19d14de --- /dev/null +++ b/.chloggen/pkg-stanza-fileconsumer-deprecated2.yaml @@ -0,0 +1,21 @@ +# Use this changelog template to create an entry for release notes. +# If your change doesn't affect end users, such as a test fix or a tooling change, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/stanza + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove deprecated 'fileconsumer.EmitFunc' + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [24688] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + diff --git a/.chloggen/pkg-stanza-fileconsumer-deprecated3.yaml b/.chloggen/pkg-stanza-fileconsumer-deprecated3.yaml new file mode 100755 index 000000000000..2f6d5fa547ff --- /dev/null +++ b/.chloggen/pkg-stanza-fileconsumer-deprecated3.yaml @@ -0,0 +1,21 @@ +# Use this changelog template to create an entry for release notes. +# If your change doesn't affect end users, such as a test fix or a tooling change, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/stanza + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove deprecated `fileconsumer.Finder` + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [24688] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + diff --git a/.chloggen/pkg-stanza-fileconsumer-deprecated4.yaml b/.chloggen/pkg-stanza-fileconsumer-deprecated4.yaml new file mode 100755 index 000000000000..765190ca2545 --- /dev/null +++ b/.chloggen/pkg-stanza-fileconsumer-deprecated4.yaml @@ -0,0 +1,21 @@ +# Use this changelog template to create an entry for release notes. +# If your change doesn't affect end users, such as a test fix or a tooling change, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/stanza + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove deprecated `fileconsumer.BaseSortRule` and `fileconsumer.SortRuleImpl` + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [24688] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + diff --git a/.chloggen/pkg-stanza-fileconsumer-deprecated5.yaml b/.chloggen/pkg-stanza-fileconsumer-deprecated5.yaml new file mode 100755 index 000000000000..6ae6b7b587c2 --- /dev/null +++ b/.chloggen/pkg-stanza-fileconsumer-deprecated5.yaml @@ -0,0 +1,21 @@ +# Use this changelog template to create an entry for release notes. +# If your change doesn't affect end users, such as a test fix or a tooling change, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: pkg/stanza + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove deprecated 'fileconsumer.Reader' + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [24688] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + diff --git a/pkg/stanza/fileconsumer/attributes.go b/pkg/stanza/fileconsumer/attributes.go deleted file mode 100644 index 2d687a971ed9..000000000000 --- a/pkg/stanza/fileconsumer/attributes.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -package fileconsumer // import "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer" - -import ( - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer/internal/util" -) - -// Deprecated: [v0.82.0] This will be removed in a future release, tentatively v0.84.0. -type FileAttributes struct { - Name string `json:"-"` - Path string `json:"-"` - NameResolved string `json:"-"` - PathResolved string `json:"-"` - HeaderAttributes map[string]any -} - -// HeaderAttributesCopy gives a copy of the HeaderAttributes, in order to restrict mutation of the HeaderAttributes. -// -// Deprecated: [v0.82.0] This will be removed in a future release, tentatively v0.84.0. -func (f *FileAttributes) HeaderAttributesCopy() map[string]any { - return util.MapCopy(f.HeaderAttributes) -} diff --git a/pkg/stanza/fileconsumer/config.go b/pkg/stanza/fileconsumer/config.go index dc3b13b3851e..206e7e7c16fd 100644 --- a/pkg/stanza/fileconsumer/config.go +++ b/pkg/stanza/fileconsumer/config.go @@ -165,7 +165,7 @@ func (c Config) buildManager(logger *zap.SugaredLogger, emit emit.Callback, fact maxBatchFiles: c.MaxConcurrentFiles / 2, maxBatches: c.MaxBatches, deleteAfterRead: c.DeleteAfterRead, - knownFiles: make([]*Reader, 0, 10), + knownFiles: make([]*reader, 0, 10), seenPaths: make(map[string]struct{}, 100), }, nil } diff --git a/pkg/stanza/fileconsumer/config_test.go b/pkg/stanza/fileconsumer/config_test.go index 4b6b82edf752..99762e15f43a 100644 --- a/pkg/stanza/fileconsumer/config_test.go +++ b/pkg/stanza/fileconsumer/config_test.go @@ -164,10 +164,10 @@ func TestUnmarshal(t *testing.T) { Expect: func() *mockOperatorConfig { cfg := NewConfig() cfg.OrderingCriteria.Regex = `err\.[a-zA-Z]\.\d+\.(?P\d{10})\.log` - cfg.OrderingCriteria.SortBy = []SortRuleImpl{ + cfg.OrderingCriteria.SortBy = []sortRuleImpl{ { &TimestampSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ SortType: sortTypeTimestamp, RegexKey: "rotation_time", Ascending: true, @@ -185,10 +185,10 @@ func TestUnmarshal(t *testing.T) { Expect: func() *mockOperatorConfig { cfg := NewConfig() cfg.OrderingCriteria.Regex = `err\.(?P[a-zA-Z])\.\d+\.\d{10}\.log` - cfg.OrderingCriteria.SortBy = []SortRuleImpl{ + cfg.OrderingCriteria.SortBy = []sortRuleImpl{ { &NumericSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ SortType: sortTypeNumeric, RegexKey: "file_num", }, @@ -575,10 +575,10 @@ func TestBuild(t *testing.T) { { "BadOrderingCriteriaRegex", func(f *Config) { - f.OrderingCriteria.SortBy = []SortRuleImpl{ + f.OrderingCriteria.SortBy = []sortRuleImpl{ { &NumericSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: "value", SortType: sortTypeNumeric, }, @@ -593,10 +593,10 @@ func TestBuild(t *testing.T) { "BasicOrderingCriteriaTimetsamp", func(f *Config) { f.OrderingCriteria.Regex = ".*" - f.OrderingCriteria.SortBy = []SortRuleImpl{ + f.OrderingCriteria.SortBy = []sortRuleImpl{ { &TimestampSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: "value", SortType: sortTypeTimestamp, }, @@ -611,10 +611,10 @@ func TestBuild(t *testing.T) { "GoodOrderingCriteriaTimestamp", func(f *Config) { f.OrderingCriteria.Regex = ".*" - f.OrderingCriteria.SortBy = []SortRuleImpl{ + f.OrderingCriteria.SortBy = []sortRuleImpl{ { &TimestampSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: "value", SortType: sortTypeTimestamp, }, diff --git a/pkg/stanza/fileconsumer/file.go b/pkg/stanza/fileconsumer/file.go index 70aebfb71405..50bc0ee40546 100644 --- a/pkg/stanza/fileconsumer/file.go +++ b/pkg/stanza/fileconsumer/file.go @@ -25,16 +25,13 @@ const ( logFilePathResolved = "log.file.path_resolved" ) -// Deprecated: [v0.82.0] Use emit.Callback instead. This will be removed in a future release, tentatively v0.84.0. -type EmitFunc func(ctx context.Context, attrs *FileAttributes, token []byte) - type Manager struct { *zap.SugaredLogger wg sync.WaitGroup cancel context.CancelFunc readerFactory readerFactory - finder Finder + finder MatchingCriteria roller roller persister operator.Persister @@ -43,7 +40,7 @@ type Manager struct { maxBatchFiles int deleteAfterRead bool - knownFiles []*Reader + knownFiles []*reader seenPaths map[string]struct{} currentFps []*fingerprint.Fingerprint @@ -59,7 +56,7 @@ func (m *Manager) Start(persister operator.Persister) error { return fmt.Errorf("read known files from database: %w", err) } - if files, err := m.finder.FindFiles(); err != nil { + if files, err := m.finder.findFiles(); err != nil { m.Warnw("error occurred while finding files", "error", err.Error()) } else if len(files) == 0 { m.Warnw("no files match the configured include patterns", @@ -119,7 +116,7 @@ func (m *Manager) poll(ctx context.Context) { batchesProcessed := 0 // Get the list of paths on disk - matches, err := m.finder.FindFiles() + matches, err := m.finder.findFiles() if err != nil { m.Errorf("error finding files: %s", err) } @@ -142,7 +139,7 @@ func (m *Manager) poll(ctx context.Context) { func (m *Manager) consume(ctx context.Context, paths []string) { m.Debug("Consuming files") - readers := make([]*Reader, 0, len(paths)) + readers := make([]*reader, 0, len(paths)) for _, path := range paths { r := m.makeReader(path) if r != nil { @@ -156,9 +153,9 @@ func (m *Manager) consume(ctx context.Context, paths []string) { m.roller.readLostFiles(ctx, readers) var wg sync.WaitGroup - for _, reader := range readers { + for _, r := range readers { wg.Add(1) - go func(r *Reader) { + go func(r *reader) { defer wg.Done() r.ReadToEnd(ctx) // Delete a file if deleteAfterRead is enabled and we reached the end of the file @@ -168,13 +165,13 @@ func (m *Manager) consume(ctx context.Context, paths []string) { m.Errorf("could not delete %s", r.file.Name()) } } - }(reader) + }(r) } wg.Wait() // Save off any files that were not fully read if m.deleteAfterRead { - unfinished := make([]*Reader, 0, len(readers)) + unfinished := make([]*reader, 0, len(readers)) for _, r := range readers { if !r.eof { unfinished = append(unfinished, r) @@ -242,7 +239,7 @@ func (m *Manager) checkDuplicates(fp *fingerprint.Fingerprint) bool { // makeReader take a file path, then creates reader, // discarding any that have a duplicate fingerprint to other files that have already // been read this polling interval -func (m *Manager) makeReader(path string) *Reader { +func (m *Manager) makeReader(path string) *reader { // Open the files first to minimize the time between listing and opening fp, file := m.makeFingerprint(path) if fp == nil { @@ -274,7 +271,7 @@ func (m *Manager) clearCurrentFingerprints() { // saveCurrent adds the readers from this polling interval to this list of // known files, then increments the generation of all tracked old readers // before clearing out readers that have existed for 3 generations. -func (m *Manager) saveCurrent(readers []*Reader) { +func (m *Manager) saveCurrent(readers []*reader) { // Add readers from the current, completed poll interval to the list of known files m.knownFiles = append(m.knownFiles, readers...) @@ -290,7 +287,7 @@ func (m *Manager) saveCurrent(readers []*Reader) { } } -func (m *Manager) newReader(file *os.File, fp *fingerprint.Fingerprint) (*Reader, error) { +func (m *Manager) newReader(file *os.File, fp *fingerprint.Fingerprint) (*reader, error) { // Check if the new path has the same fingerprint as an old path if oldReader, ok := m.findFingerprintMatch(fp); ok { return m.readerFactory.copy(oldReader, file) @@ -300,7 +297,7 @@ func (m *Manager) newReader(file *os.File, fp *fingerprint.Fingerprint) (*Reader return m.readerFactory.newReader(file, fp) } -func (m *Manager) findFingerprintMatch(fp *fingerprint.Fingerprint) (*Reader, bool) { +func (m *Manager) findFingerprintMatch(fp *fingerprint.Fingerprint) (*reader, bool) { // Iterate backwards to match newest first for i := len(m.knownFiles) - 1; i >= 0; i-- { oldReader := m.knownFiles[i] @@ -347,7 +344,7 @@ func (m *Manager) loadLastPollFiles(ctx context.Context) error { } if encoded == nil { - m.knownFiles = make([]*Reader, 0, 10) + m.knownFiles = make([]*reader, 0, 10) return nil } @@ -365,7 +362,7 @@ func (m *Manager) loadLastPollFiles(ctx context.Context) error { } // Decode each of the known files - m.knownFiles = make([]*Reader, 0, knownFileCount) + m.knownFiles = make([]*reader, 0, knownFileCount) for i := 0; i < knownFileCount; i++ { // Only the offset, fingerprint, and splitter // will be used before this reader is discarded diff --git a/pkg/stanza/fileconsumer/file_sort.go b/pkg/stanza/fileconsumer/file_sort.go index d9d732e8c7cc..2c71b9af49c7 100644 --- a/pkg/stanza/fileconsumer/file_sort.go +++ b/pkg/stanza/fileconsumer/file_sort.go @@ -27,7 +27,7 @@ type sortRule interface { sort(re *regexp.Regexp, files []string) ([]string, error) } -func (sr *SortRuleImpl) Unmarshal(component *confmap.Conf) error { +func (sr *sortRuleImpl) Unmarshal(component *confmap.Conf) error { if !component.IsSet("sort_type") { return fmt.Errorf("missing required field 'sort_type'") } diff --git a/pkg/stanza/fileconsumer/file_test.go b/pkg/stanza/fileconsumer/file_test.go index a8b608c9c3e0..36b6c0a7f56f 100644 --- a/pkg/stanza/fileconsumer/file_test.go +++ b/pkg/stanza/fileconsumer/file_test.go @@ -731,10 +731,10 @@ func TestMultiFileSort(t *testing.T) { cfg := NewConfig().includeDir(tempDir) cfg.StartAt = "beginning" cfg.MatchingCriteria.OrderingCriteria.Regex = `.*(?P\d)` - cfg.MatchingCriteria.OrderingCriteria.SortBy = []SortRuleImpl{ + cfg.MatchingCriteria.OrderingCriteria.SortBy = []sortRuleImpl{ { &NumericSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: `value`, }, }, @@ -765,10 +765,10 @@ func TestMultiFileSortTimestamp(t *testing.T) { cfg := NewConfig().includeDir(tempDir) cfg.StartAt = "beginning" cfg.MatchingCriteria.OrderingCriteria.Regex = `.(?P\d{10})\.log` - cfg.MatchingCriteria.OrderingCriteria.SortBy = []SortRuleImpl{ + cfg.MatchingCriteria.OrderingCriteria.SortBy = []sortRuleImpl{ { &TimestampSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: `value`, SortType: "timestamp", }, diff --git a/pkg/stanza/fileconsumer/finder.go b/pkg/stanza/fileconsumer/finder.go index c31e9ee03c47..aac10335b52b 100644 --- a/pkg/stanza/fileconsumer/finder.go +++ b/pkg/stanza/fileconsumer/finder.go @@ -18,42 +18,35 @@ type MatchingCriteria struct { type OrderingCriteria struct { Regex string `mapstructure:"regex,omitempty"` - SortBy []SortRuleImpl `mapstructure:"sort_by,omitempty"` + SortBy []sortRuleImpl `mapstructure:"sort_by,omitempty"` } type NumericSortRule struct { - BaseSortRule `mapstructure:",squash"` + baseSortRule `mapstructure:",squash"` } type AlphabeticalSortRule struct { - BaseSortRule `mapstructure:",squash"` + baseSortRule `mapstructure:",squash"` } type TimestampSortRule struct { - BaseSortRule `mapstructure:",squash"` + baseSortRule `mapstructure:",squash"` Layout string `mapstructure:"layout,omitempty"` Location string `mapstructure:"location,omitempty"` } -// Deprecated: [v0.82.0] This will be made internal in a future release, tentatively v0.83.0. -type BaseSortRule struct { +type baseSortRule struct { RegexKey string `mapstructure:"regex_key,omitempty"` Ascending bool `mapstructure:"ascending,omitempty"` SortType string `mapstructure:"sort_type,omitempty"` } -// Deprecated: [v0.82.0] This will be made internal in a future release, tentatively v0.83.0. -type SortRuleImpl struct { +type sortRuleImpl struct { sortRule } -// Deprecated: [v0.82.0] Use MatchingCriteria instead. This will be removed in v0.83.0. -type Finder = MatchingCriteria - -// FindFiles gets a list of paths given an array of glob patterns to include and exclude -// -// Deprecated: [v0.80.0] This will be made internal in a future release, tentatively v0.83.0. -func (f Finder) FindFiles() ([]string, error) { +// findFiles gets a list of paths given an array of glob patterns to include and exclude +func (f MatchingCriteria) findFiles() ([]string, error) { all := make([]string, 0, len(f.Include)) for _, include := range f.Include { matches, _ := doublestar.FilepathGlob(include, doublestar.WithFilesOnly()) // compile error checked in build @@ -75,29 +68,21 @@ func (f Finder) FindFiles() ([]string, error) { } } - return f.FindCurrent(all) -} - -// FindCurrent gets the current file to read from a list of files if ordering_criteria is configured -// otherwise it returns the list of files. -// -// Deprecated: [v0.82.0] This will be made internal in a future release, tentatively v0.83.0. -func (f Finder) FindCurrent(files []string) ([]string, error) { - if len(f.OrderingCriteria.SortBy) == 0 || files == nil || len(files) == 0 { - return files, nil + if len(all) == 0 || len(f.OrderingCriteria.SortBy) == 0 { + return all, nil } re := regexp.MustCompile(f.OrderingCriteria.Regex) var errs error for _, SortPattern := range f.OrderingCriteria.SortBy { - sortedFiles, err := SortPattern.sort(re, files) + sortedFiles, err := SortPattern.sort(re, all) if err != nil { errs = multierr.Append(errs, err) continue } - files = sortedFiles + all = sortedFiles } - return []string{files[0]}, errs + return []string{all[0]}, errs } diff --git a/pkg/stanza/fileconsumer/finder_test.go b/pkg/stanza/fileconsumer/finder_test.go index 512ae630a2c2..31d21075f4a7 100644 --- a/pkg/stanza/fileconsumer/finder_test.go +++ b/pkg/stanza/fileconsumer/finder_test.go @@ -131,10 +131,10 @@ func TestFinder(t *testing.T) { exclude: []string{}, filterSortRule: OrderingCriteria{ Regex: `err\.(?P\d{4}\d{2}\d{2}\d{2}).*log`, - SortBy: []SortRuleImpl{ + SortBy: []sortRuleImpl{ { &TimestampSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: "value", Ascending: false, }, @@ -153,10 +153,10 @@ func TestFinder(t *testing.T) { exclude: []string{}, filterSortRule: OrderingCriteria{ Regex: `err\.(?P\d{4}\d{2}\d{2}\d{2}).*log`, - SortBy: []SortRuleImpl{ + SortBy: []sortRuleImpl{ { &TimestampSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: "value", Ascending: true, }, @@ -175,10 +175,10 @@ func TestFinder(t *testing.T) { exclude: []string{}, filterSortRule: OrderingCriteria{ Regex: `err\.(?P\d+).*log`, - SortBy: []SortRuleImpl{ + SortBy: []sortRuleImpl{ { &NumericSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: "value", Ascending: false, }, @@ -195,10 +195,10 @@ func TestFinder(t *testing.T) { exclude: []string{}, filterSortRule: OrderingCriteria{ Regex: `err\.(?P\d+).*log`, - SortBy: []SortRuleImpl{ + SortBy: []sortRuleImpl{ { &NumericSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: "value", Ascending: true, }, @@ -215,10 +215,10 @@ func TestFinder(t *testing.T) { exclude: []string{}, filterSortRule: OrderingCriteria{ Regex: `err\.(?P[a-zA-Z]+).*log`, - SortBy: []SortRuleImpl{ + SortBy: []sortRuleImpl{ { &AlphabeticalSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: "value", Ascending: false, }, @@ -235,10 +235,10 @@ func TestFinder(t *testing.T) { exclude: []string{}, filterSortRule: OrderingCriteria{ Regex: `err\.(?P[a-zA-Z]+).*log`, - SortBy: []SortRuleImpl{ + SortBy: []sortRuleImpl{ { &AlphabeticalSortRule{ - BaseSortRule: BaseSortRule{ + baseSortRule: baseSortRule{ RegexKey: "value", Ascending: true, }, @@ -264,10 +264,10 @@ func TestFinder(t *testing.T) { exclude: []string{}, filterSortRule: OrderingCriteria{ Regex: `err\.(?P[a-zA-Z])\.(?P\d+)\.(?P