Documentation ¶
Index ¶
Constants ¶
View Source
const ( XLSX = "xlsx" XLS = "xls" CSV = "csv" )
Variables ¶
View Source
var (
SheetIgnore = errors.New("ignore sheet")
)
Functions ¶
func FormatDate ¶
func NumberRemoveComma ¶ added in v0.0.4
Types ¶
type CsvFileParse ¶
type CsvFileParse struct {
// contains filtered or unexported fields
}
func (*CsvFileParse) Init ¶
func (x *CsvFileParse) Init(buf *bytes.Buffer) *ParseError
func (*CsvFileParse) Len ¶
func (x *CsvFileParse) Len() int
func (*CsvFileParse) Parse ¶
func (x *CsvFileParse) Parse(h FileHandle, ignore bool) *ParseError
func (*CsvFileParse) Type ¶
func (x *CsvFileParse) Type() string
type FileHandle ¶ added in v0.0.2
type FileHandle interface {
Each(name string, idx int) (SheetHandle, error)
}
func NewFileHandle ¶ added in v0.0.3
func NewFileHandle(sh SheetHandle) FileHandle
type FileParse ¶
type FileParse interface { Type() string Init(buf *bytes.Buffer) *ParseError Len() int Parse(h FileHandle, ignoreErr bool) *ParseError }
type ParseError ¶
type ParseError struct { Sheets []*ParseSheetError Err error }
func Parse ¶
func Parse(ft string, buf *bytes.Buffer, h FileHandle, ignore bool, fps ...FileParse) *ParseError
type ParseRowError ¶ added in v0.0.3
type ParseSheetError ¶ added in v0.0.3
type ParseSheetError struct { Index int Name string Err error Rows []*ParseRowError }
type SheetHandle ¶
type XlsFileParse ¶
type XlsFileParse struct {
// contains filtered or unexported fields
}
func (*XlsFileParse) Init ¶
func (x *XlsFileParse) Init(buf *bytes.Buffer) *ParseError
func (*XlsFileParse) Len ¶
func (x *XlsFileParse) Len() int
func (*XlsFileParse) Parse ¶
func (x *XlsFileParse) Parse(h FileHandle, ignore bool) *ParseError
func (*XlsFileParse) Type ¶
func (x *XlsFileParse) Type() string
type XlsxFileParse ¶
type XlsxFileParse struct { Limit int // contains filtered or unexported fields }
func (*XlsxFileParse) Init ¶
func (x *XlsxFileParse) Init(buf *bytes.Buffer) *ParseError
func (*XlsxFileParse) Len ¶
func (x *XlsxFileParse) Len() int
func (*XlsxFileParse) Parse ¶
func (x *XlsxFileParse) Parse(h FileHandle, ignore bool) *ParseError
func (*XlsxFileParse) Type ¶
func (x *XlsxFileParse) Type() string
Click to show internal directories.
Click to hide internal directories.