table

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package table is data a work carries: a table of rows and columns, made into a spreadsheet (XLSX) or a CSV file. Both are made from the same data.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmpty = errors.New("table: no columns")

Functions

This section is empty.

Types

type CSV

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

func (CSV) CleanData

func (CSV) CleanData(raw json.RawMessage) (json.RawMessage, error)

func (CSV) DataHelp

func (CSV) DataHelp() string

func (CSV) DataSchema

func (CSV) DataSchema() map[string]any

func (CSV) Describe

func (CSV) Describe() string

func (CSV) Ext

func (CSV) Ext() string

func (CSV) MediaType

func (CSV) MediaType() string

func (CSV) Name

func (CSV) Name() string

func (CSV) Needs

func (CSV) Needs() string

func (CSV) Render

func (CSV) Render(w memory.Work, _ string) ([]byte, error)

func (CSV) WriteHelp

func (CSV) WriteHelp() string

type Table

type Table struct {
	Columns []string   `json:"columns"`
	Rows    [][]string `json:"rows"`
}

func Parse

func Parse(raw []byte) (Table, error)

Parse reads a table as JSON and cleans it: cells trimmed and cut at maxCell, rows fitted to the columns, empty rows dropped. A table with headings and no rows is a template to fill in, so it's kept.

type XLSX

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

func (XLSX) CleanData

func (XLSX) CleanData(raw json.RawMessage) (json.RawMessage, error)

func (XLSX) DataHelp

func (XLSX) DataHelp() string

func (XLSX) DataSchema

func (XLSX) DataSchema() map[string]any

func (XLSX) Describe

func (XLSX) Describe() string

func (XLSX) Ext

func (XLSX) Ext() string

func (XLSX) MediaType

func (XLSX) MediaType() string

func (XLSX) Name

func (XLSX) Name() string

func (XLSX) Needs

func (XLSX) Needs() string

func (XLSX) Render

func (XLSX) Render(w memory.Work, _ string) ([]byte, error)

func (XLSX) WriteHelp

func (XLSX) WriteHelp() string

Jump to

Keyboard shortcuts

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