Documentation
¶
Index ¶
- type AttrAlignment
- type AttrBorder
- type AttrContent
- type AttrContentType
- type AttrCoordinate
- type AttrFilename
- type AttrFont
- type AttrOpenFileSize
- type AttrReadRangeRow
- type AttrSheet
- type AttrSheetIndex
- type AttrSheetName
- type AttrUnzipSizeLimit
- type AttrUnzipXMLSizeLimit
- type BaseAttributer
- type Cell
- func (my *Cell) GetAlignment() CellAlignmentOpt
- func (my *Cell) GetBorder() anySlice.AnySlicer[excelize.Border]
- func (my *Cell) GetContent() any
- func (my *Cell) GetContentType() CellContentType
- func (my *Cell) GetCoordinate() string
- func (my *Cell) GetFont() CellFontOpt
- func (my *Cell) SetAttrs(attrs ...CellAttributer) ICell
- func (my *Cell) SetCoordinate(coordinate string) ICell
- func (my *Cell) SetRowNum(rowNum uint) ICell
- type CellAlignmentOpt
- type CellAttributer
- func Alignment(alignment CellAlignmentOpt) CellAttributer
- func Border(borderRGB CellBorderRGBOpt, borderStyle CellBorderStyleOpt) CellAttributer
- func Content(content any) CellAttributer
- func ContentType(contentType CellContentType) CellAttributer
- func Coordinate(coordinate string) CellAttributer
- func Font(font CellFontOpt) CellAttributer
- type CellBorderOpt
- type CellBorderRGBOpt
- type CellBorderStyleOpt
- type CellContentType
- type CellFontOpt
- type ExcelAttributer
- type FilenameAttributer
- type ICell
- func NewCell(content any, attrs ...CellAttributer) ICell
- func NewCellBool(content bool, attrs ...CellAttributer) ICell
- func NewCellFloat64(content float64, attrs ...CellAttributer) ICell
- func NewCellFormula(content string, attrs ...CellAttributer) ICell
- func NewCellInt(content int, attrs ...CellAttributer) ICell
- func NewCellTime(content time.Time, attrs ...CellAttributer) ICell
- type IRow
- type IRows
- type OpenFileAttributer
- type Read
- type ReadRangeAttributer
- type Reader
- type Row
- type Rows
- type SheetAttributer
- type Write
- func (my *Write) CreateSheet(attr SheetAttributer) Writer
- func (my *Write) Download(writer http.ResponseWriter) error
- func (my *Write) GetRawExcel() *excelize.File
- func (my *Write) Save() (err error)
- func (my *Write) SetFilename(attr ExcelAttributer) Writer
- func (my *Write) SetSheet(attr SheetAttributer) Writer
- func (my *Write) Write(rows ...IRows) Writer
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrAlignment ¶ added in v1.66.0
type AttrAlignment struct {
// contains filtered or unexported fields
}
func (*AttrAlignment) Register ¶ added in v1.66.0
func (my *AttrAlignment) Register(cell *Cell)
type AttrBorder ¶ added in v1.66.0
type AttrBorder struct {
// contains filtered or unexported fields
}
func (*AttrBorder) Register ¶ added in v1.66.0
func (my *AttrBorder) Register(cell *Cell)
type AttrContent ¶ added in v1.66.0
type AttrContent struct {
// contains filtered or unexported fields
}
func (*AttrContent) Register ¶ added in v1.66.0
func (my *AttrContent) Register(cell *Cell)
type AttrContentType ¶ added in v1.66.0
type AttrContentType struct {
// contains filtered or unexported fields
}
func (*AttrContentType) Register ¶ added in v1.66.0
func (my *AttrContentType) Register(cell *Cell)
type AttrCoordinate ¶ added in v1.66.0
type AttrCoordinate struct {
// contains filtered or unexported fields
}
func (*AttrCoordinate) Register ¶ added in v1.66.0
func (my *AttrCoordinate) Register(cell *Cell)
type AttrFilename ¶ added in v1.66.0
type AttrFilename struct {
// contains filtered or unexported fields
}
func (*AttrFilename) RegisterForReader ¶ added in v1.66.0
func (my *AttrFilename) RegisterForReader(reader Reader)
func (*AttrFilename) RegisterForWriter ¶ added in v1.66.0
func (my *AttrFilename) RegisterForWriter(writer Writer)
type AttrOpenFileSize ¶ added in v1.66.0
type AttrOpenFileSize struct {
// contains filtered or unexported fields
}
type AttrReadRangeRow ¶ added in v1.66.0
type AttrReadRangeRow struct {
// contains filtered or unexported fields
}
func (*AttrReadRangeRow) RegisterForReader ¶ added in v1.66.0
func (my *AttrReadRangeRow) RegisterForReader(reader Reader)
func (*AttrReadRangeRow) RegisterForWriter ¶ added in v1.66.0
func (my *AttrReadRangeRow) RegisterForWriter(_ Writer)
type AttrSheet ¶ added in v1.66.0
type AttrSheet struct {
// contains filtered or unexported fields
}
func (*AttrSheet) RegisterForReader ¶ added in v1.66.0
func (*AttrSheet) RegisterForWriter ¶ added in v1.66.0
type AttrSheetIndex ¶ added in v1.66.0
type AttrSheetIndex struct {
// contains filtered or unexported fields
}
type AttrSheetName ¶ added in v1.66.0
type AttrSheetName struct {
// contains filtered or unexported fields
}
type AttrUnzipSizeLimit ¶ added in v1.66.0
type AttrUnzipSizeLimit struct {
// contains filtered or unexported fields
}
func (*AttrUnzipSizeLimit) RegisterForReader ¶ added in v1.66.0
func (my *AttrUnzipSizeLimit) RegisterForReader(reader Reader)
func (*AttrUnzipSizeLimit) RegisterForWriter ¶ added in v1.66.0
func (my *AttrUnzipSizeLimit) RegisterForWriter(_ Writer)
type AttrUnzipXMLSizeLimit ¶ added in v1.66.0
type AttrUnzipXMLSizeLimit struct {
// contains filtered or unexported fields
}
func (*AttrUnzipXMLSizeLimit) RegisterForReader ¶ added in v1.66.0
func (my *AttrUnzipXMLSizeLimit) RegisterForReader(reader Reader)
func (*AttrUnzipXMLSizeLimit) RegisterForWriter ¶ added in v1.66.0
func (my *AttrUnzipXMLSizeLimit) RegisterForWriter(_ Writer)
type BaseAttributer ¶ added in v1.66.0
type Cell ¶ added in v1.53.3
type Cell struct {
// contains filtered or unexported fields
}
func (*Cell) GetAlignment ¶ added in v1.66.0
func (my *Cell) GetAlignment() CellAlignmentOpt
GetAlignment 获取字体对齐
func (*Cell) GetContentType ¶ added in v1.53.3
func (my *Cell) GetContentType() CellContentType
GetContentType 获取内容类型
func (*Cell) GetCoordinate ¶ added in v1.53.3
GetCoordinate 获取坐标
func (*Cell) SetAttrs ¶ added in v1.53.3
func (my *Cell) SetAttrs(attrs ...CellAttributer) ICell
SetAttrs 设置属性
func (*Cell) SetCoordinate ¶ added in v1.66.0
SetCoordinate 设置坐标
type CellAlignmentOpt ¶ added in v1.66.0
type CellAttributer ¶ added in v1.53.3
type CellAttributer interface{ Register(cell *Cell) }
func Alignment ¶ added in v1.66.0
func Alignment(alignment CellAlignmentOpt) CellAttributer
func Border ¶ added in v1.66.0
func Border(borderRGB CellBorderRGBOpt, borderStyle CellBorderStyleOpt) CellAttributer
func Content ¶ added in v1.66.0
func Content(content any) CellAttributer
func ContentType ¶ added in v1.66.0
func ContentType(contentType CellContentType) CellAttributer
func Coordinate ¶ added in v1.66.0
func Coordinate(coordinate string) CellAttributer
func Font ¶ added in v1.66.0
func Font(font CellFontOpt) CellAttributer
type CellBorderOpt ¶ added in v1.66.0
type CellBorderRGBOpt ¶ added in v1.66.0
type CellBorderRGBOpt struct{ Top, Bottom, Left, Right, DiagonalUp, DiagonalDown string }
type CellBorderStyleOpt ¶ added in v1.66.0
type CellBorderStyleOpt struct{ Top, Bottom, Left, Right, DiagonalUp, DiagonalDown int }
type CellContentType ¶ added in v1.53.3
type CellContentType string
const ( CellContentTypeAny CellContentType = "ANY" CellContentTypeFormula CellContentType = "FORMULA" CellContentTypeInt CellContentType = "INT" CellContentTypeFloat64 CellContentType = "FLOAT" CellContentTypeBool CellContentType = "BOOL" CellContentTypeTime CellContentType = "TIME" )
type CellFontOpt ¶ added in v1.66.0
type ExcelAttributer ¶ added in v1.66.0
type ExcelAttributer interface {
FilenameAttributer
SheetAttributer
ReadRangeAttributer
OpenFileAttributer
}
type FilenameAttributer ¶ added in v1.66.0
type FilenameAttributer BaseAttributer
func File ¶ added in v1.66.0
func File(file filesystemV4.Filesystemer) FilenameAttributer
func Filename ¶ added in v1.66.0
func Filename(filename string) FilenameAttributer
type ICell ¶ added in v1.66.0
type ICell interface {
SetAttrs(attrs ...CellAttributer) ICell
GetCoordinate() string
SetCoordinate(coordinate string) ICell
SetRowNum(rowNum uint) ICell
GetContent() any
GetContentType() CellContentType
GetFont() CellFontOpt
GetBorder() anySlice.AnySlicer[excelize.Border]
GetAlignment() CellAlignmentOpt
}
func NewCell ¶ added in v1.66.0
func NewCell(content any, attrs ...CellAttributer) ICell
func NewCellBool ¶ added in v1.66.0
func NewCellBool(content bool, attrs ...CellAttributer) ICell
func NewCellFloat64 ¶ added in v1.66.0
func NewCellFloat64(content float64, attrs ...CellAttributer) ICell
func NewCellFormula ¶ added in v1.66.0
func NewCellFormula(content string, attrs ...CellAttributer) ICell
func NewCellInt ¶ added in v1.66.0
func NewCellInt(content int, attrs ...CellAttributer) ICell
func NewCellTime ¶ added in v1.66.0
func NewCellTime(content time.Time, attrs ...CellAttributer) ICell
type IRow ¶ added in v1.66.0
type IRow interface {
SetCells(cells ...ICell) IRow
AppendCells(cells ...ICell) IRow
GetCells() []ICell
SetRowNum(rowNum uint) IRow
GetRowNum() uint
}
func NewRowByNum ¶ added in v1.66.0
NewRowByNum 通过行号新建行数据
type IRows ¶ added in v1.66.0
type OpenFileAttributer ¶ added in v1.66.0
type OpenFileAttributer BaseAttributer
func UnzipSizeLimit ¶ added in v1.66.0
func UnzipSizeLimit(size int64) OpenFileAttributer
func UnzipXMLSizeLimit ¶ added in v1.66.0
func UnzipXMLSizeLimit(size int64) OpenFileAttributer
type Read ¶ added in v1.66.0
type Read struct {
Error error
// contains filtered or unexported fields
}
func (*Read) GetRawExcel ¶ added in v1.66.0
GetRawExcel 获取原始 excelize.File 对象
func (*Read) Read ¶ added in v1.66.0
func (my *Read) Read( sheetName string, callback func(rowNum int, rows *excelize.Rows) (err error), attrs ...ReadRangeAttributer, ) Reader
Read 读取数据,参数为可变参数 ReadRangeAttributer 接口类型,可以通过 OriginalRow 和 FinishedRow 来指定读取范围
func (*Read) SetFilename ¶ added in v1.66.0
func (my *Read) SetFilename(attr ExcelAttributer) Reader
SetFilename 设置文件名
func (*Read) SetOpenFile ¶ added in v1.66.0
func (my *Read) SetOpenFile(attrs ...OpenFileAttributer) Reader
SetOpenFile 设置打开文件的属性,例如解压缩大小限制等
type ReadRangeAttributer ¶ added in v1.66.0
type ReadRangeAttributer BaseAttributer
func FinishedRow ¶ added in v1.66.0
func FinishedRow(row int) ReadRangeAttributer
func OriginalRow ¶ added in v1.66.0
func OriginalRow(row int) ReadRangeAttributer
type Reader ¶
type Reader interface {
GetRawExcel() *excelize.File
SetFilename(attr ExcelAttributer) Reader
SetOpenFile(attrs ...OpenFileAttributer) Reader
Read(sheetName string, callback func(rowNum int, rows *excelize.Rows) (err error), attrs ...ReadRangeAttributer) Reader
// contains filtered or unexported methods
}
func NewReader ¶ added in v1.66.0
func NewReader(attrs ...ExcelAttributer) Reader
type Row ¶ added in v1.53.3
type Row struct {
Error error
// contains filtered or unexported fields
}
func (*Row) AppendCells ¶ added in v1.66.0
AppendCells 追加 cells
type Rows ¶ added in v1.66.0
type Rows struct {
Error error
// contains filtered or unexported fields
}
func (*Rows) AppendRows ¶ added in v1.66.0
AppendRows 追加 rows 自动赋值行号
type SheetAttributer ¶ added in v1.66.0
type SheetAttributer BaseAttributer
func CreateSheet ¶ added in v1.66.0
func CreateSheet(name string) SheetAttributer
func SheetIndex ¶ added in v1.66.0
func SheetIndex(index int) SheetAttributer
func SheetName ¶ added in v1.66.0
func SheetName(name string) SheetAttributer
type Write ¶ added in v1.66.0
type Write struct {
Error error
// contains filtered or unexported fields
}
func (*Write) CreateSheet ¶ added in v1.66.0
func (my *Write) CreateSheet(attr SheetAttributer) Writer
CreateSheet 创建工作表
func (*Write) Download ¶ added in v1.66.0
func (my *Write) Download(writer http.ResponseWriter) error
Download 下载Excel
func (*Write) GetRawExcel ¶ added in v1.66.0
GetRawExcel 获取原始 excelize.File 对象
func (*Write) SetFilename ¶ added in v1.66.0
func (my *Write) SetFilename(attr ExcelAttributer) Writer
SetFilename 设置文件名
func (*Write) SetSheet ¶ added in v1.66.0
func (my *Write) SetSheet(attr SheetAttributer) Writer
SetSheet 设置当前工作表,参数为 SheetAttributer 接口类型,可以通过 SheetName 或 SheetIndex 来指定工作表
type Writer ¶ added in v1.53.3
type Writer interface {
GetRawExcel() *excelize.File
SetFilename(attr ExcelAttributer) Writer
SetSheet(attr SheetAttributer) Writer
CreateSheet(attr SheetAttributer) Writer
Save() (err error)
Download(writer http.ResponseWriter) error
Write(rows ...IRows) Writer
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.