delimited

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConverter

func NewConverter(props map[string]any) (message.Converter, error)

Types

type Converter

type Converter struct {
	Delimiter string   `json:"delimiter"`
	Cols      []string `json:"fields"`
	HasHeader bool     `json:"hasHeader"`
}

func (*Converter) Decode

func (c *Converter) Decode(ctx api.StreamContext, b []byte) (ma any, err error)

Decode If the cols is not set, the default key name is col1, col2, col3... The return value is always a map

func (*Converter) Encode

func (c *Converter) Encode(ctx api.StreamContext, d any) (b []byte, err error)

Encode If no columns defined, the default order is sort by key

Jump to

Keyboard shortcuts

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