excel

package
v1.2.10 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportZip

func ExportZip[T comparable](dst io.Writer, excels []*Excel[T]) error

ExportZip export excel data to zip

func Import

func Import[T comparable](r io.Reader, opts ...excelize.Options) (e []*T, err error)

Import excel data support type: string, int, int64, uint, float64 if you want to handle imported data, please implement Handle interface eg: func (User) ExcelHandle(users []*User) {}

func ImportAll added in v1.2.9

func ImportAll[T comparable](r io.Reader, opts ...excelize.Options) (e []*T, err error)

ImportAll excel all sheet data

Types

type Excel

type Excel[T comparable] struct {
	*excelize.File

	Titles       []string
	FileName     string
	Headers      []string
	HeaderMapper amap.AMap
	ExcelMapper  map[tag.GtField]string
	// contains filtered or unexported fields
}

func Export

func Export[T comparable](data any) (e *Excel[T], err error)

Export excel data

func NewExcel

func NewExcel[T comparable]() *Excel[T]

func (*Excel[T]) AddDict added in v1.2.5

func (f *Excel[T]) AddDict(key string, value dict) *Excel[T]

func (*Excel[T]) Export

func (f *Excel[T]) Export(data any) (e *Excel[T], err error)

func (*Excel[T]) Import

func (f *Excel[T]) Import() (datas []*T, err error)

func (*Excel[T]) Read added in v1.2.5

func (f *Excel[T]) Read(r io.Reader, opts ...excelize.Options) (*Excel[T], error)

func (*Excel[T]) ReadAll added in v1.2.9

func (f *Excel[T]) ReadAll(r io.Reader, opts ...excelize.Options) (*Excel[T], error)

func (*Excel[T]) SetSheet added in v1.2.5

func (f *Excel[T]) SetSheet(sheet ...string) *Excel[T]

func (*Excel[T]) ValidTitle added in v1.2.5

func (f *Excel[T]) ValidTitle(dst *Excel[T]) (e *Excel[T], err error)

type Handle

type Handle[T comparable] interface {
	ExcelHandle([]*T) error
}

Jump to

Keyboard shortcuts

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