Documentation ¶
Overview ¶
Package xlsx implements a simple xlsx library.
Index ¶
- Variables
- func Register(charset string, decoder func(io.Reader) io.Reader)
- type Book
- type Cell
- func (c *Cell) Bool() bool
- func (c *Cell) Float() float64
- func (c *Cell) Int() int
- func (c *Cell) IsBlank() bool
- func (c *Cell) SetBool(v bool)
- func (c *Cell) SetFloat(v float64)
- func (c *Cell) SetInt(v int)
- func (c *Cell) SetString(v string)
- func (c *Cell) SetTime(v time.Time)
- func (c *Cell) String() string
- func (c *Cell) Time() time.Time
- type QueryOptions
- func (opts *QueryOptions) Head(option int) *QueryOptions
- func (opts *QueryOptions) SkipBlank(option bool) *QueryOptions
- func (opts *QueryOptions) SkipBottom(option int) *QueryOptions
- func (opts *QueryOptions) SkipLeft(option int) *QueryOptions
- func (opts *QueryOptions) SkipRight(option int) *QueryOptions
- func (opts *QueryOptions) SkipTop(option int) *QueryOptions
- type Record
- type Row
- type Sheet
- func (s *Sheet) Cell(ref string) *Cell
- func (s *Sheet) ICell(ridx, cidx int) *Cell
- func (s *Sheet) IRow(ridx int) *Row
- func (s *Sheet) Len() int
- func (s *Sheet) Name() string
- func (s *Sheet) Query(options *QueryOptions) func(func(Record) bool)
- func (s *Sheet) Row(ref string) *Row
- func (s *Sheet) Rows(yield func(*Row) bool)
- type Template
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnknownCharset = internal.ErrUnknownCharset ErrInvalidFile = internal.ErrInvalidFile ErrInvalidTemplate = internal.ErrInvalidTemplate ErrInvalidQueryOption = errors.New("xlsx: invalid query option") )
Errors.
Functions ¶
Types ¶
type Book ¶
Book represents a workbook.
func (*Book) DumpWriter ¶
DumpWriter dumps the book to io.Writer.
type Cell ¶
Cell represents a cell.
type QueryOptions ¶
type QueryOptions struct {
// contains filtered or unexported fields
}
QueryOptions represents the query options.
func NewQueryOptions ¶
func NewQueryOptions() *QueryOptions
NewQueryOptions returns a default query options. Default:
Head: 1 SkipBlank: true
func (*QueryOptions) Head ¶
func (opts *QueryOptions) Head(option int) *QueryOptions
Head marks the number of rows for head.
func (*QueryOptions) SkipBlank ¶
func (opts *QueryOptions) SkipBlank(option bool) *QueryOptions
SkipBlank marks whether to skip blank rows.
func (*QueryOptions) SkipBottom ¶
func (opts *QueryOptions) SkipBottom(option int) *QueryOptions
SkipBottom marks the number of rows skipped at the bottom.
func (*QueryOptions) SkipLeft ¶
func (opts *QueryOptions) SkipLeft(option int) *QueryOptions
SkipLeft marks the number of rows skipped at the left.
func (*QueryOptions) SkipRight ¶
func (opts *QueryOptions) SkipRight(option int) *QueryOptions
SkipRight marks the number of rows skipped at the right.
func (*QueryOptions) SkipTop ¶
func (opts *QueryOptions) SkipTop(option int) *QueryOptions
SkipTop marks the number of rows skipped at the top.
type Record ¶
type Record struct {
// contains filtered or unexported fields
}
Record represents a record.
type Row ¶
Row represents a row.
func (*Row) Cell ¶
Cell returns the cell by reference. The returned cell is guaranteed not to be nil.
type Sheet ¶
Sheet represents a worksheet.
func (*Sheet) Cell ¶
Cell returns the cell by reference. The returned cell is guaranteed not to be nil.
func (*Sheet) ICell ¶
ICell returns the cell by index. The returned cell is guaranteed not to be nil.
func (*Sheet) Query ¶
func (s *Sheet) Query(options *QueryOptions) func(func(Record) bool)
Query queries the records. If options is nil, use the default options.
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
Template is the representation of a parsed template. It is goroutine safe.
func ParseBytes ¶
ParseBytes creates a new Template and parses the template definitions from the bytes.
func ParseFile ¶
ParseFiles creates a new Template and parses the template definitions from the named file.
func ParseReader ¶
ParseReader creates a new Template and parses the template definitions from the Reader.
func (*Template) ExecuteBytes ¶
ExecuteBytes applies a parsed template to the specified data object, and writes the output to the bytes.
func (*Template) ExecuteFile ¶
ExecuteFile applies a parsed template to the specified data object, and writes the output to the named file.