reader

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(config Config, logger *loggerpkg.Logger)

Types

type Batch

type Batch struct {
	Size int    `yaml:"size"` // <= 0 means use default value
	Wait string `yaml:"wait"` // empty or < 0 means use default value, 0 means don't wait
}

type Config

type Config struct {
	MaxLineSize int   `yaml:"maxLineSize"`
	Batch       Batch `yaml:"batch"`
}

type Reader

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

func New

func New(collectorId string, file *os.File, offsetPath string, logger *logger.Logger) *Reader

func (*Reader) Close

func (r *Reader) Close()

func (*Reader) Read

func (r *Reader) Read() ([]map[string]interface{}, bool)

drain 是否读完了所有内容

func (*Reader) SameFile

func (r *Reader) SameFile(fi os.FileInfo) bool

func (*Reader) SaveOffset

func (r *Reader) SaveOffset() string

Jump to

Keyboard shortcuts

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