ioreader

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileReader

type FileReader struct {
	cio.Reader
	// contains filtered or unexported fields
}

func NewFileReader

func NewFileReader(path string) *FileReader

NewFileReader create an instance of our FileReader

func (*FileReader) AsBytes

func (r *FileReader) AsBytes() ([]byte, error)

AsBytes read file into []byte

func (*FileReader) AsCSVIntoMap

func (r *FileReader) AsCSVIntoMap() *map[string]string

AsCSVIntoMap read csv file into map[string]string

func (*FileReader) AsCSVIntoOrderedMap

func (r *FileReader) AsCSVIntoOrderedMap() (*orderedmap.OrderedMap, error)

AsCSVIntoOrderedMap read csv into an ordered map

func (*FileReader) AsString

func (r *FileReader) AsString() (string, error)

AsString read file as a string

func (*FileReader) Bytes

func (r *FileReader) Bytes(buf []byte)

Bytes read file into passed byte array

func (*FileReader) LineScanner

func (r *FileReader) LineScanner(maxBuf, maxScanTokenSize int) (string, error)

LineScanner does not deal well with lines longer than 65536 characters In that case set the scanner.Buffer([], MAXSIZE) to a larger value

MaxScanTokenSize = 64 * 1024 startBufSize = 4096 // Size of initial allocation for buffer.

@maxBuf 4096

func (*FileReader) ReadCSVFromFile

func (r *FileReader) ReadCSVFromFile(filePath string, skipHeader bool, headAr []string) (*data.Table, error)

ReadCSVFromFile read csv from file on FileReader

func (*FileReader) URL

func (r *FileReader) URL(url string) error

type String

type String struct {
}

func (*String) AsBytes

func (s *String) AsBytes() ([]byte, error)

AsBytes read file into []byte

func (*String) AsCSVIntoMap

func (s *String) AsCSVIntoMap() *map[string]string

AsCSVIntoMap read csv file into map[string]string

func (*String) AsCSVIntoOrderedMap

func (s *String) AsCSVIntoOrderedMap() (*orderedmap.OrderedMap, error)

AsCSVIntoOrderedMap read csv into an ordered map

func (*String) AsString

func (s *String) AsString() (string, error)

AsString read file as a string

func (*String) Bytes

func (s *String) Bytes(buf []byte)

Bytes read file into passed byte array

func (*String) LineScanner

func (s *String) LineScanner(maxBuf, maxScanTokenSize int) (string, error)

func (*String) ReadLine

func (s *String) ReadLine(br *bufio.Reader) (string, error)

Line returns a single line (without the ending \n) from the input buffered reader. An error is returned if` there is an error with the buffered reader.

Directories

Path Synopsis
testing command

Jump to

Keyboard shortcuts

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