excel

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Transform

func Transform(input interface{}, fields []string) ([][]interface{}, error)

Types

type Excel

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

func NewExcel

func NewExcel(opts ...Option) *Excel

func (*Excel) DownloadExcel

func (e *Excel) DownloadExcel(data interface{}, model interface{}, w http.ResponseWriter) error

func (*Excel) Excel2Map

func (e *Excel) Excel2Map(fn io.Reader, model interface{}) ([]map[string]interface{}, error)

func (*Excel) Excel2Structs

func (e *Excel) Excel2Structs(fn io.Reader, v interface{}) error

func (*Excel) Save2Excel

func (e *Excel) Save2Excel(data interface{}, model interface{}, dest string) error

type ExcelConfig

type ExcelConfig struct {
	SheetName string
}

type Option

type Option func(*Excel)

func WithSheetName

func WithSheetName(name string) Option

func WithSkipFirstRow

func WithSkipFirstRow(skip bool) Option

Jump to

Keyboard shortcuts

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