Versions in this module Expand all Collapse all v0 v0.3.0 Nov 4, 2026 Changes in this version + var ErrStreamingOrder = errors.New("streaming writer requires one worksheet at a time") type Options + FlushEveryRows int type Workbook + func NewStreamWriter(w io.Writer, opts Options) (*Workbook, error) + func (wb *Workbook) Flush() error v0.2.0 Nov 4, 2026 Changes in this version + var ErrCellTooLong = errors.New("cell value is too long") + var ErrCorruptFile = errors.New("corrupt XLSX file") + var ErrEncrypted = errors.New("encrypted workbooks are not supported") + var ErrInvalidCellReference = errors.New("invalid cell reference") + var ErrInvalidFormula = errors.New("invalid cell formula") + var ErrInvalidHyperlink = errors.New("invalid cell hyperlink") + var ErrInvalidRange = errors.New("invalid A1 range") + var ErrInvalidRow = errors.New("invalid row") + var ErrInvalidStyle = errors.New("invalid cell style") + var ErrReadLimit = errors.New("reader limit exceeded") + var ErrSheetClosed = errors.New("worksheet reader is closed") + var ErrSheetNotFound = errors.New("worksheet not found") + var ErrTooManySheets = errors.New("too many worksheets") + var ErrUnsupportedFormat = errors.New("unsupported spreadsheet format") + var ErrWrongCellType = errors.New("wrong cell type") + func Validate(filePath string, opts ...ValidateOption) error + func ValidateReaderAt(r io.ReaderAt, size int64, opts ...ValidateOption) error type Cell + Formula string + Hyperlink string + StyleID int + func (c *Cell) SetBool(value bool) *Cell + func (c *Cell) SetFloat(value float64) *Cell + func (c *Cell) SetFormula(formula string) *Cell + func (c *Cell) SetHyperlink(target string) *Cell + func (c *Cell) SetInt(value int64) *Cell + func (c *Cell) SetString(value string) *Cell + func (c *Cell) SetStyle(styleID int) *Cell + func (c *Cell) SetTime(value time.Time) *Cell + type CellData struct + BoolValue bool + Column int + Formula string + HasValue bool + Number float64 + Raw string + Ref string + Row int + StyleID int + TimeValue time.Time + Type CellType + func (c CellData) Bool() (bool, error) + func (c CellData) Float64() (float64, error) + func (c CellData) Int64() (int64, error) + func (c CellData) String() (string, error) + func (c CellData) Time() (time.Time, error) + type CellType uint8 + const CellTypeBlank + const CellTypeBool + const CellTypeDate + const CellTypeError + const CellTypeNumber + const CellTypeString + type Compression uint8 + const CompressionBestCompression + const CompressionBestSpeed + const CompressionDefault + const CompressionStore + type Options struct + BufferSize int + Compression Compression + Context context.Context + FileMode os.FileMode + KeepTempFiles bool + MaxCellLength int + MaxColumns int + MaxRows int + MaxSheets int + SharedStrings bool + TempDir string + TempDirMode os.FileMode + func DefaultOptions() Options + type ReadOption func(*ReadOptions) + func WithReadContext(ctx context.Context) ReadOption + func WithReadLimits(maxUncompressedSize int64, maxEntries int) ReadOption + func WithReadMaxCellLength(length int) ReadOption + func WithReadMaxColumns(columns int) ReadOption + func WithReadMaxRows(rows int) ReadOption + func WithReadTempDir(dir string) ReadOption + func WithSharedStringsMode(mode SharedStringsMode) ReadOption + type ReadOptions struct + Context context.Context + MaxCellLength int + MaxColumns int + MaxEntries int + MaxRows int + MaxUncompressedSize int64 + SharedStringsMemoryLimit int64 + SharedStringsMode SharedStringsMode + TempDir string + func DefaultReadOptions() ReadOptions + type Reader struct + func Open(path string, opts ...ReadOption) (*Reader, error) + func OpenReaderAt(r io.ReaderAt, size int64, opts ...ReadOption) (*Reader, error) + func (r *Reader) Close() error + func (r *Reader) OpenSheet(name string) (*SheetReader, error) + func (r *Reader) Sheets() []SheetInfo type Row + Height float64 + func (r *Row) Append(values ...interface{}) error + func (r *Row) SetHeight(height float64) error + func (r *Row) WriteBool(value bool) (*Cell, error) + func (r *Row) WriteFloat(value float64) (*Cell, error) + func (r *Row) WriteInt(value int64) (*Cell, error) + func (r *Row) WriteString(value string) (*Cell, error) + func (r *Row) WriteTime(value time.Time) (*Cell, error) + type RowData struct + Cells []CellData + Index int + func (r *RowData) Cell(ref string) (*CellData, bool) + func (r *RowData) CellAt(column int) (*CellData, bool) + type SharedStringsMode uint8 + const SharedStringsAuto + const SharedStringsDisk + const SharedStringsMemory + type SheetInfo struct + Hidden bool + ID int + Name string + Path string + RelID string + State string + type SheetReader struct + func (s *SheetReader) Close() error + func (s *SheetReader) Err() error + func (s *SheetReader) Info() SheetInfo + func (s *SheetReader) Next() bool + func (s *SheetReader) Row() *RowData + type Style struct + Bold bool + FillColor string + FontColor string + FontSize float64 + Horizontal string + Italic bool + NumberFormat string + Underline bool + Vertical string + WrapText bool + type ValidateOption = ReadOption type Workbook + func NewWorkbookWithOptions(filePath string, opts Options) (*Workbook, error) + func NewWriter(w io.Writer, opts Options) (*Workbook, error) + func (wb *Workbook) AddStyle(style Style) (int, error) + func (wb *Workbook) Close() error + func (wb *Workbook) Context() context.Context + func (wb *Workbook) TempDir() string type Worksheet + func (ws *Worksheet) FreezePanes(rows, columns int) error + func (ws *Worksheet) MergeCells(ranges ...string) error + func (ws *Worksheet) SetAutoFilter(ref string) error v0.1.0 Nov 3, 2026 Changes in this version + var ErrColumnsDefined = errors.New("columns were defined on the worksheet") + var ErrDuplicateSheetName = errors.New("duplicate worksheet name") + var ErrInvalidColumn = errors.New("invalid worksheet column") + var ErrInvalidSheetName = errors.New("invalid worksheet name") + var ErrNoColumns = errors.New("no columns were defined on the worksheet") + var ErrNoRows = errors.New("there are no rows to commit") + var ErrNoWorksheets = errors.New("a workbook needs at least one worksheet") + var ErrPendingRows = errors.New("worksheet has pending rows") + var ErrUnsupportedType = errors.New("unsupported cell value type") + var ErrWorkbookCommitted = errors.New("workbook already committed") + var ErrWorksheetCommitted = errors.New("worksheet already committed") + type Cell struct + Key string + Value interface{} + func (c *Cell) Identifier() string + func (c *Cell) Index() int + func (c *Cell) Row() *Row + type CellOptions struct + Key *string + Value interface{} + type Row struct + func (r *Row) AddCell() (*Cell, error) + func (r *Row) AddCellWithKey(key string) (*Cell, error) + func (r *Row) Index() int + type Workbook struct + FilePath string + func NewWorkbook(filePath string) *Workbook + func (wb *Workbook) AddWorksheet(opts *WorksheetOptions) *Worksheet + func (wb *Workbook) Cleanup() error + func (wb *Workbook) Commit() error + func (wb *Workbook) HasPendingWorksheets() bool + func (wb *Workbook) Worksheets() []*Worksheet + type Worksheet struct + func (ws *Worksheet) AddRow() (*Row, error) + func (ws *Worksheet) Commit() error + func (ws *Worksheet) CommitRows() error + func (ws *Worksheet) DefineColumns(columns []*WorksheetColumn) error + func (ws *Worksheet) FileName() string + func (ws *Worksheet) ID() int + func (ws *Worksheet) Name() string + type WorksheetColumn struct + Key string + Value string + Width float64 + type WorksheetOptions struct + Name string