csv

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package csv workers to read and write csv format

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

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

Decoder parse csv lines into key value pairs

func NewDecoder

func NewDecoder(opts DecoderOptions) *Decoder

NewDecoder return a new csv decoder with given options

func (*Decoder) Process

func (d *Decoder) Process(ctx context.Context, args selina.ProcessArgs) error

Process implements selina.Worker interface

type DecoderOptions

type DecoderOptions struct {
	Header  []string
	Comma   rune
	Comment rune
	Handler selina.ErrorHandler
	Codec   selina.Marshaler
}

DecoderOptions configure csv read format

type Encoder

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

Encoder transform messages into csv text

func NewEncoder

func NewEncoder(opts EncoderOptions) *Encoder

NewEncoder returns a new Encoder with given options

func (*Encoder) Process

func (e *Encoder) Process(ctx context.Context, args selina.ProcessArgs) error

Process implements selina.Worker interface

type EncoderOptions

type EncoderOptions struct {
	// Header acts as a filter, if a field is not in header is skipped
	Header []string
	// Comma default ,
	Comma rune
	// UseCRLF use \r\n instead of \n
	UseCRLF    bool
	Handler    selina.ErrorHandler
	ReadFormat selina.Unmarshaler
}

EncoderOptions configure csv encoding

Jump to

Keyboard shortcuts

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