Documentation
¶
Overview ¶
Package xmltypes defines shared types used across the go-spreadsheet library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alignment ¶
type Alignment struct {
Horizontal string `json:"horizontal,omitempty"` // "left", "center", "right", "fill", "justify"
Vertical string `json:"vertical,omitempty"` // "top", "center", "bottom"
WrapText bool `json:"wrap_text,omitempty"`
Indent int `json:"indent,omitempty"`
TextRotation int `json:"text_rotation,omitempty"`
ShrinkToFit bool `json:"shrink_to_fit,omitempty"`
}
Alignment holds cell text alignment options.
type Border ¶
type Border struct {
Type string `json:"type,omitempty"` // "thin", "thick", etc.
Color string `json:"color,omitempty"`
}
Border holds border styling for a cell.
type DocProps ¶
type DocProps struct {
Creator string `json:"creator,omitempty" xml:"dc:creator,omitempty"`
Title string `json:"title,omitempty" xml:"dc:title,omitempty"`
Description string `json:"description,omitempty" xml:"dc:description,omitempty"`
Subject string `json:"subject,omitempty" xml:"dc:subject,omitempty"`
Keywords string `json:"keywords,omitempty" xml:"cp:keywords,omitempty"`
Created string `json:"created,omitempty" xml:"dcterms:created,omitempty"`
Modified string `json:"modified,omitempty" xml:"dcterms:modified,omitempty"`
Category string `json:"category,omitempty" xml:"cp:category,omitempty"`
Status string `json:"status,omitempty" xml:"cp:contentStatus,omitempty"`
Version string `json:"version,omitempty" xml:"cp:version,omitempty"`
LastModifiedBy string `json:"last_modified_by,omitempty" xml:"cp:lastModifiedBy,omitempty"`
Language string `json:"language,omitempty" xml:"cp:language,omitempty"`
Revision string `json:"revision,omitempty" xml:"cp:revision,omitempty"`
Identifier string `json:"identifier,omitempty" xml:"dc:identifier,omitempty"`
Coverage string `json:"coverage,omitempty" xml:"dc:coverage,omitempty"`
Rights string `json:"rights,omitempty" xml:"dc:rights,omitempty"`
ContentType string `json:"content_type,omitempty" xml:"cp:contentType,omitempty"`
}
DocProps holds document property information.
type Fill ¶
type Fill struct {
Type string `json:"type,omitempty"` // "pattern", "gradient"
Pattern string `json:"pattern,omitempty"`
Color string `json:"color,omitempty"`
}
Fill holds fill (background) styling.
type Font ¶
type Font struct {
Bold bool `json:"bold,omitempty"`
Italic bool `json:"italic,omitempty"`
Underline string `json:"underline,omitempty"` // "single", "double", etc.
Strike bool `json:"strike,omitempty"`
Size float64 `json:"size,omitempty"`
Color string `json:"color,omitempty"` // hex ARGB e.g. "FF000000"
Family string `json:"family,omitempty"`
}
Font holds font styling properties.
type GraphicOptions ¶
type GraphicOptions struct {
AutoFit bool `json:"auto_fit,omitempty"`
OffsetX int `json:"offset_x,omitempty"`
OffsetY int `json:"offset_y,omitempty"`
ScaleX float64 `json:"scale_x,omitempty"`
ScaleY float64 `json:"scale_y,omitempty"`
Hyperlink string `json:"hyperlink,omitempty"`
HyperlinkType string `json:"hyperlink_type,omitempty"`
Positioning string `json:"positioning,omitempty"`
PrintObject *bool `json:"print_object,omitempty"`
Locked *bool `json:"locked,omitempty"`
}
GraphicOptions holds options for adding pictures/graphics.
type SheetEntity ¶
type SheetEntity struct {
Name string `xml:"name,attr"`
SheetId string `xml:"sheetId,attr"`
Id string `xml:"id,attr"`
}
SheetEntity represents a single sheet entry as seen in the workbook structure.
type SheetProtection ¶
type SheetProtection struct {
Password string `json:"password,omitempty"`
Sheet bool `json:"sheet,omitempty"`
Objects bool `json:"objects,omitempty"`
Scenarios bool `json:"scenarios,omitempty"`
FormatCells bool `json:"format_cells,omitempty"`
FormatColumns bool `json:"format_columns,omitempty"`
FormatRows bool `json:"format_rows,omitempty"`
InsertColumns bool `json:"insert_columns,omitempty"`
InsertRows bool `json:"insert_rows,omitempty"`
InsertHyperlinks bool `json:"insert_hyperlinks,omitempty"`
DeleteColumns bool `json:"delete_columns,omitempty"`
DeleteRows bool `json:"delete_rows,omitempty"`
SelectLockedCells bool `json:"select_locked_cells,omitempty"`
Sort bool `json:"sort,omitempty"`
AutoFilter bool `json:"auto_filter,omitempty"`
PivotTables bool `json:"pivot_tables,omitempty"`
SelectUnlockedCells bool `json:"select_unlocked_cells,omitempty"`
}
SheetProtection holds sheet protection settings.
type SheetsCollection ¶
type SheetsCollection struct {
Sheet []SheetEntity `xml:"sheet"`
}
SheetsCollection represents the collection of sheets in the workbook.
type StyleConfig ¶
type StyleConfig struct {
Font *Font `json:"font,omitempty"`
Fill *Fill `json:"fill,omitempty"`
Border []Border `json:"border,omitempty"`
Alignment *Alignment `json:"alignment,omitempty"`
NumFmt string `json:"num_fmt,omitempty"` // e.g. "0.00", "#,##0", "dd/mm/yyyy"
NumFmtID int `json:"num_fmt_id,omitempty"`
DecimalPlaces int `json:"decimal_places,omitempty"`
}
StyleConfig holds all styling properties for a cell.
type WorkBookEntity ¶
type WorkBookEntity struct {
XMLName xml.Name `xml:"workbook"`
Sheets SheetsCollection `xml:"sheets"`
}
WorkBookEntity represents the main workbook structure.