Skip to content

Commit

Permalink
[chore][pkg/stanza] Cleanup file input operator files (#32072)
Browse files Browse the repository at this point in the history
Contributes to #32058
  • Loading branch information
djaglowski authored Apr 3, 2024
1 parent 6375418 commit a4a50d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,30 @@ type Input struct {
}

// Start will start the file monitoring process
func (f *Input) Start(persister operator.Persister) error {
return f.fileConsumer.Start(persister)
func (i *Input) Start(persister operator.Persister) error {
return i.fileConsumer.Start(persister)
}

// Stop will stop the file monitoring process
func (f *Input) Stop() error {
return f.fileConsumer.Stop()
func (i *Input) Stop() error {
return i.fileConsumer.Stop()
}

func (f *Input) emit(ctx context.Context, token []byte, attrs map[string]any) error {
func (i *Input) emit(ctx context.Context, token []byte, attrs map[string]any) error {
if len(token) == 0 {
return nil
}

ent, err := f.NewEntry(f.toBody(token))
ent, err := i.NewEntry(i.toBody(token))
if err != nil {
return fmt.Errorf("create entry: %w", err)
}

for k, v := range attrs {
if err := ent.Set(entry.NewAttributeField(k), v); err != nil {
f.Errorf("set attribute: %w", err)
i.Errorf("set attribute: %w", err)
}
}
f.Write(ctx, ent)
i.Write(ctx, ent)
return nil
}
File renamed without changes.

0 comments on commit a4a50d2

Please sign in to comment.