excel

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: MPL-2.0 Imports: 10 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 {
	Headers map[int]string
	Rows    []*SheetRow
}

type SheetCell added in v0.0.19

type SheetCell struct {
	RowIndex int
	ColIndex int
	ColName  string
	Value    string
}

type SheetRow added in v0.0.19

type SheetRow struct {
	Cells []*SheetCell
}

func (*SheetRow) Get added in v0.0.19

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

func (*SheetRow) GetInt64 added in v0.0.19

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

func (*SheetRow) GetInt64Slice added in v0.0.19

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

GetInt64Slice get comma separated int64 slice

func (*SheetRow) GetStringSlice added in v0.0.19

func (s *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