excelUtil

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(sheetName string, data interface{}, columns []types.ColumnInfo) (*xlsx.File, string, error)

func CreateSheet

func CreateSheet(file *xlsx.File, sheetName string, data interface{}, columns []types.ColumnInfo) (*xlsx.Sheet, error)

func Export

func Export(filename string, c *gin.Context, file *xlsx.File)

func ExportSheet

func ExportSheet(c *gin.Context, sheetName string, data interface{}, columns []types.ColumnInfo)

func GetColumnFromSheet

func GetColumnFromSheet(sheet *xlsx.Sheet) ([]types.ColumnInfo, error)

func GetDataFromSheet

func GetDataFromSheet(sheet *xlsx.Sheet, startRowNum int, columns []types.ColumnInfo) ([]map[string]interface{}, error)

Types

type ColumnInfo

type ColumnInfo struct {
	Field   string `json:"field"`
	Name    string `json:"name"`
	IsEdit  bool   `json:"is_edit" json:"isEdit"`
	Type    string `json:"type"`
	Require bool   `json:"require"`
}

Jump to

Keyboard shortcuts

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