Skip to content

Commit 375da69

Browse files
authored
[chore] Deprecate unnecessary fileconsumer API (open-telemetry#23281)
* [chore] Deprecate unnecessary fileconsumer API * Add deprecation version and tentative removal version
1 parent 6ac5285 commit 375da69

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

pkg/stanza/fileconsumer/finder.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ type Finder struct {
1313
}
1414

1515
// FindFiles gets a list of paths given an array of glob patterns to include and exclude
16+
//
17+
// Deprecated: [v0.80.0] This will be made internal in a future release, tentatively v0.82.0.
1618
func (f Finder) FindFiles() []string {
1719
all := make([]string, 0, len(f.Include))
1820
for _, include := range f.Include {

pkg/stanza/fileconsumer/fingerprint.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,23 @@ import (
1111
"os"
1212
)
1313

14+
// Deprecated: [v0.80.0] This will be made internal in a future release, tentatively v0.82.0.
1415
const DefaultFingerprintSize = 1000 // bytes
15-
const MinFingerprintSize = 16 // bytes
16+
17+
// Deprecated: [v0.80.0] This will be made internal in a future release, tentatively v0.82.0.
18+
const MinFingerprintSize = 16 // bytes
1619

1720
// Fingerprint is used to identify a file
1821
// A file's fingerprint is the first N bytes of the file
22+
//
23+
// Deprecated: [v0.80.0] This will be made internal in a future release, tentatively v0.82.0.
1924
type Fingerprint struct {
2025
FirstBytes []byte
2126
}
2227

2328
// NewFingerprint creates a new fingerprint from an open file
29+
//
30+
// Deprecated: [v0.80.0] This will be made internal in a future release, tentatively v0.82.0.
2431
func NewFingerprint(file *os.File, size int) (*Fingerprint, error) {
2532
buf := make([]byte, size)
2633

pkg/stanza/fileconsumer/reader.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ type readerConfig struct {
2323
}
2424

2525
// Reader manages a single file
26+
//
27+
// Deprecated: [v0.80.0] This will be made internal in a future release, tentatively v0.82.0.
2628
type Reader struct {
2729
*zap.SugaredLogger `json:"-"` // json tag excludes embedded fields from storage
2830
*readerConfig

pkg/stanza/fileconsumer/scanner.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ import (
1414
const defaultBufSize = 16 * 1024
1515

1616
// PositionalScanner is a scanner that maintains position
17+
//
18+
// Deprecated: [v0.80.0] This will be made internal in a future release, tentatively v0.82.0.
1719
type PositionalScanner struct {
1820
pos int64
1921
*bufio.Scanner
2022
}
2123

2224
// NewPositionalScanner creates a new positional scanner
25+
//
26+
// Deprecated: [v0.80.0] This will be made internal in a future release, tentatively v0.82.0.
2327
func NewPositionalScanner(r io.Reader, maxLogSize int, startOffset int64, splitFunc bufio.SplitFunc) *PositionalScanner {
2428
ps := &PositionalScanner{
2529
pos: startOffset,

0 commit comments

Comments
 (0)