files

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BOM = []byte{239, 187, 191}

BOM is the pattern of BOM bytes that can contains CSV file

Functions

This section is empty.

Types

type File

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

File represent CSV file

func NewFile added in v0.2.1

func NewFile(path string, config config.Config) (*File, error)

func (*File) FirstIsHeader

func (f *File) FirstIsHeader() bool

FirstIsHeader gets information about first line, is it header or not

func (*File) HasHeader

func (f *File) HasHeader(value string) bool

HasHeader checks if specific header exists or not

func (*File) Headers added in v0.2.1

func (f *File) Headers() []string

Headers returns list of headers

func (*File) HeadersCount

func (f *File) HeadersCount() int

HeadersCount return len of headers map

func (*File) Path

func (f *File) Path() string

Path returns path to file

func (*File) Stream added in v0.2.1

func (f *File) Stream() <-chan Row

Stream returns chanel of row.

type Files

type Files []*File

Files slice of File

func NewFiles

func NewFiles(config config.Config) (Files, error)

NewFiles create a new Files from path

type Row added in v0.2.1

type Row struct {
	Data  []string
	Index int
}

Row represents row from csv file as slice of string

Jump to

Keyboard shortcuts

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