Documentation ¶
Overview ¶
Package exl
Excel binding to struct written in Go.(Only supports Go1.18+)
Index ¶
- Variables
- func Read[T ReadConfigurator](reader io.Reader, filterFunc ...func(t T) (add bool)) ([]T, error)
- func ReadBinary[T ReadConfigurator](bytes []byte, filterFunc ...func(t T) (add bool)) ([]T, error)
- func ReadExcel(file string, sheetIndex int, walk func(index int, rows *xlsx.Row)) error
- func ReadFile[T ReadConfigurator](file string, filterFunc ...func(t T) (add bool)) ([]T, error)
- func Write[T WriteConfigurator](file string, ts []T) error
- func WriteExcel(file string, data [][]string) error
- func WriteExcelTo(w io.Writer, data [][]string) error
- func WriteTo[T WriteConfigurator](w io.Writer, ts []T) error
- type Configurator
- type ReadConfig
- type ReadConfigurator
- type WriteConfig
- type WriteConfigurator
- type Writer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ReadBinary ¶
ReadBinary each row bind to `T`
func Write ¶
func Write[T WriteConfigurator](file string, ts []T) error
Write defines write []T to excel file
params: file,excel file full path
params: typed parameter T, must be implements exl.Bind
func WriteExcel ¶
WriteExcel defines write [][]string to excel
params: file, excel file pull path
params: data, write data to excel
func WriteExcelTo ¶ added in v1.2.2
WriteExcelTo defines write [][]string to excel
params: w, the dist writer
params: data, write data to excel
Types ¶
type Configurator ¶ added in v1.2.1
type Configurator[C any] interface { Configure(c C) }
type ReadConfig ¶ added in v1.2.1
type ReadConfigurator ¶ added in v1.2.1
type ReadConfigurator interface{ Configurator[*ReadConfig] }
type WriteConfig ¶ added in v1.2.1
type WriteConfigurator ¶ added in v1.2.1
type WriteConfigurator interface{ Configurator[*WriteConfig] }
type Writer ¶ added in v1.2.0
type Writer struct {
// contains filtered or unexported fields
}
Writer define a writer for exl
func NewWriter ¶ added in v1.2.0
func NewWriter(options ...xlsx.FileOption) *Writer
NewWriter returns new exl writer
Click to show internal directories.
Click to hide internal directories.