internal

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const BUF_SIZE = 4096

Variables

This section is empty.

Functions

func Compile

func Compile(exp string, params map[string]any, opts ...expr.Option) (*vm.Program, error)

func RunExpr added in v0.6.4

func RunExpr(exp *vm.Program, params map[string]any) (any, error)

func Sprintf added in v0.7.4

func Sprintf(a any, format string) string

func TimeZoneStrToLocation added in v0.2.1

func TimeZoneStrToLocation(tzStr string) (*time.Location, error)

Types

type CsvReader

type CsvReader struct {
}

func (*CsvReader) Read

func (c *CsvReader) Read(r io.Reader) (chan Record, error)

Read a csv file and return a `chan []string` of rows and cells

type Filter

type Filter struct {
	Expr string
}

func (Filter) Process

func (f Filter) Process(input <-chan Record) (chan string, error)

Process implements Processor. It prints out the original record if the expr eval to true

type Gedi

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

func New

func New(reader RecordReader, processor RecordProcessor) *Gedi

func (Gedi) Run

func (g Gedi) Run(input io.Reader) error

type JsonLReader added in v0.3.0

type JsonLReader struct{}

func (*JsonLReader) Read added in v0.3.0

func (j *JsonLReader) Read(r io.Reader) (chan Record, error)

Read implements RecordReader and reads a jsonl file

type JsonReader added in v0.4.0

type JsonReader struct{}

func (*JsonReader) Read added in v0.4.0

func (j *JsonReader) Read(r io.Reader) (chan Record, error)

Read implements RecordReader.

type LineReader

type LineReader struct{}

func (*LineReader) Read

func (l *LineReader) Read(r io.Reader) (chan Record, error)

Read a input line by line and return a `chan string` of lines

type LineSkipper added in v0.8.1

type LineSkipper struct {
	NumOfLines int
	Reader     io.Reader
	// contains filtered or unexported fields
}

LineSkipper is an io.Reader that skips the first n lines of the input

func (*LineSkipper) Read added in v0.8.1

func (s *LineSkipper) Read(p []byte) (n int, err error)

Read implements io.Reader.

type Mapper added in v0.5.2

type Mapper struct {
	Expr string
}

func (Mapper) Process added in v0.5.2

func (m Mapper) Process(input <-chan Record) (chan string, error)

Process implements Processor. It prints out the result of the Expr

type Record added in v0.2.0

type Record interface {
	LineNo() int
	String() string
	Parsed() map[string]any
}

type RecordProcessor

type RecordProcessor interface {
	Process(<-chan Record) (chan string, error)
}

func InferProcess added in v0.7.3

func InferProcess(exp string) (RecordProcessor, error)

type RecordReader

type RecordReader interface {
	Read(r io.Reader) (chan Record, error)
}

type Reducer added in v0.6.0

type Reducer struct {
	Expr string
}

func (Reducer) Process added in v0.6.0

func (r Reducer) Process(input <-chan Record) (chan string, error)

Process implements Processor. It prints out the original record if the expr eval to true

type SsvReader added in v0.8.0

type SsvReader struct {
	MaxNumOfFields int
}

SsvReader reads records from a space separated values file

func (*SsvReader) Read added in v0.8.0

func (r *SsvReader) Read(in io.Reader) (chan Record, error)

Jump to

Keyboard shortcuts

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