Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultDateParser(src string) any
- func DefaultStrDataParser(src string) any
- type CellStyle
- type Cursor
- type Document
- func (d *Document) Close() (err error)
- func (d *Document) GetSheetData(opt *Option) ([][]string, error)
- func (d *Document) ReadSheetByRow(opt ...RowReadOption) (Cursor, error)
- func (d *Document) ReadSheetByTable(dst any, opt ...*Option) error
- func (d *Document) Save() (err error)
- func (d *Document) Write(w io.Writer) (size int64, err error)
- func (d *Document) WriteBuffer() (*bytes.Buffer, error)
- func (d *Document) WriteSheetByRow(opt ...RowWriteOption) WriteCursor
- func (d *Document) WriteSheetData(opt *Option) (res [][]string, err error)
- type IParser
- type Option
- type RowReadCursor
- type RowReadOption
- type RowWriteCursor
- type RowWriteOption
- type TagInfo
- type WriteCursor
Constants ¶
View Source
const TAG_NAME = "xlsr"
标签名称
Variables ¶
View Source
var ( ErrNotPtr = errors.New("dst needs to be a pointer") ErrInvlidKind = errors.New("invalid kind of dst") )
View Source
var ( DefaultDateStyleStr = "yyyy-mm-dd" DefaultDateStyle = CellStyle{ Style: &excelize.Style{CustomNumFmt: &DefaultDateStyleStr}, } )
View Source
var (
ErrUnknownType = errors.New("unknown type field")
)
Functions ¶
func DefaultStrDataParser ¶
Types ¶
type CellStyle ¶
type CellStyle struct { Style *excelize.Style // contains filtered or unexported fields }
格式转换器
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func (*Document) ReadSheetByRow ¶
func (d *Document) ReadSheetByRow(opt ...RowReadOption) (Cursor, error)
func (*Document) ReadSheetByTable ¶
将工作表中的数据根据struct中的tag插入结构体中 (目标为单个结构体)
func (*Document) WriteSheetByRow ¶
func (d *Document) WriteSheetByRow(opt ...RowWriteOption) WriteCursor
type RowReadCursor ¶
type RowReadCursor struct {
// contains filtered or unexported fields
}
读取光标
func (*RowReadCursor) All ¶
func (c *RowReadCursor) All(dst any) error
将工作表中的数据根据struct中的tag插入结构体中 (目标为结构体切片)
func (*RowReadCursor) Next ¶
func (c *RowReadCursor) Next() (hasNext bool)
funcNext implements Cursor
type RowReadOption ¶
type RowWriteCursor ¶
type RowWriteCursor struct {
// contains filtered or unexported fields
}
func (*RowWriteCursor) Format ¶
func (c *RowWriteCursor) Format(dst any) error
Format implements WriteCursor
func (*RowWriteCursor) Next ¶
func (c *RowWriteCursor) Next()
type RowWriteOption ¶
Click to show internal directories.
Click to hide internal directories.