dataloader

package module
v0.0.0-...-5829b2f Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: MIT Imports: 0 Imported by: 0

README

csvloader

Data loader for CSV files

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RLoader

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

func NewRLoader

func NewRLoader(header TableHeader, data []string) *RLoader

func (*RLoader) Load

func (loader *RLoader) Load(label string) string

func (*RLoader) WithDefault

func (loader *RLoader) WithDefault(defaultVal string) *RLoader

type TLoader

type TLoader[T comparable] struct {
	*RLoader
	// contains filtered or unexported fields
}

func NewTLoader

func NewTLoader[T comparable](rLoader *RLoader, parser func(s string) T) *TLoader[T]

func (*TLoader[T]) Load

func (loader *TLoader[T]) Load(label string) T

func (*TLoader[T]) WithDefault

func (loader *TLoader[T]) WithDefault(defaultVal T) *TLoader[T]

type Table

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

func NewDataTable

func NewDataTable(data [][]string) *Table

func (*Table) Header

func (table *Table) Header() TableHeader

func (*Table) Rows

func (table *Table) Rows() [][]string

type TableHeader

type TableHeader map[string]int

func NewTableHeader

func NewTableHeader(labels []string) TableHeader

Jump to

Keyboard shortcuts

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