scanner

package
v4.31.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AckFn

type AckFn func(context.Context, error) error

AckFn is a function provided to a scanner that it should call once the derived io.ReadCloser is fully consumed.

type Config

type Config struct {
	Type   string
	Plugin any
}

Config is the all encompassing configuration struct for all scanner types.

func FromAny

func FromAny(prov docs.Provider, value any) (conf Config, err error)

FromAny returns a scanner config from a parsed config, yaml node or map.

type Creator

type Creator interface {
	Create(rdr io.ReadCloser, aFn AckFn, details SourceDetails) (Scanner, error)
	Close(context.Context) error
}

Creator is an interface implemented by all scanners, which allows components to construct a scanner from an unbounded io.ReadCloser.

type Scanner

type Scanner interface {
	Next(context.Context) (message.Batch, AckFn, error)
	Close(context.Context) error
}

Scanner is an interface implemented by all scanner implementations once a creator has instantiated it on a byte stream.

type SourceDetails

type SourceDetails struct {
	Name string
}

SourceDetails contains exclusively optional information which could be used by codec implementations in order to determine the underlying data format.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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