converter

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BOM              = []byte("\xEF\xBB\xBF")
	EncodingsWithBOM = []string{"utf-8", "utf-16be", "utf-16le"}
)

Functions

This section is empty.

Types

type CSV

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

func NewCSV

func NewCSV(w io.Writer, delimiter string, encoding string, lineTerminator string) (*CSV, error)

func (*CSV) Flush

func (c *CSV) Flush() error

func (*CSV) Write

func (c *CSV) Write(cells []string) error

func (*CSV) WriteAll

func (c *CSV) WriteAll(cells [][]string) error

type Converter

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

func New

func New(options Options) (*Converter, error)

func (*Converter) Close

func (c *Converter) Close() error

func (*Converter) Convert

func (c *Converter) Convert() error

func (*Converter) Sheets

func (c *Converter) Sheets() []string

type Options

type Options struct {
	Encoding       string
	BOM            bool
	Delimiter      string
	LineTerminator string

	SheetName        []string
	SheetID          []int
	ExcludeSheetName []string
	ExcludeSheetID   []int

	SheetPattern        string
	ExcludeSheetPattern string

	Columns    []string
	MaxColumns int
	Trim       bool
	SkipEmpty  bool

	Source      string
	Destination string

	Output io.Writer
}

type Writer

type Writer interface {
	Write(cells []string) error
	WriteAll(cells []string) error
	Flush() error
}

Jump to

Keyboard shortcuts

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