file

package
v0.0.0-...-c08e9e3 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVReader

type CSVReader struct{}

CSVReader is a reader for csv file

func (*CSVReader) Read

func (r *CSVReader) Read(path string) (file *File, err error)

type Cell

type Cell struct {
	Row   int
	Col   int
	Value string
}

Cell represents a single cell in the grid

type File

type File struct {
	Name   string
	Sheets []*Sheet
}

File is a file that is read and parsed

type Grid

type Grid struct {

	// Total number of rows and columns
	RowTotal int
	ColTotal int
	// Offset for pagination
	RowOff int
	ColOff int
	// Limit for pagination
	RowLim int
	ColLim int
	// contains filtered or unexported fields
}

Grid holds the state of the cell grid

func (*Grid) GetCell

func (g *Grid) GetCell(row, col int) *Cell

GetCell retuns the cell at the position provided The cell will be created if it is not present

func (*Grid) SetCell

func (g *Grid) SetCell(row, col int, value string)

SetCell sets the cell value for the position provided The cell will be created if it is not present

type Reader

type Reader interface {
	Read(path string) (*File, error)
}

Reader is a file reader

type Sheet

type Sheet struct {
	Name string
	Grid *Grid
}

Sheet is a single sheet in a file

type XLSXReader

type XLSXReader struct{}

XLSXReader is a reader for xlsx file

func (*XLSXReader) Read

func (r *XLSXReader) Read(path string) (file *File, err error)

Jump to

Keyboard shortcuts

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