header

package
v0.95.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEndOfHeader = errors.New("end of header")

Functions

This section is empty.

Types

type Config

type Config struct {
	SplitFunc bufio.SplitFunc
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(matchRegex string, metadataOperators []operator.Config, enc encoding.Encoding) (*Config, error)

type Reader

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

func NewReader

func NewReader(logger *zap.SugaredLogger, cfg Config) (*Reader, error)

func (*Reader) Process

func (r *Reader) Process(ctx context.Context, token []byte, fileAttributes map[string]any) error

Process checks if the given token is a line of the header, and consumes it if it is. An EndOfHeaderError is returned if the given line was not a header line.

func (*Reader) Stop

func (r *Reader) Stop() error

Jump to

Keyboard shortcuts

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