Documentation
¶
Index ¶
- func QuickExtractToFile(excelFile, file string, pretty bool) error
- func QuickExtractToGO(filename string) (string, error)
- func QuickExtractToJSON(filename string, pretty bool) (string, error)
- type AlignmentStyle
- type BorderStyle
- type CellMetadata
- type DataValidation
- type DefinedName
- type DocumentProperties
- type Extractor
- type FillStyle
- type FontStyle
- type Hyperlink
- type ImageFormat
- type ImageMetadata
- type MergedCell
- type Metadata
- type Options
- type Protection
- type SheetDimensions
- type SheetMetadata
- type SheetProtection
- type StyleDetails
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QuickExtractToFile ¶
QuickExtractToFile is a convenience function for extracting to a JSON file
func QuickExtractToGO ¶ added in v1.2.3
QuickExtractToGO is a convenience function for extracting to GO
Types ¶
type AlignmentStyle ¶
type AlignmentStyle struct {
Horizontal string `json:"horizontal,omitempty"`
Vertical string `json:"vertical,omitempty"`
WrapText bool `json:"wrapText,omitempty"`
TextRotation int `json:"textRotation,omitempty"`
Indent int `json:"indent,omitempty"`
ShrinkToFit bool `json:"shrinkToFit,omitempty"`
}
AlignmentStyle represents text alignment
type BorderStyle ¶
type BorderStyle struct {
Type string `json:"type,omitempty"`
Color string `json:"color,omitempty"`
Style int `json:"style,omitempty"`
}
BorderStyle represents cell border formatting
type CellMetadata ¶
type CellMetadata struct {
Address string `json:"address"`
Value interface{} `json:"value,omitempty"`
Formula string `json:"formula,omitempty"`
StyleID int `json:"styleId,omitempty"`
Type excelize.CellType `json:"type"`
Hyperlink *Hyperlink `json:"hyperlink,omitempty"`
}
CellMetadata contains metadata for a single cell
type DataValidation ¶
type DataValidation struct {
Range string `json:"range"`
Type string `json:"type"`
Operator string `json:"operator,omitempty"`
Formula1 string `json:"formula1,omitempty"`
Formula2 string `json:"formula2,omitempty"`
ShowError bool `json:"showError"`
ErrorTitle *string `json:"errorTitle,omitempty"`
ErrorMessage *string `json:"errorMessage,omitempty"`
}
DataValidation represents data validation rules
type DefinedName ¶
type DefinedName struct {
Name string `json:"name"`
RefersTo string `json:"refersTo"`
Scope string `json:"scope,omitempty"`
}
DefinedName represents a named range
type DocumentProperties ¶
type DocumentProperties struct {
Title string `json:"title,omitempty"`
Subject string `json:"subject,omitempty"`
Creator string `json:"creator,omitempty"`
Keywords string `json:"keywords,omitempty"`
Description string `json:"description,omitempty"`
LastModifiedBy string `json:"lastModifiedBy,omitempty"`
Category string `json:"category,omitempty"`
Version string `json:"version,omitempty"`
Created string `json:"created,omitempty"`
Modified string `json:"modified,omitempty"`
}
DocumentProperties contains Excel document properties
type Extractor ¶
type Extractor struct {
// contains filtered or unexported fields
}
Extractor is the main interface for extracting Excel metadata
func (*Extractor) ExtractToFile ¶
ExtractToFile extracts metadata and saves it to a JSON or GO file
func (*Extractor) ExtractToGO ¶ added in v1.2.3
ExtractToGO extracts metadata and returns it as GO string
type FillStyle ¶
type FillStyle struct {
Type string `json:"type,omitempty"`
Pattern int `json:"pattern,omitempty"`
Color []string `json:"color,omitempty"`
}
FillStyle represents cell fill formatting
type FontStyle ¶
type FontStyle struct {
Bold bool `json:"bold,omitempty"`
Italic bool `json:"italic,omitempty"`
Underline string `json:"underline,omitempty"`
Strike bool `json:"strike,omitempty"`
Family string `json:"family,omitempty"`
Size float64 `json:"size,omitempty"`
Color string `json:"color,omitempty"`
}
FontStyle represents font formatting
type Hyperlink ¶
type Hyperlink struct {
Link string `json:"link"`
}
Hyperlink represents a cell hyperlink
type ImageFormat ¶
type ImageMetadata ¶
type ImageMetadata struct {
Cell string `json:"cell"`
File []byte `json:"file"`
Extension string `json:"extension"`
InsertType byte `json:"insertType"`
Format *ImageFormat `json:"format"`
}
ImageMetadata represents image information
type MergedCell ¶
type MergedCell struct {
StartCell string `json:"startCell"`
EndCell string `json:"endCell"`
Value string `json:"value,omitempty"`
}
MergedCell represents a merged cell range
type Metadata ¶
type Metadata struct {
Filename string `json:"filename"`
Properties DocumentProperties `json:"properties"`
Sheets []SheetMetadata `json:"sheets"`
DefinedNames []DefinedName `json:"definedNames,omitempty"`
Styles map[int]StyleDetails `json:"styles,omitempty"`
ExtractedAt time.Time `json:"extractedAt"`
}
Metadata represents the complete Excel file metadata
func QuickExtract ¶
QuickExtract is a convenience function for simple extraction
type Options ¶
type Options struct {
IncludeCellData bool
IncludeStyles bool
IncludeImages bool
IncludeDefinedNames bool
IncludeDataValidation bool
MaxCellsPerSheet int
}
Options configures the extraction behavior
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions returns recommended default options
type Protection ¶
type Protection struct {
Hidden bool `json:"hidden,omitempty"`
Locked bool `json:"locked,omitempty"`
}
Protection represents cell protection settings
type SheetDimensions ¶
type SheetDimensions struct {
StartCell string `json:"startCell"`
EndCell string `json:"endCell"`
RowCount int `json:"rowCount"`
ColCount int `json:"colCount"`
}
SheetDimensions represents the used range of a sheet
type SheetMetadata ¶
type SheetMetadata struct {
Index int `json:"index"`
Name string `json:"name"`
Visible bool `json:"visible"`
Dimensions SheetDimensions `json:"dimensions"`
MergedCells []MergedCell `json:"mergedCells,omitempty"`
DataValidations []DataValidation `json:"dataValidations,omitempty"`
Protection *SheetProtection `json:"protection,omitempty"`
RowHeights map[int]float64 `json:"rowHeights,omitempty"`
ColWidths map[string]float64 `json:"colWidths,omitempty"`
Cells []CellMetadata `json:"cells,omitempty"`
Images []ImageMetadata `json:"images,omitempty"`
}
SheetMetadata contains metadata for a single sheet
type SheetProtection ¶
type SheetProtection struct {
Protected bool `json:"protected"`
Password string `json:"password,omitempty"`
EditObjects bool `json:"editObjects"`
EditScenarios bool `json:"editScenarios"`
SelectLockedCells bool `json:"selectLockedCells"`
SelectUnlockedCells bool `json:"selectUnlockedCells"`
}
SheetProtection represents sheet protection settings
type StyleDetails ¶
type StyleDetails struct {
Font *FontStyle `json:"font,omitempty"`
Fill *FillStyle `json:"fill,omitempty"`
Border []BorderStyle `json:"border,omitempty"`
Alignment *AlignmentStyle `json:"alignment,omitempty"`
NumberFormat int `json:"numberFormat,omitempty"`
Protection *Protection `json:"protection,omitempty"`
}
StyleDetails contains detailed style information