Documentation ¶
Overview ¶
Package models contains the data models used in the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct { ID string `json:"id"` WorkbookID string `json:"workbook_id"` SheetID string `json:"sheet_id"` Row int `json:"row"` Column string `json:"column"` Value interface{} `json:"value"` }
Cell represents a single cell in a spreadsheet
func NewCell ¶
func NewCell(workbook_id string, sheet_id string, row int, column string, value interface{}, id string) (*Cell, error)
NewCell creates a new Cell instance. If id is empty, a new UUID will be generated.
func (*Cell) GetPosition ¶
GetPosition returns the position of the cell as a string, concatenating the column and row information.
type Extension ¶
type Extension string
Extension represents the type of file extension for a workbook.
type Sheet ¶
type Sheet struct { ID string `json:"id"` WorkbookID string `json:"workbook_id"` Pos int `json:"pos"` // Position of the sheet within the spreadsheet Name string `json:"name"` // Name of the sheet Cells []Cell `json:"cells"` // Collection of cells within the sheet }
Sheet represents a single worksheet within a spreadsheet. It contains a collection of cells, a name, and a position.
type Workbook ¶
type Workbook struct { ID string `json:"id"` FileName string `json:"file_name"` Extension Extension `json:"extension"` // File extension (e.g., xls, xlsx) FolderPath string `json:"folder_path"` // Folder path where the workbook is located Sheets []Sheet `json:"sheets"` // Sheets within the workbook }
Workbook represents a spreadsheet file containing multiple sheets. It has an ID, file name, extension, and a folder path where it is located.
func NewWorkbook ¶
NewWorkbook initializes a new Workbook instance. If id is not provided, a new UUID will be generated.
func (*Workbook) GetFullPath ¶
GetFullPath constructs and returns the full path of the workbook.