gcsv

package
v0.0.0-...-2bcc11b Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalBytes

func MarshalBytes(v any, keepHeader bool) ([]byte, error)

MarshalBytes encode `v` into bytes. Note: \r(carriage return) before \n(newline characters) are silently removed, for example: string "hello\r\nworld" after csv encodiing will be "hello\nworld".

func MarshalString

func MarshalString(v any, keepHeader bool) (string, error)

func ReadHeaders

func ReadHeaders(in []byte) ([]string, error)

func ReplaceHeaders

func ReplaceHeaders(in []byte, newHeaders []string) ([]byte, error)

func UnmarshalBytes

func UnmarshalBytes(in []byte, outArrPtr any) error

UnmarshalBytes decode `in` bytes into array pointer `out`.

Types

type Table

type Table struct {
	Headers []string
	Data    [][]string
	// contains filtered or unexported fields
}

func UnmarshalToTable

func UnmarshalToTable(in []byte) (*Table, error)

func (*Table) Height

func (t *Table) Height() int

func (*Table) Len

func (t *Table) Len() int

func (*Table) Less

func (t *Table) Less(i, j int) bool

func (*Table) ReadAll

func (t *Table) ReadAll(types map[string]any) ([]map[string]any, error)

func (*Table) ReadRowWithTypes

func (t *Table) ReadRowWithTypes(rowIdx int, types map[string]any) (map[string]any, error)

func (*Table) SetSortIdIdx

func (t *Table) SetSortIdIdx(idx int) error

func (*Table) Swap

func (t *Table) Swap(i, j int)

func (*Table) Verify

func (t *Table) Verify() error

func (*Table) Width

func (t *Table) Width() int

Jump to

Keyboard shortcuts

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