excel

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TrimSpace bool
	SheetName string
}

Config excel config

type Excel

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

Excel excel struct

func New

func New(value interface{}, config ...*Config) *Excel

New new excel backend

func (*Excel) NewReader

func (excel *Excel) NewReader(res *exchange.Resource, context *qor.Context) (exchange.Rows, error)

NewReader new csv reader

func (*Excel) NewWriter

func (excel *Excel) NewWriter(res *exchange.Resource, context *qor.Context) (exchange.Writer, error)

NewWriter new csv writer

type Rows

type Rows struct {
	*Excel
	Resource *exchange.Resource
	// contains filtered or unexported fields
}

Rows CSV rows struct

func (Rows) Header

func (rows Rows) Header() (results []string)

Header CSV header column

func (*Rows) Next

func (rows *Rows) Next() bool

Next read next rows from CSV

func (Rows) ReadRow

func (rows Rows) ReadRow() (*resource.MetaValues, error)

ReadRow read row from CSV

func (*Rows) Total

func (rows *Rows) Total() uint

Total CSV total rows

type Writer

type Writer struct {
	*Excel

	Resource *exchange.Resource
	Writer   *excelize.File
	// contains filtered or unexported fields
}

Writer CSV writer struct

func (*Writer) Flush

func (writer *Writer) Flush() error

Flush flush all changes

func (*Writer) WriteHeader

func (writer *Writer) WriteHeader() error

WriteHeader write header

func (*Writer) WriteRow

func (writer *Writer) WriteRow(record interface{}) (*resource.MetaValues, error)

WriteRow write row

Jump to

Keyboard shortcuts

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