Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSheet ¶
RegisterSheet ... registers a SheetFunc with the given 'name'. A SheetFunc must be registered before calling 'AddSheet' to add sheets.
Types ¶
type Column ¶
Column ... used to describe a column on a sheet if FieldName is empty, the column is considered to be static
type Payload ¶
type Payload struct { Static []string Items []interface{} }
Payload ... used by Update and UpdateSheet to populate a sheet with particular datasets. Static is prepended to every row created by Items. Items should be a slice of objects
type Sheet ¶
Sheet ... holds a pointer to the underlying xlsx.Sheet, the sheet name, and all of the columns returned by the SheetFunc
type SheetFunc ¶
type SheetFunc func() *Sheet
SheetFunc ... used by RegisterSheet to register sheets allow to be used by the AWS report
type Spreadsheet ¶
Spreadsheet ... holds the desired filename and all sheets created by calling 'AddSheet'
func New ¶
func New(name string) *Spreadsheet
New ... returns a *Spreadsheet, and sets the filename to the provided 'name'
func (*Spreadsheet) AddSheet ¶
func (ss *Spreadsheet) AddSheet(name string) error
AddSheet ... creates a new sheet using the matching SheetFunc given the provided 'name'. Then initializes the sheet by creating the header row and adding the column names
func (*Spreadsheet) Bytes ¶
func (ss *Spreadsheet) Bytes() (*bytes.Reader, error)
Bytes ... creates a bytes.Buffer, saves the underlying xlsx.File to the buffer, then returns the bytes wrapped in a bytes.Reader
func (*Spreadsheet) UpdateSheet ¶
func (ss *Spreadsheet) UpdateSheet(name string, payload *Payload)
UpdateSheet ... finds the sheet matching the given 'name', then calls Update passing the payload provided