excel

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExcelReader added in v0.0.19

type ExcelReader interface {
	ReadSheet(sheetName string) (*Sheet, error)
	ReadAllSheets() ([]*Sheet, error)
}

func NewHttpReader added in v0.0.19

func NewHttpReader(url string, options ...ReaderOption) (ExcelReader, error)

type ExcelWriter added in v0.0.19

type ExcelWriter interface {
	CreateDefaultSheet(rows []any) error
	CreateSheet(sheetName string, rows []any) error
	Close() error
	GetContent() ([]byte, error)
	Save(filename string) error
}

func NewFileWriter added in v0.0.19

func NewFileWriter(options ...WriterOption) (ExcelWriter, error)

func NewWriter added in v0.0.19

func NewWriter(options ...WriterOption) (ExcelWriter, error)

type ReaderOption added in v0.0.19

type ReaderOption func(*excelReaderOption)

func WithHeaderRowIndex added in v0.0.19

func WithHeaderRowIndex(index int) ReaderOption

type Sheet added in v0.0.19

type Sheet struct {
	Name          string
	HeaderIndexes map[string]int // headerName => index
	Headers       []string       // headers
	Rows          []*SheetRow
}

type SheetRow added in v0.0.19

type SheetRow struct {
	Sheet   *Sheet
	Columns []string
}

func (*SheetRow) Get added in v0.0.19

func (r *SheetRow) Get(colName string) string

func (*SheetRow) GetFloat64 added in v0.0.31

func (r *SheetRow) GetFloat64(colName string) float64

func (*SheetRow) GetInt added in v0.0.31

func (r *SheetRow) GetInt(colName string) int

func (*SheetRow) GetInt32 added in v0.0.31

func (r *SheetRow) GetInt32(colName string) int32

func (*SheetRow) GetInt32Slice added in v0.0.31

func (r *SheetRow) GetInt32Slice(colName string) []int32

GetInt32Slice get comma separated int32 slice

func (*SheetRow) GetInt64 added in v0.0.19

func (r *SheetRow) GetInt64(colName string) int64

func (*SheetRow) GetInt64Slice added in v0.0.19

func (r *SheetRow) GetInt64Slice(colName string) []int64

GetInt64Slice get comma separated int64 slice

func (*SheetRow) GetIntSlice added in v0.0.31

func (r *SheetRow) GetIntSlice(colName string) []int

GetIntSlice get comma separated int slice

func (*SheetRow) GetStringSlice added in v0.0.19

func (r *SheetRow) GetStringSlice(colName string) []string

GetStringSlice get comma separated string slice

type WriterOption added in v0.0.19

type WriterOption func(*excelWriterOption)

func WithCellStyles

func WithCellStyles(styles map[string]*excelize.Style) WriterOption

func WithColStyle

func WithColStyle(style *excelize.Style) WriterOption

func WithDefaultSheetName added in v0.0.19

func WithDefaultSheetName(sheetName string) WriterOption

Jump to

Keyboard shortcuts

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