findex

package
v0.0.0-...-bd774c8 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 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 CSVFile

type CSVFile[K comparable, V any, R Row[V]] struct {
	// contains filtered or unexported fields
}

func (*CSVFile[K, V, R]) Close

func (file *CSVFile[K, V, R]) Close()

func (*CSVFile[K, V, R]) FindIndex

func (file *CSVFile[K, V, R]) FindIndex(index int64) (*V, error)

func (*CSVFile[K, V, R]) FindKey

func (file *CSVFile[K, V, R]) FindKey(key K) (*V, error)

func (*CSVFile[K, V, R]) FindKeySlice

func (file *CSVFile[K, V, R]) FindKeySlice(key K) ([]*V, error)

func (*CSVFile[K, V, R]) FindOffset

func (file *CSVFile[K, V, R]) FindOffset(offset int64) (*V, error)

func (*CSVFile[K, V, R]) Index

func (file *CSVFile[K, V, R]) Index() error

func (*CSVFile[K, V, R]) RowCount

func (file *CSVFile[K, V, R]) RowCount() int64

type File

type File[K comparable, V any] interface {
	Close()
	Index() error
	RowCount() int64
	FindKey(key K) (*V, error)
	FindKeySlice(key K) ([]*V, error)
	FindIndex(index int64) (*V, error)
}

func NewCSV

func NewCSV[K comparable, V any, R Row[V]](path string, rowHandler func(data []string) K) (File[K, V], error)

type Row

type Row[T any] interface {
	UnmarshalCsv([]string) error
	*T
}

Jump to

Keyboard shortcuts

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