xlsx

package module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2023 License: MIT Imports: 14 Imported by: 1

Documentation

Overview

Package xlsx implements a basic xlsx library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(charset string, decoder func(io.Reader) io.Reader)

Register registers a charset decoder.

Types

type Book

type Book struct {
	// contains filtered or unexported fields
}

Book represents a workbook.

func OpenBytes

func OpenBytes(bs []byte) (*Book, error)

OpenBytes opens the workbook from bytes.

func OpenFile

func OpenFile(name string) (*Book, error)

OpenFile opens the workbook from file.

func OpenReader

func OpenReader(r io.Reader) (*Book, error)

OpenReader opens the workbook from reader.

func OpenZIP

func OpenZIP(zr *zip.Reader) (*Book, error)

OpenZIP opens the workbook from zip reader.

func (*Book) SaveBytes

func (a *Book) SaveBytes() ([]byte, error)

SaveBytes saves workbook to bytes.

func (*Book) SaveFile

func (a *Book) SaveFile(name string) error

SaveFile saves workbook to file.

func (*Book) SaveWriter

func (a *Book) SaveWriter(w io.Writer) error

SaveWriter saves workbook to writer.

func (*Book) SaveZIP

func (a *Book) SaveZIP(zw *zip.Writer) error

SaveZIP saves workbook to zip writer.

func (*Book) Sheet

func (a *Book) Sheet(name string) (*Sheet, error)

Sheet returns the sheet by name.

func (*Book) SheetNames added in v0.1.3

func (a *Book) SheetNames() (names []string)

SheetNames returns all sheet names.

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

Cell represents a cell.

func (*Cell) Bool

func (a *Cell) Bool() bool

Bool gets the cell value as bool.

func (*Cell) Float

func (a *Cell) Float() float64

Float gets the cell value as float64.

func (*Cell) Int

func (a *Cell) Int() int

Int gets the cell value as int.

func (*Cell) SetBool

func (a *Cell) SetBool(v bool)

SetBool sets the cell bool value.

func (*Cell) SetFloat

func (a *Cell) SetFloat(v float64)

SetFloat sets the cell float64 value.

func (*Cell) SetInt

func (a *Cell) SetInt(v int)

SetInt sets the cell int value.

func (*Cell) SetString

func (a *Cell) SetString(v string)

SetString sets the cell string value.

func (*Cell) SetStyle

func (a *Cell) SetStyle(s string)

SetStyle sets the cell style.

func (*Cell) SetTime

func (a *Cell) SetTime(v time.Time)

SetTime sets the cell time value.

func (*Cell) String

func (a *Cell) String() string

String gets the cell value as string.

func (*Cell) Style

func (a *Cell) Style() string

Style gets the cell style.

func (*Cell) Time

func (a *Cell) Time() time.Time

Time gets the cell value as time.

type Record added in v0.2.0

type Record struct {
	// contains filtered or unexported fields
}

Record represents a record.

func (*Record) Bool added in v0.2.0

func (a *Record) Bool(key string) bool

Bool gets the record value as bool.

func (*Record) Float added in v0.2.0

func (a *Record) Float(key string) float64

Float gets the record value as float64.

func (*Record) Int added in v0.2.0

func (a *Record) Int(key string) int

Int gets the record value as int.

func (*Record) String added in v0.2.0

func (a *Record) String(key string) string

String gets the record value as string.

func (*Record) Time added in v0.2.0

func (a *Record) Time(key string) time.Time

Time gets the record value as time.

type Records added in v0.2.0

type Records struct {
	// contains filtered or unexported fields
}

Records represents a records.

func (*Records) Begin added in v0.2.0

func (a *Records) Begin() *Record

Begin begins a iteration and returns the first record.

func (*Records) Next added in v0.2.0

func (a *Records) Next() *Record

Next returns the next record.

type Sheet

type Sheet struct {
	// contains filtered or unexported fields
}

Sheet represents the worksheet.

func (*Sheet) Cell

func (a *Sheet) Cell(ref string) *Cell

Cell returns the cell by index.

func (*Sheet) DeleteCols

func (a *Sheet) DeleteCols(j int, n int)

DeleteCols deletes n cols from index j.

func (*Sheet) DeleteRows

func (a *Sheet) DeleteRows(i int, m int)

DeleteRows deletes m rows from index i.

func (*Sheet) Dim

func (a *Sheet) Dim() (m int, n int)

Dim returns the length of rows and cols.

func (*Sheet) ExtendCols

func (a *Sheet) ExtendCols(j int, n int, count int)

ExtendCols extends n cols at index j.

func (*Sheet) ExtendRows

func (a *Sheet) ExtendRows(i int, m int, count int)

ExtendRows extends m rows at index i.

func (*Sheet) GetRecords added in v0.2.1

func (a *Sheet) GetRecords(head int, sep string, skip, drop int) *Records

GetRecords returns the records.

func (*Sheet) ICell

func (a *Sheet) ICell(i, j int) *Cell

ICell returns the cell by index.

func (*Sheet) IMerge

func (a *Sheet) IMerge(i, j int, m, n int)

IMerge merges the cells by index.

func (*Sheet) Merge

func (a *Sheet) Merge(ref string)

Merge merges the cells by ref.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL