Documentation ¶
Index ¶
- Variables
- func CellIdx(ref string) (ridx int, cidx int)
- func CellRef(i, j int) string
- func CharsetReader(charset string, r io.Reader) (io.Reader, error)
- func ColIdx(ref string) int
- func ColRef(j int) string
- func RangeIdx(ref string) (ridx1, cidx1 int, ridx2, cidx2 int)
- func RangeRef(ridx1, cidx1 int, ridx2, cidx2 int) string
- func RowIdx(ref string) int
- func RowRef(i int) string
- 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) MarshalXML(encoder *xml.Encoder, start xml.StartElement) error
- func (c *Cell) Primary() *Cell
- 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
- func (c *Cell) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) error
- type ComplexFragment
- type ContentTypes
- type Dimension
- type Element
- type Entry
- type Fragment
- type MergeCell
- type MergeCells
- type Override
- type Rel
- type Rels
- type Row
- type SSI
- type SSR
- type SST
- type Sheet
- type SheetInfo
- type SimpleFragment
- type Text
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnknownCharset = errors.New("xlsx: unknown charset") ErrInvalidFile = errors.New("xlsx: invalid file") ErrInvalidTemplate = errors.New("xlsx: invalid template") )
Errors.
Charsets represents the charsets.
Functions ¶
func CharsetReader ¶
CharsetReader represents the charset reader.
Types ¶
type Book ¶
type Book struct {
// contains filtered or unexported fields
}
Book represents a book.
func (*Book) MarshalXML ¶
MarshalXML encodes the receiver as zero or more XML elements.
func (*Book) UnmarshalXML ¶
UnmarshalXML decodes a single XML element beginning with the given start element.
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
Cell represents a cell.
func (*Cell) MarshalXML ¶
MarshalXML encodes the receiver as zero or more XML elements.
func (*Cell) Primary ¶
Primary returns the primary cell. The returned cell is guaranteed not to be nil.
func (*Cell) UnmarshalXML ¶
UnmarshalXML decodes a single XML element beginning with the given start element.
type ComplexFragment ¶
type ComplexFragment struct {
// contains filtered or unexported fields
}
ComplexFragment represents a complex fragment of a template.
func (*ComplexFragment) Clone ¶
func (cf *ComplexFragment) Clone(ctx map[*Cell]*Cell) Fragment
Clone clones the fragment.
func (*ComplexFragment) Fill ¶
Fill applies a parsed fragment to the specified data, and writes the output to the sheet.
func (*ComplexFragment) Key ¶
func (cf *ComplexFragment) Key(level int) string
Key returns the key of the fragment.
type ContentTypes ¶
type ContentTypes struct { XMLName xml.Name Defaults []*Element `xml:"Default,omitempty"` Overrides []Override `xml:"Override,omitempty"` }
ContentTypes represents the content types.
func (*ContentTypes) Add ¶
func (c *ContentTypes) Add(pname string, ctype string)
Add adds a override to content types.
type Dimension ¶
type Dimension struct {
Ref string `xml:"ref,attr"`
}
Dimension represents a dimension element.
type Element ¶
type Element struct { Attrs []xml.Attr `xml:",any,attr,omitempty"` InnerXML []byte `xml:",innerxml"` }
Element represents a xml element.
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
Entry represents a book entry.
type Fragment ¶
type Fragment interface { // Key returns the key of the fragment. Key(level int) string // Clone clones the fragment. Clone(ctx map[*Cell]*Cell) Fragment // Fill applies a parsed fragment to the specified data, and writes the output to the sheet. Fill(sheet *Sheet, level int, data reflect.Value) error }
Fragment represents a fragment of a template.
func BuildFragment ¶
BuildFragment build fragment from sheet.
type MergeCell ¶
type MergeCell struct {
Ref string `xml:"ref,attr"`
}
MergeCell represents a mergeCell element.
type MergeCells ¶
type MergeCells struct { Count int `xml:"count,attr"` Entries []*MergeCell `xml:"mergeCell,omitempty"` }
MergeCells represents the mergeCell elements.
type Override ¶
type Override struct { PartName string `xml:"PartName,attr"` ContentType string `xml:"ContentType,attr"` }
Override represents the content override.
type Rel ¶
type Rel struct { ID string `xml:"Id,attr"` Type string `xml:"Type,attr"` Target string `xml:"Target,attr"` }
Rel represents a rel.
type Row ¶
type Row struct {
// contains filtered or unexported fields
}
Row represents a row.
func (*Row) MarshalXML ¶
MarshalXML encodes the receiver as zero or more XML elements.
func (*Row) UnmarshalXML ¶
UnmarshalXML decodes a single XML element beginning with the given start element.
type SSI ¶
SSI represents a shared string si element.
type SST ¶
type SST struct {
// contains filtered or unexported fields
}
SST represents the shared strings.
func (*SST) MarshalXML ¶
MarshalXML encodes the receiver as zero or more XML elements.
func (*SST) UnmarshalXML ¶
UnmarshalXML decodes a single XML element beginning with the given start element.
type Sheet ¶
type Sheet struct {
// contains filtered or unexported fields
}
Sheet represents a sheet.
func (*Sheet) MarshalXML ¶
MarshalXML encodes the receiver as zero or more XML elements.
func (*Sheet) UnmarshalXML ¶
UnmarshalXML decodes a single XML element beginning with the given start element.
type SheetInfo ¶
type SheetInfo struct { Attrs []xml.Attr `xml:",any,attr,omitempty"` ID xml.Attr `xml:"id,attr"` Name string `xml:"name,attr"` }
SheetInfo represents the sheet infomation.
type SimpleFragment ¶
type SimpleFragment struct {
// contains filtered or unexported fields
}
SimpleFragment represents a simple fragment of a template.
func (*SimpleFragment) Clone ¶
func (sf *SimpleFragment) Clone(ctx map[*Cell]*Cell) Fragment
Clone clones the fragment.
func (*SimpleFragment) Fill ¶
Fill applies a parsed fragment to the specified data, and writes the output to the sheet.
func (*SimpleFragment) Key ¶
func (sf *SimpleFragment) Key(level int) string
Key returns the key of the fragment.